xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/unicode-strings.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -x c -std=c11 -Werror %s
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -x c++ -std=c++11 -Werror %s
3*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -x c -std=c11 -Wc99-compat -verify %s
4*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -x c++ -std=c++11 -Wc++98-compat -verify %s
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc #ifndef __cplusplus
7*f4a2713aSLionel Sambuc typedef __CHAR16_TYPE__ char16_t;
8*f4a2713aSLionel Sambuc typedef __CHAR32_TYPE__ char32_t;
9*f4a2713aSLionel Sambuc #else
10*f4a2713aSLionel Sambuc // expected-warning@17 {{'char16_t' type specifier is incompatible with C++98}}
11*f4a2713aSLionel Sambuc // expected-warning@18 {{'char32_t' type specifier is incompatible with C++98}}
12*f4a2713aSLionel Sambuc // expected-warning@20 {{'char16_t' type specifier is incompatible with C++98}}
13*f4a2713aSLionel Sambuc // expected-warning@21 {{'char32_t' type specifier is incompatible with C++98}}
14*f4a2713aSLionel Sambuc #endif
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc const char *a = u8"abcd"; // expected-warning {{unicode literals are incompatible with}}
17*f4a2713aSLionel Sambuc const char16_t *b = u"abcd"; // expected-warning {{unicode literals are incompatible with}}
18*f4a2713aSLionel Sambuc const char32_t *c = U"abcd"; // expected-warning {{unicode literals are incompatible with}}
19*f4a2713aSLionel Sambuc 
20*f4a2713aSLionel Sambuc char16_t d = u'a'; // expected-warning {{unicode literals are incompatible with}}
21*f4a2713aSLionel Sambuc char32_t e = U'a'; // expected-warning {{unicode literals are incompatible with}}
22