diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-09 22:45:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-09 22:45:38 +0000 |
commit | c7d6576d542d5d65ea978c11c66dd7769d5753a0 (patch) | |
tree | 628501461f7d99535906ad798ae657e4ccd47365 /clang/test/Lexer/pragma-operators.cpp | |
parent | e5444a88cdc2cab2d4d2ce33597d2cf5a575e2d0 (diff) | |
download | bcm5719-llvm-c7d6576d542d5d65ea978c11c66dd7769d5753a0.tar.gz bcm5719-llvm-c7d6576d542d5d65ea978c11c66dd7769d5753a0.zip |
When we parse a pragma, keep track of how that pragma was originally
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.
llvm-svn: 113553
Diffstat (limited to 'clang/test/Lexer/pragma-operators.cpp')
-rw-r--r-- | clang/test/Lexer/pragma-operators.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Lexer/pragma-operators.cpp b/clang/test/Lexer/pragma-operators.cpp new file mode 100644 index 00000000000..af346e8c968 --- /dev/null +++ b/clang/test/Lexer/pragma-operators.cpp @@ -0,0 +1,15 @@ +// 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: extern +// CHECK: #line +// CHECK: #pragma warning(push) +// CHECK: #line +// CHECK: ; void f0(); +// CHECK: #line +// CHECK: #pragma warning(pop) +// CHECK: #line +// CHECK: ; } +extern "C" { _Pragma("warning(push)"); void f0(); __pragma(warning(pop)); } |