1 // RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fexperimental-new-constant-interpreter | FileCheck %s
4 #ifdef __SIZEOF_INT128__
5 // CHECK: @PR11705 = global i128 0
6 __int128_t PR11705
= (__int128_t
)&PR11705
;
10 // CHECK: @pastEnd = constant ptr getelementptr (i8, ptr @arr, i64 8)
11 int &pastEnd
= arr
[2];
13 // CHECK: @F = constant ptr @arr, align 8
21 // CHECK: @s = global %struct.S zeroinitializer, align 4
23 // CHECK: @sp = constant ptr getelementptr (i8, ptr @s, i64 16), align 8
27 namespace BaseClassOffsets
{
30 struct C
: A
, B
{ int c
; };
33 // CHECK: @_ZN16BaseClassOffsets1aE = global ptr @_ZN16BaseClassOffsets1cE, align 8
35 // CHECK: @_ZN16BaseClassOffsets1bE = global ptr getelementptr (i8, ptr @_ZN16BaseClassOffsets1cE, i64 4), align 8
44 extern const int &&t
= ((B
&&)C
{}).n
;
45 // CHECK: @_ZGRN8ExprBase1tE_ = internal global {{.*}} zeroinitializer,
46 // CHECK: @_ZN8ExprBase1tE = constant ptr {{.*}} @_ZGRN8ExprBase1tE_, {{.*}} 8
49 namespace reinterpretcast
{
50 const unsigned int n
= 1234;
51 extern const int &s
= reinterpret_cast<const int&>(n
);
52 // CHECK: @_ZN15reinterpretcastL1nE = internal constant i32 1234, align 4
53 // CHECK: @_ZN15reinterpretcast1sE = constant ptr @_ZN15reinterpretcastL1nE, align 8
55 void *f1(unsigned long l
) {
56 return reinterpret_cast<void *>(l
);
58 // CHECK: define {{.*}} ptr @_ZN15reinterpretcast2f1Em
63 struct S
{ int a
: 5; ~S(); };
65 // CHECK: call {{.*}}memset
66 // CHECK: store i32 {{.*}}, ptr @_ZGRN8Bitfield1rE_
67 // CHECK: call void @_ZN8Bitfield1SD1
68 // CHECK: store ptr @_ZGRN8Bitfield1rE_, ptr @_ZN8Bitfield1rE, align 8
73 decltype(nullptr) null();
74 // CHECK: call {{.*}} @_ZN4Null4nullEv(
77 // CHECK: call {{.*}} @_ZN4Null4nullEv(
92 // CHECK: call noundef ptr @_Z1gv()
94 // CHECK: call void @_ZN1AC1Ev(
95 // CHECK: call void @_ZN1AD1Ev(