aboutsummaryrefslogtreecommitdiff
path: root/test/Lexer
diff options
context:
space:
mode:
authorAndy Gibbs <andyg1001@hotmail.co.uk>2013-04-18 16:49:37 +0000
committerAndy Gibbs <andyg1001@hotmail.co.uk>2013-04-18 16:49:37 +0000
commit688f2a1fc1ac38e8b7b602ab8afc69cdfa7492bf (patch)
tree5e7d574569c8a96649e6cb67e6319dd1654f734e /test/Lexer
parent4d6bc1884447a7e5b3c2def09bd307c96e44241e (diff)
downloadclang-688f2a1fc1ac38e8b7b602ab8afc69cdfa7492bf.tar.gz
Dropped the parentheses for #pragma message and its kin in the -E output generator.
This was a suggestion by Jordan Rose since the documented format for these pragmas is without the parentheses. At the same time, I've increased test coverage too for the preprocessed output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r--test/Lexer/pragma-message2.c19
-rw-r--r--test/Lexer/pragma-operators.cpp2
2 files changed, 20 insertions, 1 deletions
diff --git a/test/Lexer/pragma-message2.c b/test/Lexer/pragma-message2.c
new file mode 100644
index 0000000000..4b4078243b
--- /dev/null
+++ b/test/Lexer/pragma-message2.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -E -Werror -verify %s 2>&1 | FileCheck %s
+
+#pragma message "\\test" // expected-warning {{\test}}
+// CHECK: #pragma message "\134test"
+
+#pragma message("\\test") // expected-warning {{\test}}
+// CHECK: #pragma message "\134test"
+
+#pragma GCC warning "\"" "te" "st" "\"" // expected-warning {{"test"}}
+// CHECK: #pragma GCC warning "\042test\042"
+
+#pragma GCC warning("\"" "te" "st" "\"") // expected-warning {{"test"}}
+// CHECK: #pragma GCC warning "\042test\042"
+
+#pragma GCC error "" "[ ]" "" // expected-error {{[ ]}}
+// CHECK: #pragma GCC error "[\011]"
+
+#pragma GCC error("" "[ ]" "") // expected-error {{[ ]}}
+// CHECK: #pragma GCC error "[\011]"
diff --git a/test/Lexer/pragma-operators.cpp b/test/Lexer/pragma-operators.cpp
index 6a5a498a15..7402f9f8c4 100644
--- a/test/Lexer/pragma-operators.cpp
+++ b/test/Lexer/pragma-operators.cpp
@@ -32,6 +32,6 @@ B(foo)
// CHECK: #pragma comment(lib, "libfoo")
// CHECK: #pragma clang diagnostic ignored "-Wunused"
// CHECK: #pragma clang diagnostic error "-Wunused"
-// CHECK: #pragma message("\042Hello\042, world!")
+// CHECK: #pragma message "\042Hello\042, world!"
// CHECK: 0;
int n = pragma_L pragma_u8 pragma_u pragma_U pragma_R pragma_UR pragma_hello 0;