diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-09 23:30:15 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-09 23:30:15 +0000 |
commit | 0b91cc47a5642de2e1f567fe0f29420acdcdebbe (patch) | |
tree | da9ba236bf1ef7158a594a6883a73464fc83ac3a /test/Lexer | |
parent | 7cb583d13f996ffde671ea617c97303cebadd649 (diff) |
Handle _Pragma on a u8, u, or U string literal per the C11 specification. Also
handle raw string literals here. C++11 doesn't yet specify how they will
behave, but discussion on core suggests that we should just strip off
everything but the r-char-sequence.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r-- | test/Lexer/pragma-operators.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/Lexer/pragma-operators.cpp b/test/Lexer/pragma-operators.cpp index a76e0b2f97..6a5a498a15 100644 --- a/test/Lexer/pragma-operators.cpp +++ b/test/Lexer/pragma-operators.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fms-extensions -E %s | FileCheck %s +// RUN: %clang_cc1 -fms-extensions -std=c++11 -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> @@ -17,3 +17,21 @@ #pragma warning(push) B(foo) #pragma warning(pop) + +#define pragma_L _Pragma(L"GCC diagnostic push") +#define pragma_u8 _Pragma(u8"system_header") +#define pragma_u _Pragma(u"GCC diagnostic pop") +#define pragma_U _Pragma(U"comment(lib, \"libfoo\")") +#define pragma_R _Pragma(R"(clang diagnostic ignored "-Wunused")") +#define pragma_UR _Pragma(UR"(clang diagnostic error "-Wunused")") +#define pragma_hello _Pragma(u8R"x(message R"y("Hello", world!)y")x") +// CHECK: int n = +// CHECK: #pragma GCC diagnostic push +// CHECK: #pragma system_header +// CHECK: #pragma GCC diagnostic pop +// CHECK: #pragma comment(lib, "libfoo") +// CHECK: #pragma clang diagnostic ignored "-Wunused" +// CHECK: #pragma clang diagnostic error "-Wunused" +// 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; |