[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / ByteCode / c23.c
blobf9157e40610cc3b3f648cd71badd1460ad9d1847
1 // RUN: %clang_cc1 -std=c23 -fexperimental-new-constant-interpreter -verify=expected,both %s
2 // RUN: %clang_cc1 -std=c23 -verify=ref,both %s
4 typedef typeof(nullptr) nullptr_t;
6 const _Bool inf1 = (1.0/0.0 == __builtin_inf());
7 constexpr _Bool inf2 = (1.0/0.0 == __builtin_inf()); // both-error {{must be initialized by a constant expression}} \
8 // both-note {{division by zero}}
9 constexpr _Bool inf3 = __builtin_inf() == __builtin_inf();
11 /// Used to crash.
12 struct S {
13 int x;
14 char c;
15 float f;
18 #define DECL_BUFFER(Ty, Name) alignas(Ty) unsigned char Name[sizeof(Ty)]
20 char bar() {
21 DECL_BUFFER(struct S, buffer);
22 ((struct S *)buffer)->c = 'a';
23 return ((struct S *)buffer)->c;
27 static_assert((nullptr_t){} == 0);