summaryrefslogtreecommitdiff
path: root/test/Parser/pragma-weak.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/pragma-weak.c')
-rw-r--r--test/Parser/pragma-weak.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Parser/pragma-weak.c b/test/Parser/pragma-weak.c
new file mode 100644
index 0000000000000..355a95487b97f
--- /dev/null
+++ b/test/Parser/pragma-weak.c
@@ -0,0 +1,17 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// Note that this puts the expected lines before the directives to work around
+// limitations in the -verify mode.
+
+int x;
+/* expected-warning {{expected identifier in '#pragma weak'}}*/ #pragma weak
+#pragma weak x
+
+extern int z;
+/* expected-warning {{expected identifier in '#pragma weak'}}*/ #pragma weak z = =
+/* expected-warning {{expected identifier in '#pragma weak'}}*/ #pragma weak z =
+#pragma weak z = y
+
+extern int a;
+/* expected-warning {{extra tokens at end of '#pragma weak'}}*/ #pragma weak a b
+/* expected-warning {{extra tokens at end of '#pragma weak'}}*/ #pragma weak a = x c