[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Lexer / char8_t.cpp
blobd65597c68d8bc4c8221d417b7dc2784ce9725a8a
1 // RUN: %clang_cc1 -std=c++20 -verify %s -DCHAR8_T
2 // RUN: %clang_cc1 -std=c++20 -verify %s -fchar8_t -DCHAR8_T
3 // RUN: %clang_cc1 -std=c++17 -verify %s -fchar8_t -DCHAR8_T
5 // RUN: %clang_cc1 -std=c++17 -verify %s
6 // RUN: %clang_cc1 -std=c++17 -verify %s -fno-char8_t
7 // RUN: %clang_cc1 -std=c++20 -verify %s -fno-char8_t
9 #if defined(__cpp_char8_t) != defined(CHAR8_T)
10 #error wrong setting for __cpp_char_t
11 #endif
13 #if defined(__cpp_char8_t) && __is_identifier(char8_t)
14 #error char8_t is an identifier under -fchar8_t
15 #endif
17 #if !defined(__cpp_char8_t) && !__is_identifier(char8_t)
18 #error char8_t is a keyword under -fno-char8_t
19 #endif
21 char8_t c8t;
22 #ifndef __cpp_char8_t
23 // expected-error@-2 {{unknown type}}
24 #else
25 // expected-no-diagnostics
26 #endif