]> granicus.if.org Git - clang/commitdiff
merge pragma poison tests into one file with -verify mode.
authorChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 20:15:59 +0000 (20:15 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Apr 2009 20:15:59 +0000 (20:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69538 91177308-0d34-0410-b5e6-96231b3b80d8

test/Preprocessor/_Pragma-poison.c [deleted file]
test/Preprocessor/macro_paste_bad.c
test/Preprocessor/poison.c
test/Preprocessor/poison_expansion.c [deleted file]

diff --git a/test/Preprocessor/_Pragma-poison.c b/test/Preprocessor/_Pragma-poison.c
deleted file mode 100644 (file)
index 742f885..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: clang-cc -Eonly %s 2>&1 | grep error | wc -l | grep 1 &&
-// RUN: clang-cc -Eonly %s 2>&1 | grep 7:4 | wc -l | grep 1
-
-#define BAR _Pragma ("GCC poison XYZW")  XYZW /*NO ERROR*/
-XYZW   // NO ERROR
-BAR
-   XYZW   // ERROR
-
index 3aafd84071ebf643f05c1d3328276f3643c4ee07..f70c3b3ba2e6cef7a7dbb49d0e0edba7a587820d 100644 (file)
@@ -4,7 +4,6 @@
 XYZ
 
 // GCC PR 20077
-// RUN: clang-cc -Eonly %s -verify
 
 #define a   a ## ## // expected-error {{'##' cannot appear at end of macro expansion}}
 #define b() b ## ## // expected-error {{'##' cannot appear at end of macro expansion}}
@@ -19,4 +18,3 @@ XYZ
 #define i   ##      // expected-error {{'##' cannot appear at start of macro expansion}}
 #define j() ##      // expected-error {{'##' cannot appear at start of macro expansion}}
 
-
index 9759ae473fed9a55a8d9b8f8f3ae0152d40ab5f4..d91feb7ff2deeaec947063e706ac8afa85d3342c 100644 (file)
@@ -1,4 +1,20 @@
-// RUN: clang-cc %s -E 2>&1 | grep error
+// RUN: clang-cc %s -Eonly -verify
 
 #pragma GCC poison rindex
-rindex(some_string, 'h');
+rindex(some_string, 'h');   // expected-error {{attempt to use a poisoned identifier}}
+
+#define BAR _Pragma ("GCC poison XYZW")  XYZW /*NO ERROR*/
+  XYZW      // ok
+BAR
+  XYZW      // expected-error {{attempt to use a poisoned identifier}}
+
+// Pragma poison shouldn't warn from macro expansions defined before the token
+// is poisoned.
+
+#define strrchr rindex2
+#pragma GCC poison rindex2
+
+// Can poison multiple times.
+#pragma GCC poison rindex2
+
+strrchr(some_string, 'h');   // ok.
diff --git a/test/Preprocessor/poison_expansion.c b/test/Preprocessor/poison_expansion.c
deleted file mode 100644 (file)
index 45676c8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: clang-cc %s -E 2>&1 | not grep error
-
-#define strrchr rindex
-#pragma GCC poison rindex
-
-// Can poison multiple times.
-#pragma GCC poison rindex
-
-strrchr(some_string, 'h');