diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-31 12:43:29 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-31 12:43:29 +0000 |
commit | ff9038093a6f3f629bcd8115a714cadc3ea48ad1 (patch) | |
tree | 50fa0015aa03008a453a0de16c8f341444056875 /gcc/testsuite | |
parent | 47f11e8447f11764c88fec0d3963c5e1e7f4c078 (diff) | |
download | gcc-ff9038093a6f3f629bcd8115a714cadc3ea48ad1.tar.gz |
PR preprocessor/15638
gcc:
* c-common.c (c_cpp_error): Handle CPP_DL_FATAL.
gcc/fortran:
* cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
gcc/testsuite:
* gcc.dg/cpp/missing-header-1.c: New test.
* gcc.dg/cpp/include2.c: Only test #include <>. Expect
"compilation terminated" message.
* gcc.dg/cpp/include2a.c: New test. Copy of include2.c but only
test #include "".
* gcc.dg/pch/counter-2.c, gcc.dg/pch/valid-1.c,
gcc.dg/pch/valid-2.c, gcc.dg/pch/warn-1.c: Expect "compilation
terminated" message.
libcpp:
* files.c (_cpp_find_file): Call open_file_failed after diagnosing
invalid PCH.
(open_file_failed): Make error for missing file fatal.
* include/cpplib.h (CPP_DL_FATAL): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145341 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/include2.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/include2a.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/missing-header-1.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/counter-2.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/valid-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/valid-2.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/warn-1.c | 1 |
8 files changed, 42 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c21f1074cfb..3593c7d538b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2009-03-31 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/15638 + * gcc.dg/cpp/missing-header-1.c: New test. + * gcc.dg/cpp/include2.c: Only test #include <>. Expect + "compilation terminated" message. + * gcc.dg/cpp/include2a.c: New test. Copy of include2.c but only + test #include "". + * gcc.dg/pch/counter-2.c, gcc.dg/pch/valid-1.c, + gcc.dg/pch/valid-2.c, gcc.dg/pch/warn-1.c: Expect "compilation + terminated" message. + 2009-03-31 Richard Guenther <rguenther@suse.de> PR middle-end/23401 diff --git a/gcc/testsuite/gcc.dg/cpp/include2.c b/gcc/testsuite/gcc.dg/cpp/include2.c index cda818ed5af..67f1065ae8c 100644 --- a/gcc/testsuite/gcc.dg/cpp/include2.c +++ b/gcc/testsuite/gcc.dg/cpp/include2.c @@ -8,9 +8,8 @@ /* Source: Neil Booth, 4 Nov 2000. */ #include <silly\>> /* { dg-error "extra tokens" "" } */ -#include "silly\"" /* { dg-error "extra tokens" "" } */ /* These error is No such file or directory, just once. However, this message is locale-dependent, so don't test for it. */ /* { dg-error "silly" "" { target *-*-* } 10 } */ -/* { dg-error "missing" "" { target *-*-* } 11 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/include2a.c b/gcc/testsuite/gcc.dg/cpp/include2a.c new file mode 100644 index 00000000000..974f3f33263 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/include2a.c @@ -0,0 +1,16 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ + +/* Tests that #include does not allow the terminating '>' or '"' to be + escaped, as per the standard. */ + +/* Source: Neil Booth, 4 Nov 2000. */ + +#include "silly\"" /* { dg-error "extra tokens" "" } */ + +/* These error is No such file or directory, just once. However, this + message is locale-dependent, so don't test for it. */ +/* { dg-error "silly" "" { target *-*-* } 10 } */ +/* { dg-error "missing" "" { target *-*-* } 10 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/missing-header-1.c b/gcc/testsuite/gcc.dg/cpp/missing-header-1.c new file mode 100644 index 00000000000..5445d4c4fec --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/missing-header-1.c @@ -0,0 +1,9 @@ +/* Test that missing headers are fatal errors. PR 15638. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +#include "nonexistent.h" /* { dg-error "nonexistent.h" } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ + +/* This declaration should not receive any diagnostic. */ +foo bar; diff --git a/gcc/testsuite/gcc.dg/pch/counter-2.c b/gcc/testsuite/gcc.dg/pch/counter-2.c index 22ba245b698..6dd2245d7d8 100644 --- a/gcc/testsuite/gcc.dg/pch/counter-2.c +++ b/gcc/testsuite/gcc.dg/pch/counter-2.c @@ -10,6 +10,7 @@ #include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */ /* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 10 } */ /* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ int main(void) { diff --git a/gcc/testsuite/gcc.dg/pch/valid-1.c b/gcc/testsuite/gcc.dg/pch/valid-1.c index 1bf7d914467..3ee90916591 100644 --- a/gcc/testsuite/gcc.dg/pch/valid-1.c +++ b/gcc/testsuite/gcc.dg/pch/valid-1.c @@ -3,5 +3,6 @@ #include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */ /* { dg-error "No such file" "no such file" { target *-*-* } 3 } */ /* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ int x; diff --git a/gcc/testsuite/gcc.dg/pch/valid-2.c b/gcc/testsuite/gcc.dg/pch/valid-2.c index 4dbc4b2d37d..34269a87960 100644 --- a/gcc/testsuite/gcc.dg/pch/valid-2.c +++ b/gcc/testsuite/gcc.dg/pch/valid-2.c @@ -3,4 +3,5 @@ #include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */ /* { dg-error "No such file" "no such file" { target *-*-* } 3 } */ /* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ int x; diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.c b/gcc/testsuite/gcc.dg/pch/warn-1.c index eaa9cafc39a..64944c776d8 100644 --- a/gcc/testsuite/gcc.dg/pch/warn-1.c +++ b/gcc/testsuite/gcc.dg/pch/warn-1.c @@ -5,6 +5,7 @@ #include "warn-1.h"/* { dg-warning "not used because .DEFINED_VALUE. is defined" } */ /* { dg-error "No such file" "no such file" { target *-*-* } 5 } */ /* { dg-error "they were invalid" "invalid files" { target *-*-* } 5 } */ +/* { dg-message "terminated" "" { target *-*-* } 0 } */ int main(void) |