diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/c++98.cc | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/cpp.exp | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/extratokens.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/headermap-1.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/headermap-2.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/headermap.hmap | bin | 0 -> 932 bytes | |||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/if-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/inc/A.h | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/inc/bA.h | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/inc/c.h | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/inc/d/d.h | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/include2.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/skipping2.c | 2 |
16 files changed, 98 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc b/gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc new file mode 100644 index 00000000000..1e8c160a96f --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc @@ -0,0 +1,11 @@ +/* APPLE LOCAL file rename for HFS */ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ +/* { dg-options "-std=c++98 -pedantic" } */ + +/* This file is for testing the preprocessor in -std=c++98 -pedantic mode. + Neil Booth, 2 Dec 2000. */ + +#if 1LL /* { dg-warning "long long" } */ +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/c++98.cc b/gcc/testsuite/gcc.dg/cpp/c++98.cc new file mode 100644 index 00000000000..a9843b878fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/c++98.cc @@ -0,0 +1,11 @@ +/* APPLE LOCAL file rename for HFS */ +/* Copyright (C) 2000 Free Software Foundation, Inc. */ + +/* { dg-do preprocess } */ +/* { dg-options "-std=c++98" } */ + +/* This file is for testing the preprocessor in -std=c++98 mode. + Neil Booth, 2 Dec 2000. */ + +#if 1LL +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp index 960a29182d0..d1ed5e8c981 100644 --- a/gcc/testsuite/gcc.dg/cpp/cpp.exp +++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp @@ -23,6 +23,13 @@ if [is_remote host] { } } +# APPLE LOCAL begin headermaps +file mkdir d +foreach header { A.h bA.h c.h d/d.h } { + remote_download host $srcdir/$subdir/inc/$header $header +} +# APPLE LOCAL end headermaps + # Load support procs. load_lib gcc-dg.exp diff --git a/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c b/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c index d5c6eb960e6..0b2124bd512 100644 --- a/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c +++ b/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c @@ -3,6 +3,8 @@ /* { dg-do preprocess } */ /* { dg-options "-Wno-endif-labels -pedantic" } */ +/* APPLE LOCAL -Wextra-tokens */ +/* { dg-options "-Wextra-tokens -Wno-endif-labels -pedantic" { target *-apple-darwin* } } */ /* Tests combinations of -pedantic and -Wno-endif-labels; see extratokens2.c for more general tests. */ diff --git a/gcc/testsuite/gcc.dg/cpp/extratokens.c b/gcc/testsuite/gcc.dg/cpp/extratokens.c index c06a41d4c2b..125a9bdf805 100644 --- a/gcc/testsuite/gcc.dg/cpp/extratokens.c +++ b/gcc/testsuite/gcc.dg/cpp/extratokens.c @@ -1,7 +1,8 @@ /* Copyright (C) 2000 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ -/* { dg-options "-fno-show-column" } */ +/* APPLE LOCAL -Wextra-tokens */ +/* { dg-options "-fno-show-column -Wextra-tokens" } */ /* Tests all directives that do not permit excess tokens at the end of the line. */ diff --git a/gcc/testsuite/gcc.dg/cpp/headermap-1.c b/gcc/testsuite/gcc.dg/cpp/headermap-1.c new file mode 100644 index 00000000000..bb8e1f4cd2c --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/headermap-1.c @@ -0,0 +1,17 @@ +/* APPLE LOCAL file headermaps */ +/* Copyright (C) 2005 Free Software Foundation, Inc. */ + +/* { dg-do compile } */ +/* { dg-options "-I $srcdir/gcc.dg/cpp/headermap.hmap" } */ + +#define COUNT 1 +#include <A.h> +#include <bA.h> +#include <c.h> +#import <d.h> +#import <d.h> +#import <A.h> + +#if COUNT != 5 + #error COUNT not 5 in headermap-1 +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/headermap-2.c b/gcc/testsuite/gcc.dg/cpp/headermap-2.c new file mode 100644 index 00000000000..b6a748bc83a --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/headermap-2.c @@ -0,0 +1,15 @@ +/* APPLE LOCAL file headermaps */ +/* Copyright (C) 2005 Free Software Foundation, Inc. */ + +/* { dg-do compile } */ +/* { dg-options "-I $srcdir/gcc.dg/cpp/headermap.hmap" } */ + +#define COUNT 1 +#include <a.h> /* { dg-warning "mismatched case" } */ +#include <Ba.h> /* { dg-warning "mismatched case" } */ +#include <C.h> /* { dg-warning "mismatched case" } */ +#import <c.h> + +#if COUNT != 4 + #error COUNT not 4 in headermap-d21 +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/headermap.hmap b/gcc/testsuite/gcc.dg/cpp/headermap.hmap Binary files differnew file mode 100644 index 00000000000..f9b70b5cce5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/headermap.hmap diff --git a/gcc/testsuite/gcc.dg/cpp/if-2.c b/gcc/testsuite/gcc.dg/cpp/if-2.c index 8bca251b46b..8237112078d 100644 --- a/gcc/testsuite/gcc.dg/cpp/if-2.c +++ b/gcc/testsuite/gcc.dg/cpp/if-2.c @@ -1,5 +1,7 @@ /* { dg-do preprocess } */ /* { dg-options -pedantic-errors } */ +/* APPLE LOCAL -Wfour-char-constants */ +/* { dg-options "-Wfour-char-constants" { target *-apple-darwin* } } */ #if 'a' != 'a' || '\001' != 1 || '\x12' != 0x12 #error a,1,0x12 /* { dg-bogus "#error" "basic charconst recognition" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/inc/A.h b/gcc/testsuite/gcc.dg/cpp/inc/A.h new file mode 100644 index 00000000000..a1a6ef851c3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/inc/A.h @@ -0,0 +1,6 @@ +/* APPLE LOCAL file headermaps */ +#if COUNT != 1 + #error COUNT not 1 +#endif +#undef COUNT +#define COUNT 2 diff --git a/gcc/testsuite/gcc.dg/cpp/inc/bA.h b/gcc/testsuite/gcc.dg/cpp/inc/bA.h new file mode 100644 index 00000000000..4ba328017bf --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/inc/bA.h @@ -0,0 +1,6 @@ +/* APPLE LOCAL file headermaps */ +#if COUNT != 2 + #error COUNT not 2 in bA +#endif +#undef COUNT +#define COUNT 3 diff --git a/gcc/testsuite/gcc.dg/cpp/inc/c.h b/gcc/testsuite/gcc.dg/cpp/inc/c.h new file mode 100644 index 00000000000..48a738aa7cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/inc/c.h @@ -0,0 +1,6 @@ +/* APPLE LOCAL file headermaps */ +#if COUNT != 3 + #error COUNT not 3 in c +#endif +#undef COUNT +#define COUNT 4 diff --git a/gcc/testsuite/gcc.dg/cpp/inc/d/d.h b/gcc/testsuite/gcc.dg/cpp/inc/d/d.h new file mode 100644 index 00000000000..29173816d0a --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/inc/d/d.h @@ -0,0 +1,7 @@ +/* APPLE LOCAL file headermaps */ +#if COUNT != 4 + #error COUNT not 4 in d +#endif +#undef COUNT +#define COUNT 5 + diff --git a/gcc/testsuite/gcc.dg/cpp/include2.c b/gcc/testsuite/gcc.dg/cpp/include2.c index 60edfccb0cd..f4f6ab41f9d 100644 --- a/gcc/testsuite/gcc.dg/cpp/include2.c +++ b/gcc/testsuite/gcc.dg/cpp/include2.c @@ -1,10 +1,10 @@ /* Copyright (C) 2000 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ - +/* APPLE LOCAL begin -Wextra-tokens */ /* Tests that #include does not allow the terminating '>' or '"' to be escaped, as per the standard. */ - +/* { dg-options "-Wextra-tokens" } */ /* Source: Neil Booth, 4 Nov 2000. */ #include <silly\>> /* { dg-warning "extra tokens" "" } */ @@ -13,4 +13,4 @@ /* 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 } */ - +/* APPLE LOCAL end */ diff --git a/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c b/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c new file mode 100644 index 00000000000..e3dca859b32 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c @@ -0,0 +1 @@ +/* APPLE LOCAL file mainline 2005-03-04 */
/* Test no newline at eof warning when Mac line ending is used*/
/* { dg-do compile } */
int main() { return 0; }
\ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/cpp/skipping2.c b/gcc/testsuite/gcc.dg/cpp/skipping2.c index 3b0d0f32c8e..61428c2b989 100644 --- a/gcc/testsuite/gcc.dg/cpp/skipping2.c +++ b/gcc/testsuite/gcc.dg/cpp/skipping2.c @@ -1,6 +1,8 @@ /* Copyright (C) 2001 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ +/* APPLE LOCAL -Wextra-tokens */ +/* { dg-options "-Wextra-tokens" } */ /* Tests that excess tokens in skipped conditional blocks don't warn. */ |