xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/string-literal-errors.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
2f4a2713aSLionel Sambuc 
foo()3f4a2713aSLionel Sambuc void foo() {
4f4a2713aSLionel Sambuc   (void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U"
5f4a2713aSLionel Sambuc   // CHECK: {{^  \(void\)"\\q \\u123z \\x \\U \\U123 \\U12345 \\u123 \\xyzzy \\777 \\U"$}}
6f4a2713aSLionel Sambuc   //
7f4a2713aSLionel Sambuc   //              (void)"\q \u123z \x \U \U123 \U12345 \u123 \xyzzy \777 \U"
8f4a2713aSLionel Sambuc   // CHECK: {{^         \^~$}}
9f4a2713aSLionel Sambuc   // CHECK: {{^            \^~~~~$}}
10f4a2713aSLionel Sambuc   // CHECK: {{^                   \^~$}}
11f4a2713aSLionel Sambuc   // CHECK: {{^                      \^~$}}
12f4a2713aSLionel Sambuc   // CHECK: {{^                         \^~~~~$}}
13f4a2713aSLionel Sambuc   // CHECK: {{^                               \^~~~~~~$}}
14f4a2713aSLionel Sambuc   // CHECK: {{^                                       \^~~~~$}}
15f4a2713aSLionel Sambuc   // CHECK: {{^                                             \^~$}}
16f4a2713aSLionel Sambuc   // CHECK: {{^                                                    \^~~~$}}
17f4a2713aSLionel Sambuc   // CHECK: {{^                                                         \^~$}}
18f4a2713aSLionel Sambuc 
19f4a2713aSLionel Sambuc   "123 \x \z";
20f4a2713aSLionel Sambuc   // CHECK: {{^  "123 \\x \\z";$}}
21f4a2713aSLionel Sambuc   //
22f4a2713aSLionel Sambuc   //              "123 \x \z";
23f4a2713aSLionel Sambuc   // CHECK: {{^       \^~$}}
24f4a2713aSLionel Sambuc   // CHECK: {{^          \^~$}}
25f4a2713aSLionel Sambuc }
26*0a6a1f1dSLionel Sambuc 
27*0a6a1f1dSLionel Sambuc #define foo() lots and lots of tokens, need at least 8 to fill up the smallvector buffer #BadThingsHappenNow
28