xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/utf8-allowed-chars.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -std=c99 -verify
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -std=c11 -Wc99-compat -verify
3*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -x c++ -std=c++03 -Wc++11-compat -verify
4*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -x c++ -std=c++11 -Wc++98-compat -verify
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // Note: This file contains Unicode characters; please do not remove them!
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc // Identifier characters
9*f4a2713aSLionel Sambuc extern char aǶ; // C11, C++11
10*f4a2713aSLionel Sambuc extern char aª; // C99, C11, C++11
11*f4a2713aSLionel Sambuc extern char a΄; // C++03, C11, C++11
12*f4a2713aSLionel Sambuc extern char a๐; // C99, C++03, C11, C++11
13*f4a2713aSLionel Sambuc extern char a﹅; // none
14*f4a2713aSLionel Sambuc extern char x̀; // C11, C++11. Note that this does not have a composed form.
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // Identifier initial characters
20*f4a2713aSLionel Sambuc extern char ๐; // C++03, C11, C++11
21*f4a2713aSLionel Sambuc extern char ̀; // disallowed initially in C11/C++11, always in C99/C++03
22*f4a2713aSLionel Sambuc 
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc 
26*f4a2713aSLionel Sambuc 
27*f4a2713aSLionel Sambuc 
28*f4a2713aSLionel Sambuc 
29*f4a2713aSLionel Sambuc 
30*f4a2713aSLionel Sambuc #if __cplusplus
31*f4a2713aSLionel Sambuc # if __cplusplus >= 201103L
32*f4a2713aSLionel Sambuc // C++11
33*f4a2713aSLionel Sambuc // expected-warning@9 {{using this character in an identifier is incompatible with C++98}}
34*f4a2713aSLionel Sambuc // expected-warning@10 {{using this character in an identifier is incompatible with C++98}}
35*f4a2713aSLionel Sambuc // expected-error@13 {{non-ASCII characters are not allowed outside of literals and identifiers}}
36*f4a2713aSLionel Sambuc // expected-warning@14 {{using this character in an identifier is incompatible with C++98}}
37*f4a2713aSLionel Sambuc // expected-error@21 {{expected unqualified-id}}
38*f4a2713aSLionel Sambuc 
39*f4a2713aSLionel Sambuc # else
40*f4a2713aSLionel Sambuc // C++03
41*f4a2713aSLionel Sambuc // expected-error@9 {{non-ASCII characters are not allowed outside of literals and identifiers}}
42*f4a2713aSLionel Sambuc // expected-error@10 {{non-ASCII characters are not allowed outside of literals and identifiers}}
43*f4a2713aSLionel Sambuc // expected-error@13 {{non-ASCII characters are not allowed outside of literals and identifiers}}
44*f4a2713aSLionel Sambuc // expected-error@14 {{non-ASCII characters are not allowed outside of literals and identifiers}}
45*f4a2713aSLionel Sambuc // expected-error@21 {{non-ASCII characters are not allowed outside of literals and identifiers}} expected-warning@21 {{declaration does not declare anything}}
46*f4a2713aSLionel Sambuc 
47*f4a2713aSLionel Sambuc # endif
48*f4a2713aSLionel Sambuc #else
49*f4a2713aSLionel Sambuc # if __STDC_VERSION__ >= 201112L
50*f4a2713aSLionel Sambuc // C11
51*f4a2713aSLionel Sambuc // expected-warning@9 {{using this character in an identifier is incompatible with C99}}
52*f4a2713aSLionel Sambuc // expected-warning@11 {{using this character in an identifier is incompatible with C99}}
53*f4a2713aSLionel Sambuc // expected-error@13 {{non-ASCII characters are not allowed outside of literals and identifiers}}
54*f4a2713aSLionel Sambuc // expected-warning@14 {{using this character in an identifier is incompatible with C99}}
55*f4a2713aSLionel Sambuc // expected-warning@20 {{starting an identifier with this character is incompatible with C99}}
56*f4a2713aSLionel Sambuc // expected-error@21 {{expected identifier}}
57*f4a2713aSLionel Sambuc 
58*f4a2713aSLionel Sambuc # else
59*f4a2713aSLionel Sambuc // C99
60*f4a2713aSLionel Sambuc // expected-error@9 {{non-ASCII characters are not allowed outside of literals and identifiers}}
61*f4a2713aSLionel Sambuc // expected-error@11 {{non-ASCII characters are not allowed outside of literals and identifiers}}
62*f4a2713aSLionel Sambuc // expected-error@13 {{non-ASCII characters are not allowed outside of literals and identifiers}}
63*f4a2713aSLionel Sambuc // expected-error@14 {{non-ASCII characters are not allowed outside of literals and identifiers}}
64*f4a2713aSLionel Sambuc // expected-error@20 {{expected identifier}}
65*f4a2713aSLionel Sambuc // expected-error@21 {{non-ASCII characters are not allowed outside of literals and identifiers}} expected-warning@21 {{declaration does not declare anything}}
66*f4a2713aSLionel Sambuc 
67*f4a2713aSLionel Sambuc # endif
68*f4a2713aSLionel Sambuc #endif
69