From 02ff568ab936e0bd7ffbcdb160d5d9e80f92385c Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Tue, 28 Mar 2000 19:20:29 +0000 Subject: [PATCH] New test cases From-SVN: r32785 --- gcc/testsuite/gcc.dg/cpp-hash1.c | 9 +++++++++ gcc/testsuite/gcc.dg/cpp-hash2.c | 15 +++++++++++++++ gcc/testsuite/gcc.dg/cpp-ifparen.c | 7 +++++++ 3 files changed, 31 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp-hash1.c create mode 100644 gcc/testsuite/gcc.dg/cpp-hash2.c create mode 100644 gcc/testsuite/gcc.dg/cpp-ifparen.c diff --git a/gcc/testsuite/gcc.dg/cpp-hash1.c b/gcc/testsuite/gcc.dg/cpp-hash1.c new file mode 100644 index 00000000000..a4c4b3516df --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp-hash1.c @@ -0,0 +1,9 @@ +/* Test for proper handling of # in object-like macros. + From Linux kernel. */ +/* { dg-do preprocess } */ + +#define FIXUP .section ".fixup",#alloc,#execinstr + +FIXUP + +/* { dg-bogus "not followed by" "object-like #" { target *-*-* } 3 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-hash2.c b/gcc/testsuite/gcc.dg/cpp-hash2.c new file mode 100644 index 00000000000..b47c2a29842 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp-hash2.c @@ -0,0 +1,15 @@ +/* Test for erroneously thinking comments are token-pastes. + From XFree86 4.0. */ +/* { dg-do preprocess } */ +/* { dg-options "-traditional" } */ + +#ifndef foo +#define foo /**/ +#endif + +#ifndef foo +#define foo /* as nothing */ +#endif + +/* { dg-bogus "(start|end) of macro" "/**/ at end" { target *-*-* } 7 } */ +/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */ diff --git a/gcc/testsuite/gcc.dg/cpp-ifparen.c b/gcc/testsuite/gcc.dg/cpp-ifparen.c new file mode 100644 index 00000000000..39e112eb664 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp-ifparen.c @@ -0,0 +1,7 @@ +#if 2048 < (16 * (40) + 192) +#error /* { dg-bogus "error" "with paren" } */ +#endif + +#if 2048 < (16 * 40 + 192) +#error /* { dg-bogus "error" "without paren" } */ +#endif -- 2.30.2