summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-19 20:15:59 +0000
committerChris Lattner <sabre@nondot.org>2009-04-19 20:15:59 +0000
commit0e71dbf9f01990a4abfadb1019eb9919fd184c74 (patch)
tree3470cadc723f7675818a0c25a360353c6aaf0f37 /clang
parentab9d51cfc40eef8133ea1d044d30cf687cfd5df2 (diff)
downloadbcm5719-llvm-0e71dbf9f01990a4abfadb1019eb9919fd184c74.tar.gz
bcm5719-llvm-0e71dbf9f01990a4abfadb1019eb9919fd184c74.zip
merge pragma poison tests into one file with -verify mode.
llvm-svn: 69538
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Preprocessor/_Pragma-poison.c8
-rw-r--r--clang/test/Preprocessor/macro_paste_bad.c2
-rw-r--r--clang/test/Preprocessor/poison.c20
-rw-r--r--clang/test/Preprocessor/poison_expansion.c9
4 files changed, 18 insertions, 21 deletions
diff --git a/clang/test/Preprocessor/_Pragma-poison.c b/clang/test/Preprocessor/_Pragma-poison.c
deleted file mode 100644
index 742f88532ee..00000000000
--- a/clang/test/Preprocessor/_Pragma-poison.c
+++ /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
-
diff --git a/clang/test/Preprocessor/macro_paste_bad.c b/clang/test/Preprocessor/macro_paste_bad.c
index 3aafd84071e..f70c3b3ba2e 100644
--- a/clang/test/Preprocessor/macro_paste_bad.c
+++ b/clang/test/Preprocessor/macro_paste_bad.c
@@ -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}}
-
diff --git a/clang/test/Preprocessor/poison.c b/clang/test/Preprocessor/poison.c
index 9759ae473fe..d91feb7ff2d 100644
--- a/clang/test/Preprocessor/poison.c
+++ b/clang/test/Preprocessor/poison.c
@@ -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/clang/test/Preprocessor/poison_expansion.c b/clang/test/Preprocessor/poison_expansion.c
deleted file mode 100644
index 45676c8e6cb..00000000000
--- a/clang/test/Preprocessor/poison_expansion.c
+++ /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');
OpenPOWER on IntegriCloud