aboutsummaryrefslogtreecommitdiff
path: root/test/Lexer/pragma-operators.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Lexer/pragma-operators.cpp')
-rw-r--r--test/Lexer/pragma-operators.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Lexer/pragma-operators.cpp b/test/Lexer/pragma-operators.cpp
new file mode 100644
index 000000000000..d1645adbc252
--- /dev/null
+++ b/test/Lexer/pragma-operators.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -fms-extensions -E %s | FileCheck %s
+
+// Test that we properly expand the C99 _Pragma and Microsoft __pragma
+// into #pragma directives, with newlines where needed. <rdar://problem/8412013>
+
+// CHECK: #line
+// CHECK: #pragma warning(push)
+// CHECK: extern "C" {
+// CHECK: #line
+// CHECK: #pragma warning(push)
+// CHECK: int foo() { return 0; } }
+// CHECK: #line
+// CHECK: #pragma warning(pop)
+#define A(X) extern "C" { __pragma(warning(push)) \
+ int X() { return 0; } \
+}
+#define B(X) A(X)
+#pragma warning(push)
+B(foo)
+#pragma warning(pop)