[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Lexer / unicode.c
blobf67b55415f960b7d80492fcd1f802d7af9fd4096
1 // RUN: %clang_cc1 -fsyntax-only -verify -x c -std=c11 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -x c++ -std=c++11 %s
3 // RUN: %clang_cc1 -std=c99 -E -DPP_ONLY=1 %s | FileCheck %s --strict-whitespace
4 // RUN: %clang_cc1 -E -DPP_ONLY=1 %s | FileCheck %s --strict-whitespace
6 // This file contains Unicode characters; please do not "fix" them!
8 extern int x; // expected-warning {{treating Unicode character as whitespace}}
9 extern int x; // expected-warning {{treating Unicode character as whitespace}}
11 // CHECK: extern int {{x}}
12 // CHECK: extern int {{x}}
14 #pragma mark ¡Unicode!
16 #define COPYRIGHT Copyright © 2012
17 #define XSTR(X) #X
18 #define STR(X) XSTR(X)
20 static const char *copyright = STR(COPYRIGHT); // no-warning
21 // CHECK: static const char *copyright = "Copyright © {{2012}}";
23 #if PP_ONLY
24 COPYRIGHT
25 // CHECK: Copyright © {{2012}}
26 CHECK : The preprocessor should not complain about Unicode characters like ©.
27 #endif
29 int _;
31 #ifdef __cplusplus
33 extern int;
34 extern int 𑩐;
35 extern int 𐠈;
36 extern int;
37 extern int \u1B4C; // BALINESE LETTER ARCHAIC JNYA - Added in Unicode 14
38 extern int \U00016AA2; // TANGSA LETTER GA - Added in Unicode 14
39 // This character doesn't have the XID_Start property
40 extern int \U00016AC0; // TANGSA DIGIT ZERO // expected-error {{expected unqualified-id}}
41 extern int _\U00016AC0; // TANGSA DIGIT ZERO
43 extern int 🌹; // expected-error {{unexpected character <U+1F339>}} \
44 expected-warning {{declaration does not declare anything}}
46 extern int 👷; // expected-error {{unexpected character <U+1F477>}} \
47 expected-warning {{declaration does not declare anything}}
49 extern int 👷‍♀; // expected-warning {{declaration does not declare anything}} \
50 expected-error {{unexpected character <U+1F477>}} \
51 expected-error {{unexpected character <U+200D>}} \
52 expected-error {{unexpected character <U+2640>}}
53 #else
55 // A 🌹 by any other name....
56 extern int 🌹;
57 int 🌵(int 🌻) { return 🌻+ 1; }
58 int main (void) {
59 int 🌷 = 🌵(🌹);
60 return 🌷;
63 int= 3; // expected-warning {{treating Unicode character <U+037E> as identifier character rather than as ';' symbol}}
64 int *n꞉꞉v = &; // expected-warning 2{{treating Unicode character <U+A789> as identifier character rather than as ':' symbol}}
65 // expected-warning@-1 {{treating Unicode character <U+037E> as identifier character rather than as ';' symbol}}
66 int v=[=](auto){return~x;}(); // expected-warning 12{{treating Unicode character}}
68 int ⁠xx‍;
69 // expected-warning@-1 {{identifier contains Unicode character <U+2060> that is invisible in some environments}}
70 // expected-warning@-2 {{identifier contains Unicode character <U+FEFF> that is invisible in some environments}}
71 // expected-warning@-3 {{identifier contains Unicode character <U+200D> that is invisible in some environments}}
72 int foo​bar = 0; // expected-warning {{identifier contains Unicode character <U+200B> that is invisible in some environments}}
73 int x = foobar; // expected-error {{undeclared identifier}}
75 int ∣foo; // expected-error {{unexpected character <U+2223>}}
76 #ifndef PP_ONLY
77 #define ∶ x // expected-error {{macro name must be an identifier}}
78 #endif
80 #endif