merge pragma poison tests into one file with -verify mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69538 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Preprocessor/poison.c b/test/Preprocessor/poison.c
index 9759ae4..d91feb7 100644
--- a/test/Preprocessor/poison.c
+++ b/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.