diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-10 22:27:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-10 22:27:29 +0000 |
commit | ca3682d4861ac597ea9b03c8b5e0d19bac4df82e (patch) | |
tree | 1bdfcac918c5b953846970147f8cf75c0b0530d4 /clang/test/Lexer/pragma-operators.cpp | |
parent | 2f5f696b667667bbffc180cbcb0a1eea97ce22e7 (diff) | |
download | bcm5719-llvm-ca3682d4861ac597ea9b03c8b5e0d19bac4df82e.tar.gz bcm5719-llvm-ca3682d4861ac597ea9b03c8b5e0d19bac4df82e.zip |
Make sure we're producing a newline in the preprocessed output before
emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>.
llvm-svn: 113648
Diffstat (limited to 'clang/test/Lexer/pragma-operators.cpp')
-rw-r--r-- | clang/test/Lexer/pragma-operators.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/clang/test/Lexer/pragma-operators.cpp b/clang/test/Lexer/pragma-operators.cpp index af346e8c968..d1645adbc25 100644 --- a/clang/test/Lexer/pragma-operators.cpp +++ b/clang/test/Lexer/pragma-operators.cpp @@ -3,13 +3,18 @@ // Test that we properly expand the C99 _Pragma and Microsoft __pragma // into #pragma directives, with newlines where needed. <rdar://problem/8412013> -// CHECK: extern // CHECK: #line // CHECK: #pragma warning(push) +// CHECK: extern "C" { // CHECK: #line -// CHECK: ; void f0(); +// CHECK: #pragma warning(push) +// CHECK: int foo() { return 0; } } // CHECK: #line // CHECK: #pragma warning(pop) -// CHECK: #line -// CHECK: ; } -extern "C" { _Pragma("warning(push)"); void f0(); __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) |