1 | // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,CHECK-O0 |
2 | // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,PATTERN,PATTERN-O0 |
3 | // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O1,PATTERN,PATTERN-O1 |
4 | // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O0,ZERO,ZERO-O0 |
5 | // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK-O1,ZERO,ZERO-O1 |
6 | |
7 | template<typename T> void used(T &) noexcept; |
8 | |
9 | #define TEST_UNINIT(NAME, TYPE) \ |
10 | using type_##NAME = TYPE; \ |
11 | void test_##NAME##_uninit() { \ |
12 | type_##NAME uninit; \ |
13 | used(uninit); \ |
14 | } |
15 | |
16 | // Value initialization on scalars, aggregate initialization on aggregates. |
17 | #define TEST_BRACES(NAME, TYPE) \ |
18 | using type_##NAME = TYPE; \ |
19 | void test_##NAME##_braces() { \ |
20 | type_##NAME braces = {}; \ |
21 | used(braces); \ |
22 | } |
23 | |
24 | #define TEST_CUSTOM(NAME, TYPE, ...) \ |
25 | using type_##NAME = TYPE; \ |
26 | void test_##NAME##_custom() { \ |
27 | type_##NAME custom __VA_ARGS__; \ |
28 | used(custom); \ |
29 | } |
30 | |
31 | // None of the synthesized globals should contain `undef`. |
32 | // PATTERN-NOT: undef |
33 | // ZERO-NOT: undef |
34 | |
35 | // PATTERN-O0: @__const.test_empty_uninit.uninit = private unnamed_addr constant %struct.empty { i8 -86 }, align 1 |
36 | // PATTERN-O1-NOT: @__const.test_empty_uninit.uninit |
37 | struct empty {}; |
38 | // PATTERN-O0: @__const.test_small_uninit.uninit = private unnamed_addr constant %struct.small { i8 -86 }, align 1 |
39 | // PATTERN-O0: @__const.test_small_custom.custom = private unnamed_addr constant %struct.small { i8 42 }, align 1 |
40 | // ZERO-O0: @__const.test_small_custom.custom = private unnamed_addr constant %struct.small { i8 42 }, align 1 |
41 | // PATTERN-O1-NOT: @__const.test_small_uninit.uninit |
42 | // PATTERN-O1-NOT: @__const.test_small_custom.custom |
43 | // ZERO-O1-NOT: @__const.test_small_custom.custom |
44 | struct small { char c; }; |
45 | // PATTERN-O0: @__const.test_smallinit_uninit.uninit = private unnamed_addr constant %struct.smallinit { i8 -86 }, align 1 |
46 | // PATTERN-O0: @__const.test_smallinit_braces.braces = private unnamed_addr constant %struct.smallinit { i8 -86 }, align 1 |
47 | // PATTERN-O0: @__const.test_smallinit_custom.custom = private unnamed_addr constant %struct.smallinit { i8 -86 }, align 1 |
48 | // PATTERN-O1-NOT: @__const.test_smallinit_uninit.uninit |
49 | // PATTERN-O1-NOT: @__const.test_smallinit_braces.braces |
50 | // PATTERN-O1-NOT: @__const.test_smallinit_custom.custom |
51 | struct smallinit { char c = 42; }; |
52 | // PATTERN-O0: @__const.test_smallpartinit_uninit.uninit = private unnamed_addr constant %struct.smallpartinit { i8 -86, i8 -86 }, align 1 |
53 | // PATTERN-O0: @__const.test_smallpartinit_braces.braces = private unnamed_addr constant %struct.smallpartinit { i8 -86, i8 -86 }, align 1 |
54 | // PATTERN-O0: @__const.test_smallpartinit_custom.custom = private unnamed_addr constant %struct.smallpartinit { i8 -86, i8 -86 }, align 1 |
55 | // PATTERN-O1-NOT: @__const.test_smallpartinit_uninit.uninit |
56 | // PATTERN-O1-NOT: @__const.test_smallpartinit_braces.braces |
57 | // PATTERN-O1-NOT: @__const.test_smallpartinit_custom.custom |
58 | struct smallpartinit { char c = 42, d; }; |
59 | // PATTERN-O0: @__const.test_nullinit_uninit.uninit = private unnamed_addr constant %struct.nullinit { i8* inttoptr (i64 -6148914691236517206 to i8*) }, align 8 |
60 | // PATTERN-O0: @__const.test_nullinit_braces.braces = private unnamed_addr constant %struct.nullinit { i8* inttoptr (i64 -6148914691236517206 to i8*) }, align 8 |
61 | // PATTERN-O0: @__const.test_nullinit_custom.custom = private unnamed_addr constant %struct.nullinit { i8* inttoptr (i64 -6148914691236517206 to i8*) }, align 8 |
62 | // PATTERN-O1-NOT: @__const.test_nullinit_uninit.uninit |
63 | // PATTERN-O1-NOT: @__const.test_nullinit_braces.braces |
64 | // PATTERN-O1-NOT: @__const.test_nullinit_custom.custom |
65 | struct nullinit { char* null = nullptr; }; |
66 | // PATTERN-O0: @__const.test_padded_uninit.uninit = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, align 4 |
67 | // PATTERN-O0: @__const.test_padded_custom.custom = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 42, [3 x i8] c"\AA\AA\AA", i32 13371337 }, align 4 |
68 | // ZERO-O0: @__const.test_padded_custom.custom = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 42, [3 x i8] zeroinitializer, i32 13371337 }, align 4 |
69 | // PATTERN-O1-NOT: @__const.test_padded_uninit.uninit |
70 | // PATTERN-O1-NOT: @__const.test_padded_custom.custom |
71 | // ZERO-O1-NOT: @__const.test_padded_custom.custom |
72 | struct padded { char c; int i; }; |
73 | // PATTERN-O0: @__const.test_paddednullinit_uninit.uninit = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, align 4 |
74 | // PATTERN-O0: @__const.test_paddednullinit_braces.braces = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, align 4 |
75 | // PATTERN-O0: @__const.test_paddednullinit_custom.custom = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, align 4 |
76 | // PATTERN-O1-NOT: @__const.test_paddednullinit_uninit.uninit |
77 | // PATTERN-O1-NOT: @__const.test_paddednullinit_braces.braces |
78 | // PATTERN-O1-NOT: @__const.test_paddednullinit_custom.custom |
79 | struct paddednullinit { char c = 0; int i = 0; }; |
80 | // PATTERN-O0: @__const.test_paddedpacked_uninit.uninit = private unnamed_addr constant %struct.paddedpacked <{ i8 -86, i32 -1431655766 }>, align 1 |
81 | // PATTERN: @__const.test_paddedpacked_custom.custom = private unnamed_addr constant %struct.paddedpacked <{ i8 42, i32 13371337 }>, align 1 |
82 | // ZERO: @__const.test_paddedpacked_custom.custom = private unnamed_addr constant %struct.paddedpacked <{ i8 42, i32 13371337 }>, align 1 |
83 | struct paddedpacked { char c; int i; } __attribute__((packed)); |
84 | // PATTERN-O0: @__const.test_paddedpackedarray_uninit.uninit = private unnamed_addr constant %struct.paddedpackedarray { [2 x %struct.paddedpacked] [%struct.paddedpacked <{ i8 -86, i32 -1431655766 }>, %struct.paddedpacked <{ i8 -86, i32 -1431655766 }>] }, align 1 |
85 | // PATTERN: @__const.test_paddedpackedarray_custom.custom = private unnamed_addr constant %struct.paddedpackedarray { [2 x %struct.paddedpacked] [%struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }>] }, align 1 |
86 | // ZERO: @__const.test_paddedpackedarray_custom.custom = private unnamed_addr constant %struct.paddedpackedarray { [2 x %struct.paddedpacked] [%struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }>] }, align 1 |
87 | struct paddedpackedarray { struct paddedpacked p[2]; }; |
88 | // PATTERN-O0: @__const.test_unpackedinpacked_uninit.uninit = private unnamed_addr constant <{ { i8, [3 x i8], i32 }, i8 }> <{ { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, i8 -86 }>, align 1 |
89 | struct unpackedinpacked { padded a; char b; } __attribute__((packed)); |
90 | // PATTERN-O0: @__const.test_paddednested_uninit.uninit = private unnamed_addr constant { { i8, [3 x i8], i32 }, { i8, [3 x i8], i32 } } { { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 } }, align 4 |
91 | // PATTERN: @__const.test_paddednested_custom.custom = private unnamed_addr constant { { i8, [3 x i8], i32 }, { i8, [3 x i8], i32 } } { { i8, [3 x i8], i32 } { i8 42, [3 x i8] c"\AA\AA\AA", i32 13371337 }, { i8, [3 x i8], i32 } { i8 43, [3 x i8] c"\AA\AA\AA", i32 13371338 } }, align 4 |
92 | // ZERO: @__const.test_paddednested_custom.custom = private unnamed_addr constant { { i8, [3 x i8], i32 }, { i8, [3 x i8], i32 } } { { i8, [3 x i8], i32 } { i8 42, [3 x i8] zeroinitializer, i32 13371337 }, { i8, [3 x i8], i32 } { i8 43, [3 x i8] zeroinitializer, i32 13371338 } }, align 4 |
93 | struct paddednested { struct padded p1, p2; }; |
94 | // PATTERN-O0: @__const.test_paddedpackednested_uninit.uninit = private unnamed_addr constant %struct.paddedpackednested { %struct.paddedpacked <{ i8 -86, i32 -1431655766 }>, %struct.paddedpacked <{ i8 -86, i32 -1431655766 }> }, align 1 |
95 | // PATTERN: @__const.test_paddedpackednested_custom.custom = private unnamed_addr constant %struct.paddedpackednested { %struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }> }, align 1 |
96 | // ZERO: @__const.test_paddedpackednested_custom.custom = private unnamed_addr constant %struct.paddedpackednested { %struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }> }, align 1 |
97 | struct paddedpackednested { struct paddedpacked p1, p2; }; |
98 | // PATTERN-O0: @__const.test_bitfield_uninit.uninit = private unnamed_addr constant %struct.bitfield { i8 -86, [3 x i8] c"\AA\AA\AA" }, align 4 |
99 | // PATTERN-O0: @__const.test_bitfield_custom.custom = private unnamed_addr constant %struct.bitfield { i8 20, [3 x i8] c"\AA\AA\AA" }, align 4 |
100 | // ZERO-O0: @__const.test_bitfield_custom.custom = private unnamed_addr constant %struct.bitfield { i8 20, [3 x i8] zeroinitializer }, align 4 |
101 | // PATTERN-O1-NOT: @__const.test_bitfield_uninit.uninit |
102 | // PATTERN-O1-NOT: @__const.test_bitfield_custom.custom |
103 | // ZERO-O1-NOT: @__const.test_bitfield_custom.custom |
104 | struct bitfield { int i : 4; int j : 2; }; |
105 | // PATTERN-O0: @__const.test_bitfieldaligned_uninit.uninit = private unnamed_addr constant %struct.bitfieldaligned { i8 -86, [3 x i8] c"\AA\AA\AA", i8 -86, [3 x i8] c"\AA\AA\AA" }, align 4 |
106 | // PATTERN-O0: @__const.test_bitfieldaligned_custom.custom = private unnamed_addr constant %struct.bitfieldaligned { i8 4, [3 x i8] c"\AA\AA\AA", i8 1, [3 x i8] c"\AA\AA\AA" }, align 4 |
107 | // ZERO-O0: @__const.test_bitfieldaligned_custom.custom = private unnamed_addr constant %struct.bitfieldaligned { i8 4, [3 x i8] zeroinitializer, i8 1, [3 x i8] zeroinitializer }, align 4 |
108 | // PATTERN-O1-NOT: @__const.test_bitfieldaligned_uninit.uninit |
109 | // PATTERN-O1-NOT: @__const.test_bitfieldaligned_custom.custom |
110 | // ZERO-O1-NOT: @__const.test_bitfieldaligned_custom.custom |
111 | struct bitfieldaligned { int i : 4; int : 0; int j : 2; }; |
112 | struct big { unsigned a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z; }; |
113 | // PATTERN-O0: @__const.test_arraytail_uninit.uninit = private unnamed_addr constant %struct.arraytail { i32 -1431655766, [0 x i32] zeroinitializer }, align 4 |
114 | // PATTERN-O0: @__const.test_arraytail_custom.custom = private unnamed_addr constant %struct.arraytail { i32 57005, [0 x i32] zeroinitializer }, align 4 |
115 | // ZERO-O0: @__const.test_arraytail_custom.custom = private unnamed_addr constant %struct.arraytail { i32 57005, [0 x i32] zeroinitializer }, align 4 |
116 | // PATTERN-O1-NOT: @__const.test_arraytail_uninit.uninit |
117 | // PATTERN-O1-NOT: @__const.test_arraytail_custom.custom |
118 | // ZERO-O1-NOT: @__const.test_arraytail_custom.custom |
119 | struct arraytail { int i; int arr[]; }; |
120 | // PATTERN-O0: @__const.test_int1_uninit.uninit = private unnamed_addr constant [1 x i32] [i32 -1431655766], align 4 |
121 | // PATTERN-O0: @__const.test_int1_custom.custom = private unnamed_addr constant [1 x i32] [i32 858993459], align 4 |
122 | // ZERO-O0: @__const.test_int1_custom.custom = private unnamed_addr constant [1 x i32] [i32 858993459], align 4 |
123 | // PATTERN-O1-NOT: @__const.test_int1_uninit.uninit |
124 | // PATTERN-O1-NOT: @__const.test_int1_custom.custom |
125 | // ZERO-O1-NOT: @__const.test_int1_custom.custom |
126 | |
127 | // PATTERN-O0: @__const.test_bool4_uninit.uninit = private unnamed_addr constant [4 x i8] c"\AA\AA\AA\AA", align 1 |
128 | // PATTERN-O0: @__const.test_bool4_custom.custom = private unnamed_addr constant [4 x i8] c"\01\01\01\01", align 1 |
129 | // ZERO-O0: @__const.test_bool4_custom.custom = private unnamed_addr constant [4 x i8] c"\01\01\01\01", align 1 |
130 | // PATTERN-O1-NOT: @__const.test_bool4_uninit.uninit |
131 | // PATTERN-O1-NOT: @__const.test_bool4_custom.custom |
132 | // ZERO-O1-NOT: @__const.test_bool4_custom.custom |
133 | |
134 | // PATTERN: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x i32*] [i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*)], align 16 |
135 | // ZERO: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x i32*] [i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*), i32* inttoptr (i64 572662306 to i32*)], align 16 |
136 | // PATTERN-O0: @__const.test_tailpad4_uninit.uninit = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 -21846, i8 -86, [1 x i8] c"\AA" }, { i16, i8, [1 x i8] } { i16 -21846, i8 -86, [1 x i8] c"\AA" }, { i16, i8, [1 x i8] } { i16 -21846, i8 -86, [1 x i8] c"\AA" }, { i16, i8, [1 x i8] } { i16 -21846, i8 -86, [1 x i8] c"\AA" }], align 16 |
137 | // PATTERN-O1-NOT: @__const.test_tailpad4_uninit.uninit |
138 | // PATTERN: @__const.test_tailpad4_custom.custom = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] c"\AA" }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] c"\AA" }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] c"\AA" }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] c"\AA" }], align 16 |
139 | // ZERO: @__const.test_tailpad4_custom.custom = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }], align 16 |
140 | struct tailpad { short s; char c; }; |
141 | // PATTERN-O0: @__const.test_atomicnotlockfree_uninit.uninit = private unnamed_addr constant %struct.notlockfree { [4 x i64] [i64 -6148914691236517206, i64 -6148914691236517206, i64 -6148914691236517206, i64 -6148914691236517206] }, align 8 |
142 | // PATTERN-O1-NOT: @__const.test_atomicnotlockfree_uninit.uninit |
143 | struct notlockfree { long long a[4]; }; |
144 | // PATTERN-O0: @__const.test_atomicpadded_uninit.uninit = private unnamed_addr constant { i8, [3 x i8], i32 } { i8 -86, [3 x i8] c"\AA\AA\AA", i32 -1431655766 }, align 8 |
145 | // PATTERN-O1-NOT: @__const.test_atomicpadded_uninit.uninit |
146 | // PATTERN-O0: @__const.test_atomictailpad_uninit.uninit = private unnamed_addr constant { i16, i8, [1 x i8] } { i16 -21846, i8 -86, [1 x i8] c"\AA" }, align 4 |
147 | // PATTERN-O1-NOT: @__const.test_atomictailpad_uninit.uninit |
148 | // PATTERN-O0: @__const.test_complexfloat_uninit.uninit = private unnamed_addr constant { float, float } { float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000 }, align 4 |
149 | // PATTERN-O1-NOT: @__const.test_complexfloat_uninit.uninit |
150 | // PATTERN-O0: @__const.test_complexfloat_braces.braces = private unnamed_addr constant { float, float } { float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000 }, align 4 |
151 | // PATTERN-O1-NOT: @__const.test_complexfloat_braces.braces |
152 | // PATTERN-O0: @__const.test_complexfloat_custom.custom = private unnamed_addr constant { float, float } { float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000 }, align 4 |
153 | // PATTERN-O1-NOT: @__const.test_complexfloat_custom.custom |
154 | // PATTERN-O0: @__const.test_complexdouble_uninit.uninit = private unnamed_addr constant { double, double } { double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF }, align 8 |
155 | // PATTERN-O1-NOT: @__const.test_complexdouble_uninit.uninit |
156 | // PATTERN-O0: @__const.test_complexdouble_braces.braces = private unnamed_addr constant { double, double } { double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF }, align 8 |
157 | // PATTERN-O1-NOT: @__const.test_complexdouble_braces.braces |
158 | // PATTERN-O0: @__const.test_complexdouble_custom.custom = private unnamed_addr constant { double, double } { double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF }, align 8 |
159 | // PATTERN-O1-NOT: @__const.test_complexdouble_custom.custom |
160 | // PATTERN-O0: @__const.test_semivolatile_uninit.uninit = private unnamed_addr constant %struct.semivolatile { i32 -1431655766, i32 -1431655766 }, align 4 |
161 | // PATTERN-O0: @__const.test_semivolatile_custom.custom = private unnamed_addr constant %struct.semivolatile { i32 1145324612, i32 1145324612 }, align 4 |
162 | // PATTERN-O1-NOT: @__const.test_semivolatile_custom.custom |
163 | struct semivolatile { int i; volatile int vi; }; |
164 | // PATTERN-O0: @__const.test_semivolatileinit_uninit.uninit = private unnamed_addr constant %struct.semivolatileinit { i32 -1431655766, i32 -1431655766 }, align 4 |
165 | // PATTERN-O1-NOT: @__const.test_semivolatileinit_uninit.uninit |
166 | // PATTERN-O0: @__const.test_semivolatileinit_braces.braces = private unnamed_addr constant %struct.semivolatileinit { i32 -1431655766, i32 -1431655766 }, align 4 |
167 | // PATTERN-O1-NOT: @__const.test_semivolatileinit_braces.braces |
168 | // PATTERN-O0: @__const.test_semivolatileinit_custom.custom = private unnamed_addr constant %struct.semivolatileinit { i32 -1431655766, i32 -1431655766 }, align 4 |
169 | // PATTERN-O1-NOT: @__const.test_semivolatileinit_custom.custom = private unnamed_addr constant %struct.semivolatileinit { i32 -1431655766, i32 -1431655766 }, align 4 |
170 | // ZERO-O0: @__const.test_semivolatile_custom.custom = private unnamed_addr constant %struct.semivolatile { i32 1145324612, i32 1145324612 }, align 4 |
171 | // ZERO-O1-NOT: @__const.test_semivolatile_custom.custom |
172 | struct semivolatileinit { int i = 0x11111111; volatile int vi = 0x11111111; }; |
173 | // PATTERN-O0: @__const.test_base_uninit.uninit = private unnamed_addr constant %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) }, align 8 |
174 | // PATTERN-O1-NOT: @__const.test_base_uninit.uninit |
175 | // PATTERN-O0: @__const.test_base_braces.braces = private unnamed_addr constant %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) }, align 8 |
176 | // PATTERN-O1-NOT: @__const.test_base_braces.braces |
177 | struct base { virtual ~base(); }; |
178 | // PATTERN-O0: @__const.test_derived_uninit.uninit = private unnamed_addr constant %struct.derived { %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) } }, align 8 |
179 | // PATTERN-O1-NOT: @__const.test_derived_uninit.uninit |
180 | // PATTERN-O0: @__const.test_derived_braces.braces = private unnamed_addr constant %struct.derived { %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) } }, align 8 |
181 | // PATTERN-O1-NOT: @__const.test_derived_braces.braces |
182 | struct derived : public base {}; |
183 | // PATTERN-O0: @__const.test_virtualderived_uninit.uninit = private unnamed_addr constant %struct.virtualderived { %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) }, %struct.derived { %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) } } }, align 8 |
184 | // PATTERN-O1-NOT: @__const.test_virtualderived_uninit.uninit |
185 | // PATTERN-O0: @__const.test_virtualderived_braces.braces = private unnamed_addr constant %struct.virtualderived { %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) }, %struct.derived { %struct.base { i32 (...)** inttoptr (i64 -6148914691236517206 to i32 (...)**) } } }, align 8 |
186 | // PATTERN-O1-NOT: @__const.test_virtualderived_braces.braces |
187 | struct virtualderived : public virtual base, public virtual derived {}; |
188 | // PATTERN-O0: @__const.test_matching_uninit.uninit = private unnamed_addr constant %union.matching { i32 -1431655766 }, align 4 |
189 | // PATTERN-O1-NOT: @__const.test_matching_uninit.uninit |
190 | // PATTERN-O0: @__const.test_matching_custom.custom = private unnamed_addr constant { float } { float 6.145500e+04 }, align 4 |
191 | // PATTERN-O1-NOT: @__const.test_matching_custom.custom |
192 | // ZERO-O0: @__const.test_matching_custom.custom = private unnamed_addr constant { float } { float 6.145500e+04 }, align 4 |
193 | // ZERO-O1-NOT: @__const.test_matching_custom.custom |
194 | union matching { int i; float f; }; |
195 | // PATTERN-O0: @__const.test_matchingreverse_uninit.uninit = private unnamed_addr constant %union.matchingreverse { float 0xFFFFFFFFE0000000 }, align 4 |
196 | // PATTERN-O1-NOT: @__const.test_matchingreverse_uninit.uninit |
197 | // PATTERN-O0: @__const.test_matchingreverse_custom.custom = private unnamed_addr constant { i32 } { i32 61455 }, align 4 |
198 | // PATTERN-O1-NOT: @__const.test_matchingreverse_custom.custom |
199 | // ZERO-O0: @__const.test_matchingreverse_custom.custom = private unnamed_addr constant { i32 } { i32 61455 }, align 4 |
200 | // ZERO-O1-NOT: @__const.test_matchingreverse_custom.custom |
201 | union matchingreverse { float f; int i; }; |
202 | // PATTERN-O0: @__const.test_unmatched_uninit.uninit = private unnamed_addr constant %union.unmatched { i32 -1431655766 }, align 4 |
203 | // PATTERN-O1-NOT: @__const.test_unmatched_uninit.uninit |
204 | // PATTERN-O0: @__const.test_unmatched_custom.custom = private unnamed_addr constant %union.unmatched { i32 1001242351 }, align 4 |
205 | // PATTERN-O1-NOT: @__const.test_unmatched_custom.custom |
206 | // ZERO-O0: @__const.test_unmatched_custom.custom = private unnamed_addr constant %union.unmatched { i32 1001242351 }, align 4 |
207 | // ZERO-O1-NOT: @__const.test_unmatched_custom.custom |
208 | union unmatched { char c; int i; }; |
209 | // PATTERN-O0: @__const.test_unmatchedreverse_uninit.uninit = private unnamed_addr constant %union.unmatchedreverse { i32 -1431655766 }, align 4 |
210 | // PATTERN-O1-NOT: @__const.test_unmatchedreverse_uninit.uninit |
211 | // PATTERN-O0: @__const.test_unmatchedreverse_custom.custom = private unnamed_addr constant { i8, [3 x i8] } { i8 42, [3 x i8] c"\AA\AA\AA" }, align 4 |
212 | // PATTERN-O1-NOT: @__const.test_unmatchedreverse_custom.custom |
213 | // ZERO-O0: @__const.test_unmatchedreverse_custom.custom = private unnamed_addr constant { i8, [3 x i8] } { i8 42, [3 x i8] zeroinitializer }, align 4 |
214 | // ZERO-O1-NOT: @__const.test_unmatchedreverse_custom.custom |
215 | union unmatchedreverse { int i; char c; }; |
216 | // PATTERN-O0: @__const.test_unmatchedfp_uninit.uninit = private unnamed_addr constant %union.unmatchedfp { double 0xFFFFFFFFFFFFFFFF }, align 8 |
217 | // PATTERN-O1-NOT: @__const.test_unmatchedfp_uninit.uninit |
218 | // PATTERN-O0: @__const.test_unmatchedfp_custom.custom = private unnamed_addr constant %union.unmatchedfp { double 0x400921FB54442D18 }, align 8 |
219 | // PATTERN-O1-NOT: @__const.test_unmatchedfp_custom.custom |
220 | // ZERO-O0: @__const.test_unmatchedfp_custom.custom = private unnamed_addr constant %union.unmatchedfp { double 0x400921FB54442D18 }, align 8 |
221 | // ZERO-O1-NOT: @__const.test_unmatchedfp_custom.custom |
222 | union unmatchedfp { float f; double d; }; |
223 | enum emptyenum {}; |
224 | enum smallenum { VALUE }; |
225 | |
226 | extern "C" { |
227 | |
228 | TEST_UNINIT(char, char); |
229 | // CHECK-LABEL: @test_char_uninit() |
230 | // CHECK: %uninit = alloca i8, align |
231 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
232 | // PATTERN-LABEL: @test_char_uninit() |
233 | // PATTERN: store i8 -86, i8* %uninit, align 1 |
234 | // ZERO-LABEL: @test_char_uninit() |
235 | // ZERO: store i8 0, i8* %uninit, align 1 |
236 | |
237 | TEST_BRACES(char, char); |
238 | // CHECK-LABEL: @test_char_braces() |
239 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
240 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
241 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
242 | |
243 | TEST_UNINIT(uchar, unsigned char); |
244 | // CHECK-LABEL: @test_uchar_uninit() |
245 | // CHECK: %uninit = alloca i8, align |
246 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
247 | // PATTERN-LABEL: @test_uchar_uninit() |
248 | // PATTERN: store i8 -86, i8* %uninit, align 1 |
249 | // ZERO-LABEL: @test_uchar_uninit() |
250 | // ZERO: store i8 0, i8* %uninit, align 1 |
251 | |
252 | TEST_BRACES(uchar, unsigned char); |
253 | // CHECK-LABEL: @test_uchar_braces() |
254 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
255 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
256 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
257 | |
258 | TEST_UNINIT(schar, signed char); |
259 | // CHECK-LABEL: @test_schar_uninit() |
260 | // CHECK: %uninit = alloca i8, align |
261 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
262 | // PATTERN-LABEL: @test_schar_uninit() |
263 | // PATTERN: store i8 -86, i8* %uninit, align 1 |
264 | // ZERO-LABEL: @test_schar_uninit() |
265 | // ZERO: store i8 0, i8* %uninit, align 1 |
266 | |
267 | TEST_BRACES(schar, signed char); |
268 | // CHECK-LABEL: @test_schar_braces() |
269 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
270 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
271 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
272 | |
273 | TEST_UNINIT(wchar_t, wchar_t); |
274 | // CHECK-LABEL: @test_wchar_t_uninit() |
275 | // CHECK: %uninit = alloca i32, align |
276 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
277 | // PATTERN-LABEL: @test_wchar_t_uninit() |
278 | // PATTERN: store i32 -1431655766, i32* %uninit, align |
279 | // ZERO-LABEL: @test_wchar_t_uninit() |
280 | // ZERO: store i32 0, i32* %uninit, align |
281 | |
282 | TEST_BRACES(wchar_t, wchar_t); |
283 | // CHECK-LABEL: @test_wchar_t_braces() |
284 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
285 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
286 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
287 | |
288 | TEST_UNINIT(short, short); |
289 | // CHECK-LABEL: @test_short_uninit() |
290 | // CHECK: %uninit = alloca i16, align |
291 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
292 | // PATTERN-LABEL: @test_short_uninit() |
293 | // PATTERN: store i16 -21846, i16* %uninit, align |
294 | // ZERO-LABEL: @test_short_uninit() |
295 | // ZERO: store i16 0, i16* %uninit, align |
296 | |
297 | TEST_BRACES(short, short); |
298 | // CHECK-LABEL: @test_short_braces() |
299 | // CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]] |
300 | // CHECK-NEXT: store i16 0, i16* %braces, align [[ALIGN]] |
301 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
302 | |
303 | TEST_UNINIT(ushort, unsigned short); |
304 | // CHECK-LABEL: @test_ushort_uninit() |
305 | // CHECK: %uninit = alloca i16, align |
306 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
307 | // PATTERN-LABEL: @test_ushort_uninit() |
308 | // PATTERN: store i16 -21846, i16* %uninit, align |
309 | // ZERO-LABEL: @test_ushort_uninit() |
310 | // ZERO: store i16 0, i16* %uninit, align |
311 | |
312 | TEST_BRACES(ushort, unsigned short); |
313 | // CHECK-LABEL: @test_ushort_braces() |
314 | // CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]] |
315 | // CHECK-NEXT: store i16 0, i16* %braces, align [[ALIGN]] |
316 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
317 | |
318 | TEST_UNINIT(int, int); |
319 | // CHECK-LABEL: @test_int_uninit() |
320 | // CHECK: %uninit = alloca i32, align |
321 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
322 | // PATTERN-LABEL: @test_int_uninit() |
323 | // PATTERN: store i32 -1431655766, i32* %uninit, align |
324 | // ZERO-LABEL: @test_int_uninit() |
325 | // ZERO: store i32 0, i32* %uninit, align |
326 | |
327 | TEST_BRACES(int, int); |
328 | // CHECK-LABEL: @test_int_braces() |
329 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
330 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
331 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
332 | |
333 | TEST_UNINIT(unsigned, unsigned); |
334 | // CHECK-LABEL: @test_unsigned_uninit() |
335 | // CHECK: %uninit = alloca i32, align |
336 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
337 | // PATTERN-LABEL: @test_unsigned_uninit() |
338 | // PATTERN: store i32 -1431655766, i32* %uninit, align |
339 | // ZERO-LABEL: @test_unsigned_uninit() |
340 | // ZERO: store i32 0, i32* %uninit, align |
341 | |
342 | TEST_BRACES(unsigned, unsigned); |
343 | // CHECK-LABEL: @test_unsigned_braces() |
344 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
345 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
346 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
347 | |
348 | TEST_UNINIT(long, long); |
349 | // CHECK-LABEL: @test_long_uninit() |
350 | // CHECK: %uninit = alloca i64, align |
351 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
352 | // PATTERN-LABEL: @test_long_uninit() |
353 | // PATTERN: store i64 -6148914691236517206, i64* %uninit, align |
354 | // ZERO-LABEL: @test_long_uninit() |
355 | // ZERO: store i64 0, i64* %uninit, align |
356 | |
357 | TEST_BRACES(long, long); |
358 | // CHECK-LABEL: @test_long_braces() |
359 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
360 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
361 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
362 | |
363 | TEST_UNINIT(ulong, unsigned long); |
364 | // CHECK-LABEL: @test_ulong_uninit() |
365 | // CHECK: %uninit = alloca i64, align |
366 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
367 | // PATTERN-LABEL: @test_ulong_uninit() |
368 | // PATTERN: store i64 -6148914691236517206, i64* %uninit, align |
369 | // ZERO-LABEL: @test_ulong_uninit() |
370 | // ZERO: store i64 0, i64* %uninit, align |
371 | |
372 | TEST_BRACES(ulong, unsigned long); |
373 | // CHECK-LABEL: @test_ulong_braces() |
374 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
375 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
376 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
377 | |
378 | TEST_UNINIT(longlong, long long); |
379 | // CHECK-LABEL: @test_longlong_uninit() |
380 | // CHECK: %uninit = alloca i64, align |
381 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
382 | // PATTERN-LABEL: @test_longlong_uninit() |
383 | // PATTERN: store i64 -6148914691236517206, i64* %uninit, align |
384 | // ZERO-LABEL: @test_longlong_uninit() |
385 | // ZERO: store i64 0, i64* %uninit, align |
386 | |
387 | TEST_BRACES(longlong, long long); |
388 | // CHECK-LABEL: @test_longlong_braces() |
389 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
390 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
391 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
392 | |
393 | TEST_UNINIT(ulonglong, unsigned long long); |
394 | // CHECK-LABEL: @test_ulonglong_uninit() |
395 | // CHECK: %uninit = alloca i64, align |
396 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
397 | // PATTERN-LABEL: @test_ulonglong_uninit() |
398 | // PATTERN: store i64 -6148914691236517206, i64* %uninit, align |
399 | // ZERO-LABEL: @test_ulonglong_uninit() |
400 | // ZERO: store i64 0, i64* %uninit, align |
401 | |
402 | TEST_BRACES(ulonglong, unsigned long long); |
403 | // CHECK-LABEL: @test_ulonglong_braces() |
404 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
405 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
406 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
407 | |
408 | TEST_UNINIT(int128, __int128); |
409 | // CHECK-LABEL: @test_int128_uninit() |
410 | // CHECK: %uninit = alloca i128, align |
411 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
412 | // PATTERN-LABEL: @test_int128_uninit() |
413 | // PATTERN: store i128 -113427455640312821154458202477256070486, i128* %uninit, align |
414 | // ZERO-LABEL: @test_int128_uninit() |
415 | // ZERO: store i128 0, i128* %uninit, align |
416 | |
417 | TEST_BRACES(int128, __int128); |
418 | // CHECK-LABEL: @test_int128_braces() |
419 | // CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]] |
420 | // CHECK-NEXT: store i128 0, i128* %braces, align [[ALIGN]] |
421 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
422 | |
423 | TEST_UNINIT(uint128, unsigned __int128); |
424 | // CHECK-LABEL: @test_uint128_uninit() |
425 | // CHECK: %uninit = alloca i128, align |
426 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
427 | // PATTERN-LABEL: @test_uint128_uninit() |
428 | // PATTERN: store i128 -113427455640312821154458202477256070486, i128* %uninit, align |
429 | // ZERO-LABEL: @test_uint128_uninit() |
430 | // ZERO: store i128 0, i128* %uninit, align |
431 | |
432 | TEST_BRACES(uint128, unsigned __int128); |
433 | // CHECK-LABEL: @test_uint128_braces() |
434 | // CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]] |
435 | // CHECK-NEXT: store i128 0, i128* %braces, align [[ALIGN]] |
436 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
437 | |
438 | |
439 | TEST_UNINIT(fp16, __fp16); |
440 | // CHECK-LABEL: @test_fp16_uninit() |
441 | // CHECK: %uninit = alloca half, align |
442 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
443 | // PATTERN-LABEL: @test_fp16_uninit() |
444 | // PATTERN: store half 0xHFFFF, half* %uninit, align |
445 | // ZERO-LABEL: @test_fp16_uninit() |
446 | // ZERO: store half 0xH0000, half* %uninit, align |
447 | |
448 | TEST_BRACES(fp16, __fp16); |
449 | // CHECK-LABEL: @test_fp16_braces() |
450 | // CHECK: %braces = alloca half, align [[ALIGN:[0-9]*]] |
451 | // CHECK-NEXT: store half 0xH0000, half* %braces, align [[ALIGN]] |
452 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
453 | |
454 | TEST_UNINIT(float, float); |
455 | // CHECK-LABEL: @test_float_uninit() |
456 | // CHECK: %uninit = alloca float, align |
457 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
458 | // PATTERN-LABEL: @test_float_uninit() |
459 | // PATTERN: store float 0xFFFFFFFFE0000000, float* %uninit, align |
460 | // ZERO-LABEL: @test_float_uninit() |
461 | // ZERO: store float 0.000000e+00, float* %uninit, align |
462 | |
463 | TEST_BRACES(float, float); |
464 | // CHECK-LABEL: @test_float_braces() |
465 | // CHECK: %braces = alloca float, align [[ALIGN:[0-9]*]] |
466 | // CHECK-NEXT: store float 0.000000e+00, float* %braces, align [[ALIGN]] |
467 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
468 | |
469 | TEST_UNINIT(double, double); |
470 | // CHECK-LABEL: @test_double_uninit() |
471 | // CHECK: %uninit = alloca double, align |
472 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
473 | // PATTERN-LABEL: @test_double_uninit() |
474 | // PATTERN: store double 0xFFFFFFFFFFFFFFFF, double* %uninit, align |
475 | // ZERO-LABEL: @test_double_uninit() |
476 | // ZERO: store double 0.000000e+00, double* %uninit, align |
477 | |
478 | TEST_BRACES(double, double); |
479 | // CHECK-LABEL: @test_double_braces() |
480 | // CHECK: %braces = alloca double, align [[ALIGN:[0-9]*]] |
481 | // CHECK-NEXT: store double 0.000000e+00, double* %braces, align [[ALIGN]] |
482 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
483 | |
484 | TEST_UNINIT(longdouble, long double); |
485 | // CHECK-LABEL: @test_longdouble_uninit() |
486 | // CHECK: %uninit = alloca x86_fp80, align |
487 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
488 | // PATTERN-LABEL: @test_longdouble_uninit() |
489 | // PATTERN: store x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, x86_fp80* %uninit, align |
490 | // ZERO-LABEL: @test_longdouble_uninit() |
491 | // ZERO: store x86_fp80 0xK00000000000000000000, x86_fp80* %uninit, align |
492 | |
493 | TEST_BRACES(longdouble, long double); |
494 | // CHECK-LABEL: @test_longdouble_braces() |
495 | // CHECK: %braces = alloca x86_fp80, align [[ALIGN:[0-9]*]] |
496 | // CHECK-NEXT: store x86_fp80 0xK00000000000000000000, x86_fp80* %braces, align [[ALIGN]] |
497 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
498 | |
499 | |
500 | TEST_UNINIT(intptr, int*); |
501 | // CHECK-LABEL: @test_intptr_uninit() |
502 | // CHECK: %uninit = alloca i32*, align |
503 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
504 | // PATTERN-LABEL: @test_intptr_uninit() |
505 | // PATTERN: store i32* inttoptr (i64 -6148914691236517206 to i32*), i32** %uninit, align |
506 | // ZERO-LABEL: @test_intptr_uninit() |
507 | // ZERO: store i32* null, i32** %uninit, align |
508 | |
509 | TEST_BRACES(intptr, int*); |
510 | // CHECK-LABEL: @test_intptr_braces() |
511 | // CHECK: %braces = alloca i32*, align [[ALIGN:[0-9]*]] |
512 | // CHECK-NEXT: store i32* null, i32** %braces, align [[ALIGN]] |
513 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
514 | |
515 | TEST_UNINIT(intptrptr, int**); |
516 | // CHECK-LABEL: @test_intptrptr_uninit() |
517 | // CHECK: %uninit = alloca i32**, align |
518 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
519 | // PATTERN-LABEL: @test_intptrptr_uninit() |
520 | // PATTERN: store i32** inttoptr (i64 -6148914691236517206 to i32**), i32*** %uninit, align |
521 | // ZERO-LABEL: @test_intptrptr_uninit() |
522 | // ZERO: store i32** null, i32*** %uninit, align |
523 | |
524 | TEST_BRACES(intptrptr, int**); |
525 | // CHECK-LABEL: @test_intptrptr_braces() |
526 | // CHECK: %braces = alloca i32**, align [[ALIGN:[0-9]*]] |
527 | // CHECK-NEXT: store i32** null, i32*** %braces, align [[ALIGN]] |
528 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
529 | |
530 | TEST_UNINIT(function, void(*)()); |
531 | // CHECK-LABEL: @test_function_uninit() |
532 | // CHECK: %uninit = alloca void ()*, align |
533 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
534 | // PATTERN-LABEL: @test_function_uninit() |
535 | // PATTERN: store void ()* inttoptr (i64 -6148914691236517206 to void ()*), void ()** %uninit, align |
536 | // ZERO-LABEL: @test_function_uninit() |
537 | // ZERO: store void ()* null, void ()** %uninit, align |
538 | |
539 | TEST_BRACES(function, void(*)()); |
540 | // CHECK-LABEL: @test_function_braces() |
541 | // CHECK: %braces = alloca void ()*, align [[ALIGN:[0-9]*]] |
542 | // CHECK-NEXT: store void ()* null, void ()** %braces, align [[ALIGN]] |
543 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
544 | |
545 | TEST_UNINIT(bool, bool); |
546 | // CHECK-LABEL: @test_bool_uninit() |
547 | // CHECK: %uninit = alloca i8, align |
548 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
549 | // PATTERN-LABEL: @test_bool_uninit() |
550 | // PATTERN: store i8 -86, i8* %uninit, align 1 |
551 | // ZERO-LABEL: @test_bool_uninit() |
552 | // ZERO: store i8 0, i8* %uninit, align 1 |
553 | |
554 | TEST_BRACES(bool, bool); |
555 | // CHECK-LABEL: @test_bool_braces() |
556 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
557 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
558 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
559 | |
560 | |
561 | TEST_UNINIT(empty, empty); |
562 | // CHECK-LABEL: @test_empty_uninit() |
563 | // CHECK: %uninit = alloca %struct.empty, align |
564 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
565 | // PATTERN-LABEL: @test_empty_uninit() |
566 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_empty_uninit.uninit |
567 | // PATTERN-O1: store i8 -86, {{.*}} align 1 |
568 | // ZERO-LABEL: @test_empty_uninit() |
569 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
570 | // ZERO-O1: store i8 0, {{.*}} align 1 |
571 | |
572 | TEST_BRACES(empty, empty); |
573 | // CHECK-LABEL: @test_empty_braces() |
574 | // CHECK: %braces = alloca %struct.empty, align |
575 | // CHECK-NEXT: bitcast |
576 | // CHECK-NEXT: call void @llvm.memcpy |
577 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
578 | |
579 | TEST_UNINIT(small, small); |
580 | // CHECK-LABEL: @test_small_uninit() |
581 | // CHECK: %uninit = alloca %struct.small, align |
582 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
583 | // PATTERN-LABEL: @test_small_uninit() |
584 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_small_uninit.uninit |
585 | // PATTERN-O1: store i8 -86, {{.*}} align 1 |
586 | // ZERO-LABEL: @test_small_uninit() |
587 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
588 | // ZERO-O1: store i8 0, {{.*}} align 1 |
589 | |
590 | TEST_BRACES(small, small); |
591 | // CHECK-LABEL: @test_small_braces() |
592 | // CHECK: %braces = alloca %struct.small, align [[ALIGN:[0-9]*]] |
593 | // CHECK-NEXT: bitcast |
594 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 1, i1 false) |
595 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
596 | |
597 | TEST_CUSTOM(small, small, { 42 }); |
598 | // CHECK-LABEL: @test_small_custom() |
599 | // CHECK: %custom = alloca %struct.small, align |
600 | // CHECK-NEXT: bitcast |
601 | // CHECK-NEXT: call void @llvm.memcpy |
602 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
603 | |
604 | TEST_UNINIT(smallinit, smallinit); |
605 | // CHECK-LABEL: @test_smallinit_uninit() |
606 | // CHECK: %uninit = alloca %struct.smallinit, align |
607 | // CHECK-NEXT: call void @{{.*}}smallinit{{.*}}%uninit) |
608 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
609 | |
610 | TEST_BRACES(smallinit, smallinit); |
611 | // CHECK-LABEL: @test_smallinit_braces() |
612 | // CHECK: %braces = alloca %struct.smallinit, align [[ALIGN:[0-9]*]] |
613 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, %struct.smallinit* %braces, i32 0, i32 0 |
614 | // CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]] |
615 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
616 | |
617 | TEST_CUSTOM(smallinit, smallinit, { 100 }); |
618 | // CHECK-LABEL: @test_smallinit_custom() |
619 | // CHECK: %custom = alloca %struct.smallinit, align [[ALIGN:[0-9]*]] |
620 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, %struct.smallinit* %custom, i32 0, i32 0 |
621 | // CHECK-NEXT: store i8 100, i8* %[[C]], align [[ALIGN]] |
622 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
623 | |
624 | TEST_UNINIT(smallpartinit, smallpartinit); |
625 | // CHECK-LABEL: @test_smallpartinit_uninit() |
626 | // CHECK: %uninit = alloca %struct.smallpartinit, align |
627 | // CHECK-NEXT: call void @{{.*}}smallpartinit{{.*}}%uninit) |
628 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
629 | // PATTERN-LABEL: @test_smallpartinit_uninit() |
630 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_smallpartinit_uninit.uninit |
631 | // PATTERN-O1: store i8 -86, {{.*}} align 1 |
632 | // PATTERN-O1: store i8 42, {{.*}} align 1 |
633 | // ZERO-LABEL: @test_smallpartinit_uninit() |
634 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
635 | // ZERO-O1: store i16 0, i16* %uninit, align 2 |
636 | |
637 | TEST_BRACES(smallpartinit, smallpartinit); |
638 | // CHECK-LABEL: @test_smallpartinit_braces() |
639 | // CHECK: %braces = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]] |
640 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %braces, i32 0, i32 0 |
641 | // CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]] |
642 | // CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %braces, i32 0, i32 1 |
643 | // CHECK-NEXT: store i8 0, i8* %[[D]], align [[ALIGN]] |
644 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
645 | |
646 | TEST_CUSTOM(smallpartinit, smallpartinit, { 100, 42 }); |
647 | // CHECK-LABEL: @test_smallpartinit_custom() |
648 | // CHECK: %custom = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]] |
649 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %custom, i32 0, i32 0 |
650 | // CHECK-NEXT: store i8 100, i8* %[[C]], align [[ALIGN]] |
651 | // CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %custom, i32 0, i32 1 |
652 | // CHECK-NEXT: store i8 42, i8* %[[D]], align [[ALIGN]] |
653 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
654 | |
655 | TEST_UNINIT(nullinit, nullinit); |
656 | // CHECK-LABEL: @test_nullinit_uninit() |
657 | // CHECK: %uninit = alloca %struct.nullinit, align |
658 | // CHECK-NEXT: call void @{{.*}}nullinit{{.*}}%uninit) |
659 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
660 | |
661 | TEST_BRACES(nullinit, nullinit); |
662 | // CHECK-LABEL: @test_nullinit_braces() |
663 | // CHECK: %braces = alloca %struct.nullinit, align [[ALIGN:[0-9]*]] |
664 | // CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, %struct.nullinit* %braces, i32 0, i32 0 |
665 | // CHECK-NEXT: store i8* null, i8** %[[N]], align [[ALIGN]] |
666 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
667 | |
668 | TEST_CUSTOM(nullinit, nullinit, { (char*)"derp" }); |
669 | // CHECK-LABEL: @test_nullinit_custom() |
670 | // CHECK: %custom = alloca %struct.nullinit, align [[ALIGN:[0-9]*]] |
671 | // CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, %struct.nullinit* %custom, i32 0, i32 0 |
672 | // CHECK-NEXT: store i8* getelementptr inbounds {{.*}}, i8** %[[N]], align [[ALIGN]] |
673 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
674 | |
675 | TEST_UNINIT(padded, padded); |
676 | // CHECK-LABEL: @test_padded_uninit() |
677 | // CHECK: %uninit = alloca %struct.padded, align |
678 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
679 | // PATTERN-LABEL: @test_padded_uninit() |
680 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_padded_uninit.uninit |
681 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
682 | // ZERO-LABEL: @test_padded_uninit() |
683 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
684 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
685 | |
686 | TEST_BRACES(padded, padded); |
687 | // CHECK-LABEL: @test_padded_braces() |
688 | // CHECK: %braces = alloca %struct.padded, align [[ALIGN:[0-9]*]] |
689 | // CHECK-NEXT: bitcast |
690 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
691 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
692 | |
693 | TEST_CUSTOM(padded, padded, { 42, 13371337 }); |
694 | // CHECK-LABEL: @test_padded_custom() |
695 | // CHECK: %custom = alloca %struct.padded, align |
696 | // CHECK-NEXT: bitcast |
697 | // CHECK-NEXT: call void @llvm.memcpy |
698 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
699 | |
700 | TEST_UNINIT(paddednullinit, paddednullinit); |
701 | // CHECK-LABEL: @test_paddednullinit_uninit() |
702 | // CHECK: %uninit = alloca %struct.paddednullinit, align |
703 | // CHECK-NEXT: call void @{{.*}}paddednullinit{{.*}}%uninit) |
704 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
705 | // PATTERN-LABEL: @test_paddednullinit_uninit() |
706 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit |
707 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
708 | // ZERO-LABEL: @test_paddednullinit_uninit() |
709 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
710 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
711 | |
712 | TEST_BRACES(paddednullinit, paddednullinit); |
713 | // CHECK-LABEL: @test_paddednullinit_braces() |
714 | // CHECK: %braces = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]] |
715 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %braces, i32 0, i32 0 |
716 | // CHECK-NEXT: store i8 0, i8* %[[C]], align [[ALIGN]] |
717 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %braces, i32 0, i32 1 |
718 | // CHECK-NEXT: store i32 0, i32* %[[I]], align [[ALIGN]] |
719 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
720 | |
721 | TEST_CUSTOM(paddednullinit, paddednullinit, { 42, 13371337 }); |
722 | // CHECK-LABEL: @test_paddednullinit_custom() |
723 | // CHECK: %custom = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]] |
724 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %custom, i32 0, i32 0 |
725 | // CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]] |
726 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %custom, i32 0, i32 1 |
727 | // CHECK-NEXT: store i32 13371337, i32* %[[I]], align [[ALIGN]] |
728 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
729 | |
730 | TEST_UNINIT(paddedpacked, paddedpacked); |
731 | // CHECK-LABEL: @test_paddedpacked_uninit() |
732 | // CHECK: %uninit = alloca %struct.paddedpacked, align |
733 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
734 | // PATTERN-LABEL: @test_paddedpacked_uninit() |
735 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpacked_uninit.uninit |
736 | // PATTERN-O1: %[[C:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 0 |
737 | // PATTERN-O1 store i8 -86, i8* %[[C]], align |
738 | // PATTERN-O1: %[[I:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 1 |
739 | // PATTERN-O1: store i32 -1431655766, i32* %[[I]], align |
740 | |
741 | // ZERO-LABEL: @test_paddedpacked_uninit() |
742 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
743 | |
744 | TEST_BRACES(paddedpacked, paddedpacked); |
745 | // CHECK-LABEL: @test_paddedpacked_braces() |
746 | // CHECK: %braces = alloca %struct.paddedpacked, align [[ALIGN:[0-9]*]] |
747 | // CHECK-NEXT: bitcast |
748 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 5, i1 false) |
749 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
750 | |
751 | TEST_CUSTOM(paddedpacked, paddedpacked, { 42, 13371337 }); |
752 | // CHECK-LABEL: @test_paddedpacked_custom() |
753 | // CHECK: %custom = alloca %struct.paddedpacked, align |
754 | // CHECK-NEXT: bitcast |
755 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpacked_custom.custom |
756 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
757 | |
758 | TEST_UNINIT(paddedpackedarray, paddedpackedarray); |
759 | // CHECK-LABEL: @test_paddedpackedarray_uninit() |
760 | // CHECK: %uninit = alloca %struct.paddedpackedarray, align |
761 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
762 | // PATTERN-LABEL: @test_paddedpackedarray_uninit() |
763 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackedarray_uninit.uninit |
764 | // PATTERN-O1: getelementptr |
765 | // PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}i8 -86, i64 10 |
766 | // ZERO-LABEL: @test_paddedpackedarray_uninit() |
767 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
768 | |
769 | TEST_BRACES(paddedpackedarray, paddedpackedarray); |
770 | // CHECK-LABEL: @test_paddedpackedarray_braces() |
771 | // CHECK: %braces = alloca %struct.paddedpackedarray, align [[ALIGN:[0-9]*]] |
772 | // CHECK-NEXT: bitcast |
773 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false) |
774 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
775 | |
776 | TEST_CUSTOM(paddedpackedarray, paddedpackedarray, { {{ 42, 13371337 }, { 43, 13371338 }} }); |
777 | // CHECK-LABEL: @test_paddedpackedarray_custom() |
778 | // CHECK: %custom = alloca %struct.paddedpackedarray, align |
779 | // CHECK-NEXT: bitcast |
780 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackedarray_custom.custom |
781 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
782 | |
783 | TEST_UNINIT(unpackedinpacked, unpackedinpacked); |
784 | // CHECK-LABEL: @test_unpackedinpacked_uninit() |
785 | // PATTERN-O0: call void @llvm.memcpy{{.*}}, i64 9, i1 false) |
786 | |
787 | TEST_UNINIT(paddednested, paddednested); |
788 | // CHECK-LABEL: @test_paddednested_uninit() |
789 | // CHECK: %uninit = alloca %struct.paddednested, align |
790 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
791 | // PATTERN-LABEL: @test_paddednested_uninit() |
792 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednested_uninit.uninit |
793 | // PATTERN-O1: getelementptr |
794 | // PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 -86, i64 16 |
795 | // ZERO-LABEL: @test_paddednested_uninit() |
796 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
797 | |
798 | TEST_BRACES(paddednested, paddednested); |
799 | // CHECK-LABEL: @test_paddednested_braces() |
800 | // CHECK: %braces = alloca %struct.paddednested, align [[ALIGN:[0-9]*]] |
801 | // CHECK-NEXT: bitcast |
802 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false) |
803 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
804 | |
805 | TEST_CUSTOM(paddednested, paddednested, { { 42, 13371337 }, { 43, 13371338 } }); |
806 | // CHECK-LABEL: @test_paddednested_custom() |
807 | // CHECK: %custom = alloca %struct.paddednested, align |
808 | // CHECK-NEXT: bitcast |
809 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddednested_custom.custom |
810 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
811 | |
812 | TEST_UNINIT(paddedpackednested, paddedpackednested); |
813 | // CHECK-LABEL: @test_paddedpackednested_uninit() |
814 | // CHECK: %uninit = alloca %struct.paddedpackednested, align |
815 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
816 | // PATTERN-LABEL: @test_paddedpackednested_uninit() |
817 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackednested_uninit.uninit |
818 | // PATTERN-O1: getelementptr |
819 | // PATTERN-O1: call void @llvm.memset.p0i8.i64(i8* nonnull align 1 %0, i8 -86, i64 10, i1 false |
820 | // ZERO-LABEL: @test_paddedpackednested_uninit() |
821 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
822 | |
823 | TEST_BRACES(paddedpackednested, paddedpackednested); |
824 | // CHECK-LABEL: @test_paddedpackednested_braces() |
825 | // CHECK: %braces = alloca %struct.paddedpackednested, align [[ALIGN:[0-9]*]] |
826 | // CHECK-NEXT: bitcast |
827 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false) |
828 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
829 | |
830 | TEST_CUSTOM(paddedpackednested, paddedpackednested, { { 42, 13371337 }, { 43, 13371338 } }); |
831 | // CHECK-LABEL: @test_paddedpackednested_custom() |
832 | // CHECK: %custom = alloca %struct.paddedpackednested, align |
833 | // CHECK-NEXT: bitcast |
834 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackednested_custom.custom |
835 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
836 | |
837 | TEST_UNINIT(bitfield, bitfield); |
838 | // CHECK-LABEL: @test_bitfield_uninit() |
839 | // CHECK: %uninit = alloca %struct.bitfield, align |
840 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
841 | // PATTERN-LABEL: @test_bitfield_uninit() |
842 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfield_uninit.uninit |
843 | // PATTERN-O1: store i32 -1431655766, i32* %uninit, align 4 |
844 | // ZERO-LABEL: @test_bitfield_uninit() |
845 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
846 | // ZERO-O1: store i32 0, i32* %uninit, align 4 |
847 | |
848 | TEST_BRACES(bitfield, bitfield); |
849 | // CHECK-LABEL: @test_bitfield_braces() |
850 | // CHECK: %braces = alloca %struct.bitfield, align |
851 | // CHECK-NEXT: bitcast |
852 | // CHECK-NEXT: call void @llvm.memcpy |
853 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
854 | |
855 | TEST_CUSTOM(bitfield, bitfield, { 4, 1 }); |
856 | // CHECK-LABEL: @test_bitfield_custom() |
857 | // CHECK: %custom = alloca %struct.bitfield, align |
858 | // CHECK-NEXT: bitcast |
859 | // CHECK-NEXT: call void @llvm.memcpy |
860 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
861 | |
862 | TEST_UNINIT(bitfieldaligned, bitfieldaligned); |
863 | // CHECK-LABEL: @test_bitfieldaligned_uninit() |
864 | // CHECK: %uninit = alloca %struct.bitfieldaligned, align |
865 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
866 | // PATTERN-LABEL: @test_bitfieldaligned_uninit() |
867 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfieldaligned_uninit.uninit |
868 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
869 | // ZERO-LABEL: @test_bitfieldaligned_uninit() |
870 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
871 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
872 | |
873 | TEST_BRACES(bitfieldaligned, bitfieldaligned); |
874 | // CHECK-LABEL: @test_bitfieldaligned_braces() |
875 | // CHECK: %braces = alloca %struct.bitfieldaligned, align |
876 | // CHECK-NEXT: bitcast |
877 | // CHECK-NEXT: call void @llvm.memcpy |
878 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
879 | |
880 | TEST_CUSTOM(bitfieldaligned, bitfieldaligned, { 4, 1 }); |
881 | // CHECK-LABEL: @test_bitfieldaligned_custom() |
882 | // CHECK: %custom = alloca %struct.bitfieldaligned, align |
883 | // CHECK-NEXT: bitcast |
884 | // CHECK-NEXT: call void @llvm.memcpy |
885 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
886 | |
887 | TEST_UNINIT(big, big); |
888 | // CHECK-LABEL: @test_big_uninit() |
889 | // CHECK: %uninit = alloca %struct.big, align |
890 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
891 | // PATTERN-LABEL: @test_big_uninit() |
892 | // PATTERN: call void @llvm.memset{{.*}}, i8 -86, |
893 | // ZERO-LABEL: @test_big_uninit() |
894 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
895 | |
896 | TEST_BRACES(big, big); |
897 | // CHECK-LABEL: @test_big_braces() |
898 | // CHECK: %braces = alloca %struct.big, align [[ALIGN:[0-9]*]] |
899 | // CHECK-NEXT: bitcast |
900 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 104, i1 false) |
901 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
902 | |
903 | TEST_CUSTOM(big, big, { 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA }); |
904 | // CHECK-LABEL: @test_big_custom() |
905 | // CHECK: %custom = alloca %struct.big, align [[ALIGN:[0-9]*]] |
906 | // CHECK-NEXT: bitcast |
907 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 -86, i64 104, i1 false) |
908 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
909 | |
910 | TEST_UNINIT(arraytail, arraytail); |
911 | // CHECK-LABEL: @test_arraytail_uninit() |
912 | // CHECK: %uninit = alloca %struct.arraytail, align |
913 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
914 | // PATTERN-LABEL: @test_arraytail_uninit() |
915 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_arraytail_uninit.uninit |
916 | // PATTERN-O1: store i32 -1431655766, {{.*}} align 4 |
917 | // ZERO-LABEL: @test_arraytail_uninit() |
918 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
919 | // ZERO-O1: store i32 0, {{.*}} align 4 |
920 | |
921 | TEST_BRACES(arraytail, arraytail); |
922 | // CHECK-LABEL: @test_arraytail_braces() |
923 | // CHECK: %braces = alloca %struct.arraytail, align [[ALIGN:[0-9]*]] |
924 | // CHECK-NEXT: bitcast |
925 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
926 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
927 | |
928 | TEST_CUSTOM(arraytail, arraytail, { 0xdead }); |
929 | // CHECK-LABEL: @test_arraytail_custom() |
930 | // CHECK: %custom = alloca %struct.arraytail, align |
931 | // CHECK-NEXT: bitcast |
932 | // CHECK-NEXT: call void @llvm.memcpy |
933 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
934 | |
935 | |
936 | TEST_UNINIT(int0, int[0]); |
937 | // CHECK-LABEL: @test_int0_uninit() |
938 | // CHECK: %uninit = alloca [0 x i32], align |
939 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
940 | // PATTERN-LABEL: @test_int0_uninit() |
941 | // PATTERN: %uninit = alloca [0 x i32], align |
942 | // PATTERN-O0-NEXT: call void @{{.*}}used{{.*}}%uninit) |
943 | // ZERO-LABEL: @test_int0_uninit() |
944 | // ZERO: %uninit = alloca [0 x i32], align |
945 | // ZERO-O0-NEXT: call void @{{.*}}used{{.*}}%uninit) |
946 | |
947 | TEST_BRACES(int0, int[0]); |
948 | // CHECK-LABEL: @test_int0_braces() |
949 | // CHECK: %braces = alloca [0 x i32], align [[ALIGN:[0-9]*]] |
950 | // CHECK-NEXT: bitcast |
951 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
952 | |
953 | TEST_UNINIT(int1, int[1]); |
954 | // CHECK-LABEL: @test_int1_uninit() |
955 | // CHECK: %uninit = alloca [1 x i32], align [[ALIGN:[0-9]*]] |
956 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
957 | // PATTERN-LABEL: @test_int1_uninit() |
958 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_int1_uninit.uninit |
959 | // PATTERN-O1: store i32 -1431655766, {{.*}} align 4 |
960 | // ZERO-LABEL: @test_int1_uninit() |
961 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
962 | // ZERO-O1: store i32 0, {{.*}} align 4 |
963 | |
964 | TEST_BRACES(int1, int[1]); |
965 | // CHECK-LABEL: @test_int1_braces() |
966 | // CHECK: %braces = alloca [1 x i32], align [[ALIGN:[0-9]*]] |
967 | // CHECK-NEXT: bitcast |
968 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
969 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
970 | |
971 | TEST_CUSTOM(int1, int[1], { 0x33333333 }); |
972 | // CHECK-LABEL: @test_int1_custom() |
973 | // CHECK: %custom = alloca [1 x i32], align |
974 | // CHECK-NEXT: bitcast |
975 | // CHECK-NEXT: call void @llvm.memcpy |
976 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
977 | |
978 | TEST_UNINIT(int64, int[64]); |
979 | // CHECK-LABEL: @test_int64_uninit() |
980 | // CHECK: %uninit = alloca [64 x i32], align |
981 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
982 | // PATTERN-LABEL: @test_int64_uninit() |
983 | // PATTERN: call void @llvm.memset{{.*}}, i8 -86, |
984 | // ZERO-LABEL: @test_int64_uninit() |
985 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
986 | |
987 | TEST_BRACES(int64, int[64]); |
988 | // CHECK-LABEL: @test_int64_braces() |
989 | // CHECK: %braces = alloca [64 x i32], align [[ALIGN:[0-9]*]] |
990 | // CHECK-NEXT: bitcast |
991 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 256, i1 false) |
992 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
993 | |
994 | TEST_CUSTOM(int64, int[64], = { 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111 }); |
995 | // CHECK-LABEL: @test_int64_custom() |
996 | // CHECK: %custom = alloca [64 x i32], align [[ALIGN:[0-9]*]] |
997 | // CHECK-NEXT: bitcast |
998 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 17, i64 256, i1 false) |
999 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1000 | |
1001 | TEST_UNINIT(bool4, bool[4]); |
1002 | // CHECK-LABEL: @test_bool4_uninit() |
1003 | // CHECK: %uninit = alloca [4 x i8], align |
1004 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1005 | // PATTERN-LABEL: @test_bool4_uninit() |
1006 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bool4_uninit.uninit |
1007 | // PATTERN-O1: store i32 -1431655766, i32* %uninit, align 4 |
1008 | // ZERO-LABEL: @test_bool4_uninit() |
1009 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1010 | // ZERO-O1: store i32 0, i32* %uninit, align 4 |
1011 | |
1012 | TEST_BRACES(bool4, bool[4]); |
1013 | // CHECK-LABEL: @test_bool4_braces() |
1014 | // CHECK: %braces = alloca [4 x i8], align [[ALIGN:[0-9]*]] |
1015 | // CHECK-NEXT: bitcast |
1016 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
1017 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1018 | |
1019 | TEST_CUSTOM(bool4, bool[4], { true, true, true, true }); |
1020 | // CHECK-LABEL: @test_bool4_custom() |
1021 | // CHECK: %custom = alloca [4 x i8], align |
1022 | // CHECK-NEXT: bitcast |
1023 | // CHECK-NEXT: call void @llvm.memcpy |
1024 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1025 | |
1026 | TEST_UNINIT(intptr4, int*[4]); |
1027 | // CHECK-LABEL: @test_intptr4_uninit() |
1028 | // CHECK: %uninit = alloca [4 x i32*], align |
1029 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1030 | // PATTERN-O1-LABEL: @test_intptr4_uninit() |
1031 | // PATTERN-O1: %1 = getelementptr inbounds [4 x i32*], [4 x i32*]* %uninit, i64 0, i64 0 |
1032 | // PATTERN-O1-NEXT: store i32* inttoptr (i64 -6148914691236517206 to i32*), i32** %1, align 16 |
1033 | // PATTERN-O1-NEXT: %2 = getelementptr inbounds [4 x i32*], [4 x i32*]* %uninit, i64 0, i64 1 |
1034 | // PATTERN-O1-NEXT: store i32* inttoptr (i64 -6148914691236517206 to i32*), i32** %2, align 8 |
1035 | // PATTERN-O1-NEXT: %3 = getelementptr inbounds [4 x i32*], [4 x i32*]* %uninit, i64 0, i64 2 |
1036 | // PATTERN-O1-NEXT: store i32* inttoptr (i64 -6148914691236517206 to i32*), i32** %3, align 16 |
1037 | // PATTERN-O1-NEXT: %4 = getelementptr inbounds [4 x i32*], [4 x i32*]* %uninit, i64 0, i64 3 |
1038 | // PATTERN-O1-NEXT: store i32* inttoptr (i64 -6148914691236517206 to i32*), i32** %4, align 8 |
1039 | // ZERO-LABEL: @test_intptr4_uninit() |
1040 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
1041 | |
1042 | TEST_BRACES(intptr4, int*[4]); |
1043 | // CHECK-LABEL: @test_intptr4_braces() |
1044 | // CHECK: %braces = alloca [4 x i32*], align [[ALIGN:[0-9]*]] |
1045 | // CHECK-NEXT: bitcast |
1046 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 32, i1 false) |
1047 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1048 | |
1049 | TEST_CUSTOM(intptr4, int*[4], = { (int*)0x22222222, (int*)0x22222222, (int*)0x22222222, (int*)0x22222222 }); |
1050 | // CHECK-LABEL: @test_intptr4_custom() |
1051 | // CHECK: %custom = alloca [4 x i32*], align |
1052 | // CHECK-NEXT: bitcast |
1053 | // CHECK-NEXT: call void @llvm.memcpy |
1054 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1055 | |
1056 | TEST_UNINIT(tailpad4, tailpad[4]); |
1057 | // CHECK-LABEL: @test_tailpad4_uninit() |
1058 | // CHECK: %uninit = alloca [4 x %struct.tailpad], align |
1059 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1060 | // PATTERN-LABEL: @test_tailpad4_uninit() |
1061 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_tailpad4_uninit.uninit |
1062 | // PATTERN-O1: bitcast |
1063 | // PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}0, i8 -86, i64 16 |
1064 | // ZERO-LABEL: @test_tailpad4_uninit() |
1065 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
1066 | |
1067 | TEST_BRACES(tailpad4, tailpad[4]); |
1068 | // CHECK-LABEL: @test_tailpad4_braces() |
1069 | // CHECK: %braces = alloca [4 x %struct.tailpad], align [[ALIGN:[0-9]*]] |
1070 | // CHECK-NEXT: bitcast |
1071 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false) |
1072 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1073 | |
1074 | TEST_CUSTOM(tailpad4, tailpad[4], { {257, 1}, {257, 1}, {257, 1}, {257, 1} }); |
1075 | // CHECK-LABEL: @test_tailpad4_custom() |
1076 | // CHECK: %custom = alloca [4 x %struct.tailpad], align |
1077 | // CHECK-NEXT: bitcast |
1078 | // CHECK-NEXT: call void @llvm.memcpy |
1079 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1080 | |
1081 | TEST_UNINIT(tailpad9, tailpad[9]); |
1082 | // CHECK-LABEL: @test_tailpad9_uninit() |
1083 | // CHECK: %uninit = alloca [9 x %struct.tailpad], align |
1084 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1085 | // PATTERN-LABEL: @test_tailpad9_uninit() |
1086 | // PATTERN-O0: call void @llvm.memset{{.*}}, i8 -86, |
1087 | // ZERO-LABEL: @test_tailpad9_uninit() |
1088 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
1089 | |
1090 | TEST_BRACES(tailpad9, tailpad[9]); |
1091 | // CHECK-LABEL: @test_tailpad9_braces() |
1092 | // CHECK: %braces = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]] |
1093 | // CHECK-NEXT: bitcast |
1094 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 36, i1 false) |
1095 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1096 | |
1097 | TEST_CUSTOM(tailpad9, tailpad[9], { {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1} }); |
1098 | // CHECK-LABEL: @test_tailpad9_custom() |
1099 | // CHECK: %custom = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]] |
1100 | // CHECK-NEXT: bitcast |
1101 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 1, i64 36, i1 false) |
1102 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1103 | |
1104 | |
1105 | TEST_UNINIT(atomicbool, _Atomic(bool)); |
1106 | // CHECK-LABEL: @test_atomicbool_uninit() |
1107 | // CHECK: %uninit = alloca i8, align |
1108 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1109 | // PATTERN-LABEL: @test_atomicbool_uninit() |
1110 | // PATTERN: store i8 -86, i8* %uninit, align 1 |
1111 | // ZERO-LABEL: @test_atomicbool_uninit() |
1112 | // ZERO: store i8 0, i8* %uninit, align 1 |
1113 | |
1114 | TEST_UNINIT(atomicint, _Atomic(int)); |
1115 | // CHECK-LABEL: @test_atomicint_uninit() |
1116 | // CHECK: %uninit = alloca i32, align |
1117 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1118 | // PATTERN-LABEL: @test_atomicint_uninit() |
1119 | // PATTERN: store i32 -1431655766, i32* %uninit, align 4 |
1120 | // ZERO-LABEL: @test_atomicint_uninit() |
1121 | // ZERO: store i32 0, i32* %uninit, align 4 |
1122 | |
1123 | TEST_UNINIT(atomicdouble, _Atomic(double)); |
1124 | // CHECK-LABEL: @test_atomicdouble_uninit() |
1125 | // CHECK: %uninit = alloca double, align |
1126 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1127 | // PATTERN-LABEL: @test_atomicdouble_uninit() |
1128 | // PATTERN: store double 0xFFFFFFFFFFFFFFFF, double* %uninit, align 8 |
1129 | // ZERO-LABEL: @test_atomicdouble_uninit() |
1130 | // ZERO: store double 0.000000e+00, double* %uninit, align 8 |
1131 | |
1132 | TEST_UNINIT(atomicnotlockfree, _Atomic(notlockfree)); |
1133 | // CHECK-LABEL: @test_atomicnotlockfree_uninit() |
1134 | // CHECK: %uninit = alloca %struct.notlockfree, align |
1135 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1136 | // PATTERN-LABEL: @test_atomicnotlockfree_uninit() |
1137 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicnotlockfree_uninit.uninit |
1138 | // PATTERN-O1: bitcast |
1139 | // PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 -86, i64 32 |
1140 | // ZERO-LABEL: @test_atomicnotlockfree_uninit() |
1141 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
1142 | |
1143 | TEST_UNINIT(atomicpadded, _Atomic(padded)); |
1144 | // CHECK-LABEL: @test_atomicpadded_uninit() |
1145 | // CHECK: %uninit = alloca %struct.padded, align |
1146 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1147 | // PATTERN-LABEL: @test_atomicpadded_uninit() |
1148 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicpadded_uninit.uninit |
1149 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
1150 | // ZERO-LABEL: @test_atomicpadded_uninit() |
1151 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1152 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
1153 | |
1154 | TEST_UNINIT(atomictailpad, _Atomic(tailpad)); |
1155 | // CHECK-LABEL: @test_atomictailpad_uninit() |
1156 | // CHECK: %uninit = alloca %struct.tailpad, align |
1157 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1158 | // PATTERN-LABEL: @test_atomictailpad_uninit() |
1159 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomictailpad_uninit.uninit |
1160 | // ZERO-LABEL: @test_atomictailpad_uninit() |
1161 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1162 | // ZERO-O1: store i32 0, i32* %uninit, align 4 |
1163 | |
1164 | TEST_UNINIT(complexfloat, _Complex float); |
1165 | // CHECK-LABEL: @test_complexfloat_uninit() |
1166 | // CHECK: %uninit = alloca { float, float }, align |
1167 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1168 | // PATTERN-LABEL: @test_complexfloat_uninit() |
1169 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexfloat_uninit.uninit |
1170 | // PATTERN-O1: %[[F1:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 0 |
1171 | // PATTERN-O1 store float 0xFFFFFFFFE0000000, float* %[[F1]], align |
1172 | // PATTERN-O1: %[[F2:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 1 |
1173 | // PATTERN-O1: store float 0xFFFFFFFFE0000000, float* %[[F2]], align |
1174 | |
1175 | // ZERO-LABEL: @test_complexfloat_uninit() |
1176 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1177 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
1178 | |
1179 | TEST_BRACES(complexfloat, _Complex float); |
1180 | // CHECK-LABEL: @test_complexfloat_braces() |
1181 | // CHECK: %braces = alloca { float, float }, align [[ALIGN:[0-9]*]] |
1182 | // CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %braces, i32 0, i32 0 |
1183 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %braces, i32 0, i32 1 |
1184 | // CHECK-NEXT: store float 0.000000e+00, float* %[[R]], align [[ALIGN]] |
1185 | // CHECK-NEXT: store float 0.000000e+00, float* %[[I]], align [[ALIGN]] |
1186 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1187 | |
1188 | TEST_CUSTOM(complexfloat, _Complex float, { 3.1415926535897932384626433, 3.1415926535897932384626433 }); |
1189 | // CHECK-LABEL: @test_complexfloat_custom() |
1190 | // CHECK: %custom = alloca { float, float }, align [[ALIGN:[0-9]*]] |
1191 | // CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %custom, i32 0, i32 0 |
1192 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { float, float }, { float, float }* %custom, i32 0, i32 1 |
1193 | // CHECK-NEXT: store float 0x400921FB60000000, float* %[[R]], align [[ALIGN]] |
1194 | // CHECK-NEXT: store float 0x400921FB60000000, float* %[[I]], align [[ALIGN]] |
1195 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1196 | |
1197 | TEST_UNINIT(complexdouble, _Complex double); |
1198 | // CHECK-LABEL: @test_complexdouble_uninit() |
1199 | // CHECK: %uninit = alloca { double, double }, align |
1200 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1201 | // PATTERN-LABEL: @test_complexdouble_uninit() |
1202 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexdouble_uninit.uninit |
1203 | // ZERO-LABEL: @test_complexdouble_uninit() |
1204 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
1205 | |
1206 | TEST_BRACES(complexdouble, _Complex double); |
1207 | // CHECK-LABEL: @test_complexdouble_braces() |
1208 | // CHECK: %braces = alloca { double, double }, align [[ALIGN:[0-9]*]] |
1209 | // CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %braces, i32 0, i32 0 |
1210 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %braces, i32 0, i32 1 |
1211 | // CHECK-NEXT: store double 0.000000e+00, double* %[[R]], align [[ALIGN]] |
1212 | // CHECK-NEXT: store double 0.000000e+00, double* %[[I]], align [[ALIGN]] |
1213 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1214 | |
1215 | TEST_CUSTOM(complexdouble, _Complex double, { 3.1415926535897932384626433, 3.1415926535897932384626433 }); |
1216 | // CHECK-LABEL: @test_complexdouble_custom() |
1217 | // CHECK: %custom = alloca { double, double }, align [[ALIGN:[0-9]*]] |
1218 | // CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %custom, i32 0, i32 0 |
1219 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds { double, double }, { double, double }* %custom, i32 0, i32 1 |
1220 | // CHECK-NEXT: store double 0x400921FB54442D18, double* %[[R]], align [[ALIGN]] |
1221 | // CHECK-NEXT: store double 0x400921FB54442D18, double* %[[I]], align [[ALIGN]] |
1222 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1223 | |
1224 | |
1225 | TEST_UNINIT(volatileint, volatile int); |
1226 | // CHECK-LABEL: @test_volatileint_uninit() |
1227 | // CHECK: %uninit = alloca i32, align |
1228 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1229 | // PATTERN-LABEL: @test_volatileint_uninit() |
1230 | // PATTERN: store volatile i32 -1431655766, i32* %uninit, align 4 |
1231 | // ZERO-LABEL: @test_volatileint_uninit() |
1232 | // ZERO: store volatile i32 0, i32* %uninit, align 4 |
1233 | |
1234 | TEST_BRACES(volatileint, volatile int); |
1235 | // CHECK-LABEL: @test_volatileint_braces() |
1236 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
1237 | // CHECK-NEXT: store volatile i32 0, i32* %braces, align [[ALIGN]] |
1238 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1239 | |
1240 | TEST_UNINIT(semivolatile, semivolatile); |
1241 | // CHECK-LABEL: @test_semivolatile_uninit() |
1242 | // CHECK: %uninit = alloca %struct.semivolatile, align |
1243 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1244 | // PATTERN-LABEL: @test_semivolatile_uninit() |
1245 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_semivolatile_uninit.uninit |
1246 | // ZERO-LABEL: @test_semivolatile_uninit() |
1247 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1248 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
1249 | |
1250 | TEST_BRACES(semivolatile, semivolatile); |
1251 | // CHECK-LABEL: @test_semivolatile_braces() |
1252 | // CHECK: %braces = alloca %struct.semivolatile, align [[ALIGN:[0-9]*]] |
1253 | // CHECK-NEXT: bitcast |
1254 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
1255 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1256 | |
1257 | TEST_CUSTOM(semivolatile, semivolatile, { 0x44444444, 0x44444444 }); |
1258 | // CHECK-LABEL: @test_semivolatile_custom() |
1259 | // CHECK: %custom = alloca %struct.semivolatile, align |
1260 | // CHECK-O0: bitcast |
1261 | // CHECK-O0: call void @llvm.memcpy |
1262 | // CHECK-O0: call void @{{.*}}used{{.*}}%custom) |
1263 | // CHECK-O1: store i64 4919131752989213764, i64* %custom, align 8 |
1264 | |
1265 | TEST_UNINIT(semivolatileinit, semivolatileinit); |
1266 | // CHECK-LABEL: @test_semivolatileinit_uninit() |
1267 | // CHECK: %uninit = alloca %struct.semivolatileinit, align |
1268 | // CHECK-NEXT: call void @{{.*}}semivolatileinit{{.*}}%uninit) |
1269 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1270 | |
1271 | TEST_BRACES(semivolatileinit, semivolatileinit); |
1272 | // CHECK-LABEL: @test_semivolatileinit_braces() |
1273 | // CHECK: %braces = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]] |
1274 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %braces, i32 0, i32 0 |
1275 | // CHECK-NEXT: store i32 286331153, i32* %[[I]], align [[ALIGN]] |
1276 | // CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %braces, i32 0, i32 1 |
1277 | // CHECK-NEXT: store volatile i32 286331153, i32* %[[VI]], align [[ALIGN]] |
1278 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1279 | |
1280 | TEST_CUSTOM(semivolatileinit, semivolatileinit, { 0x44444444, 0x44444444 }); |
1281 | // CHECK-LABEL: @test_semivolatileinit_custom() |
1282 | // CHECK: %custom = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]] |
1283 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %custom, i32 0, i32 0 |
1284 | // CHECK-NEXT: store i32 1145324612, i32* %[[I]], align [[ALIGN]] |
1285 | // CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %custom, i32 0, i32 1 |
1286 | // CHECK-NEXT: store volatile i32 1145324612, i32* %[[VI]], align [[ALIGN]] |
1287 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1288 | |
1289 | |
1290 | TEST_UNINIT(base, base); |
1291 | // CHECK-LABEL: @test_base_uninit() |
1292 | // CHECK: %uninit = alloca %struct.base, align |
1293 | // CHECK-NEXT: call void @{{.*}}base{{.*}}%uninit) |
1294 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1295 | // PATTERN-LABEL: @test_base_uninit() |
1296 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_base_uninit.uninit |
1297 | // ZERO-LABEL: @test_base_uninit() |
1298 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1299 | // ZERO-O1: store i64 0, {{.*}} align 8 |
1300 | |
1301 | TEST_BRACES(base, base); |
1302 | // CHECK-LABEL: @test_base_braces() |
1303 | // CHECK: %braces = alloca %struct.base, align [[ALIGN:[0-9]*]] |
1304 | // CHECK-NEXT: bitcast |
1305 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
1306 | // CHECK-NEXT: call void @{{.*}}base{{.*}}%braces) |
1307 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1308 | |
1309 | TEST_UNINIT(derived, derived); |
1310 | // CHECK-LABEL: @test_derived_uninit() |
1311 | // CHECK: %uninit = alloca %struct.derived, align |
1312 | // CHECK-NEXT: call void @{{.*}}derived{{.*}}%uninit) |
1313 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1314 | // PATTERN-LABEL: @test_derived_uninit() |
1315 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_derived_uninit.uninit |
1316 | // ZERO-LABEL: @test_derived_uninit() |
1317 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1318 | // ZERO-O1: store i64 0, {{.*}} align 8 |
1319 | |
1320 | TEST_BRACES(derived, derived); |
1321 | // CHECK-LABEL: @test_derived_braces() |
1322 | // CHECK: %braces = alloca %struct.derived, align [[ALIGN:[0-9]*]] |
1323 | // CHECK-NEXT: bitcast |
1324 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
1325 | // CHECK-NEXT: call void @{{.*}}derived{{.*}}%braces) |
1326 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1327 | |
1328 | TEST_UNINIT(virtualderived, virtualderived); |
1329 | // CHECK-LABEL: @test_virtualderived_uninit() |
1330 | // CHECK: %uninit = alloca %struct.virtualderived, align |
1331 | // CHECK-NEXT: call void @{{.*}}virtualderived{{.*}}%uninit) |
1332 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1333 | // PATTERN-LABEL: @test_virtualderived_uninit() |
1334 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_virtualderived_uninit.uninit |
1335 | // ZERO-LABEL: @test_virtualderived_uninit() |
1336 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
1337 | |
1338 | TEST_BRACES(virtualderived, virtualderived); |
1339 | // CHECK-LABEL: @test_virtualderived_braces() |
1340 | // CHECK: %braces = alloca %struct.virtualderived, align [[ALIGN:[0-9]*]] |
1341 | // CHECK-NEXT: bitcast |
1342 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false) |
1343 | // CHECK-NEXT: call void @{{.*}}virtualderived{{.*}}%braces) |
1344 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1345 | |
1346 | |
1347 | TEST_UNINIT(matching, matching); |
1348 | // CHECK-LABEL: @test_matching_uninit() |
1349 | // CHECK: %uninit = alloca %union.matching, align |
1350 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1351 | // PATTERN-LABEL: @test_matching_uninit() |
1352 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matching_uninit.uninit |
1353 | // ZERO-LABEL: @test_matching_uninit() |
1354 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1355 | // ZERO-O1: store i32 0, {{.*}} align 4 |
1356 | |
1357 | TEST_BRACES(matching, matching); |
1358 | // CHECK-LABEL: @test_matching_braces() |
1359 | // CHECK: %braces = alloca %union.matching, align [[ALIGN:[0-9]*]] |
1360 | // CHECK-NEXT: bitcast |
1361 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
1362 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1363 | |
1364 | TEST_CUSTOM(matching, matching, { .f = 0xf00f }); |
1365 | // CHECK-LABEL: @test_matching_custom() |
1366 | // CHECK: %custom = alloca %union.matching, align |
1367 | // CHECK-O0: bitcast |
1368 | // CHECK-O0: call void @llvm.memcpy |
1369 | // CHECK-O0: call void @{{.*}}used{{.*}}%custom) |
1370 | // CHECK-O1: getelementptr |
1371 | // CHECK-O1: store i32 1198526208, i32* {{.*}}, align 4 |
1372 | |
1373 | TEST_UNINIT(matchingreverse, matchingreverse); |
1374 | // CHECK-LABEL: @test_matchingreverse_uninit() |
1375 | // CHECK: %uninit = alloca %union.matchingreverse, align |
1376 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1377 | // PATTERN-LABEL: @test_matchingreverse_uninit() |
1378 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matchingreverse_uninit.uninit |
1379 | // PATTERN-O1: store float 0xFFFFFFFFE0000000 |
1380 | // ZERO-LABEL: @test_matchingreverse_uninit() |
1381 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1382 | // ZERO-O1: store i32 0, {{.*}} align 4 |
1383 | |
1384 | TEST_BRACES(matchingreverse, matchingreverse); |
1385 | // CHECK-LABEL: @test_matchingreverse_braces() |
1386 | // CHECK: %braces = alloca %union.matchingreverse, align [[ALIGN:[0-9]*]] |
1387 | // CHECK-NEXT: bitcast |
1388 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
1389 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1390 | |
1391 | TEST_CUSTOM(matchingreverse, matchingreverse, { .i = 0xf00f }); |
1392 | // CHECK-LABEL: @test_matchingreverse_custom() |
1393 | // CHECK: %custom = alloca %union.matchingreverse, align |
1394 | // CHECK-O0: bitcast |
1395 | // CHECK-O0: call void @llvm.memcpy |
1396 | // CHECK-O0: call void @{{.*}}used{{.*}}%custom) |
1397 | // CHECK-O1: store i32 61455, i32* %1, align 4 |
1398 | |
1399 | TEST_UNINIT(unmatched, unmatched); |
1400 | // CHECK-LABEL: @test_unmatched_uninit() |
1401 | // CHECK: %uninit = alloca %union.unmatched, align |
1402 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1403 | // PATTERN-LABEL: @test_unmatched_uninit() |
1404 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatched_uninit.uninit |
1405 | // ZERO-LABEL: @test_unmatched_uninit() |
1406 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1407 | // ZERO-O1: store i32 0, {{.*}} align 4 |
1408 | |
1409 | TEST_BRACES(unmatched, unmatched); |
1410 | // CHECK-LABEL: @test_unmatched_braces() |
1411 | // CHECK: %braces = alloca %union.unmatched, align |
1412 | // CHECK-NEXT: bitcast |
1413 | // CHECK-NEXT: call void @llvm.memcpy |
1414 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1415 | |
1416 | TEST_CUSTOM(unmatched, unmatched, { .i = 0x3badbeef }); |
1417 | // CHECK-LABEL: @test_unmatched_custom() |
1418 | // CHECK: %custom = alloca %union.unmatched, align |
1419 | // CHECK-O0: bitcast |
1420 | // CHECK-O0: call void @llvm.memcpy |
1421 | // CHECK-O0: call void @{{.*}}used{{.*}}%custom) |
1422 | // CHECK-O1: store i32 1001242351, i32* {{.*}}, align 4 |
1423 | |
1424 | TEST_UNINIT(unmatchedreverse, unmatchedreverse); |
1425 | // CHECK-LABEL: @test_unmatchedreverse_uninit() |
1426 | // CHECK: %uninit = alloca %union.unmatchedreverse, align |
1427 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1428 | // PATTERN-LABEL: @test_unmatchedreverse_uninit() |
1429 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedreverse_uninit.uninit |
1430 | // ZERO-LABEL: @test_unmatchedreverse_uninit() |
1431 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1432 | // ZERO-O1: store i32 0, {{.*}} align 4 |
1433 | |
1434 | TEST_BRACES(unmatchedreverse, unmatchedreverse); |
1435 | // CHECK-LABEL: @test_unmatchedreverse_braces() |
1436 | // CHECK: %braces = alloca %union.unmatchedreverse, align [[ALIGN:[0-9]*]] |
1437 | // CHECK-NEXT: bitcast |
1438 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
1439 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1440 | |
1441 | TEST_CUSTOM(unmatchedreverse, unmatchedreverse, { .c = 42 }); |
1442 | // CHECK-LABEL: @test_unmatchedreverse_custom() |
1443 | // CHECK: %custom = alloca %union.unmatchedreverse, align |
1444 | // CHECK-O0: bitcast |
1445 | // CHECK-O0: call void @llvm.memcpy |
1446 | // CHECK-O0: call void @{{.*}}used{{.*}}%custom) |
1447 | // PATTERN-O1: store i32 -1431655894, i32* {{.*}}, align 4 |
1448 | // ZERO-O1: store i32 42, i32* {{.*}}, align 4 |
1449 | |
1450 | TEST_UNINIT(unmatchedfp, unmatchedfp); |
1451 | // CHECK-LABEL: @test_unmatchedfp_uninit() |
1452 | // CHECK: %uninit = alloca %union.unmatchedfp, align |
1453 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1454 | // PATTERN-LABEL: @test_unmatchedfp_uninit() |
1455 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedfp_uninit.uninit |
1456 | // ZERO-LABEL: @test_unmatchedfp_uninit() |
1457 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
1458 | // ZERO-O1: store i64 0, {{.*}} align 8 |
1459 | |
1460 | TEST_BRACES(unmatchedfp, unmatchedfp); |
1461 | // CHECK-LABEL: @test_unmatchedfp_braces() |
1462 | // CHECK: %braces = alloca %union.unmatchedfp, align |
1463 | // CHECK-NEXT: bitcast |
1464 | // CHECK-NEXT: call void @llvm.memcpy |
1465 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1466 | |
1467 | TEST_CUSTOM(unmatchedfp, unmatchedfp, { .d = 3.1415926535897932384626433 }); |
1468 | // CHECK-LABEL: @test_unmatchedfp_custom() |
1469 | // CHECK: %custom = alloca %union.unmatchedfp, align |
1470 | // CHECK-O0: bitcast |
1471 | // CHECK-O0: call void @llvm.memcpy |
1472 | // CHECK-O0: call void @{{.*}}used{{.*}}%custom) |
1473 | // CHECK-O1: store i64 4614256656552045848, i64* %1, align 8 |
1474 | |
1475 | TEST_UNINIT(emptyenum, emptyenum); |
1476 | // CHECK-LABEL: @test_emptyenum_uninit() |
1477 | // CHECK: %uninit = alloca i32, align |
1478 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1479 | // PATTERN-LABEL: @test_emptyenum_uninit() |
1480 | // PATTERN: store i32 -1431655766, i32* %uninit, align 4 |
1481 | // ZERO-LABEL: @test_emptyenum_uninit() |
1482 | // ZERO: store i32 0, i32* %uninit, align 4 |
1483 | |
1484 | TEST_BRACES(emptyenum, emptyenum); |
1485 | // CHECK-LABEL: @test_emptyenum_braces() |
1486 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
1487 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
1488 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1489 | |
1490 | TEST_CUSTOM(emptyenum, emptyenum, { (emptyenum)42 }); |
1491 | // CHECK-LABEL: @test_emptyenum_custom() |
1492 | // CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]] |
1493 | // CHECK-NEXT: store i32 42, i32* %custom, align [[ALIGN]] |
1494 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1495 | |
1496 | TEST_UNINIT(smallenum, smallenum); |
1497 | // CHECK-LABEL: @test_smallenum_uninit() |
1498 | // CHECK: %uninit = alloca i32, align |
1499 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1500 | // PATTERN-LABEL: @test_smallenum_uninit() |
1501 | // PATTERN: store i32 -1431655766, i32* %uninit, align 4 |
1502 | // ZERO-LABEL: @test_smallenum_uninit() |
1503 | // ZERO: store i32 0, i32* %uninit, align 4 |
1504 | |
1505 | TEST_BRACES(smallenum, smallenum); |
1506 | // CHECK-LABEL: @test_smallenum_braces() |
1507 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
1508 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
1509 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1510 | |
1511 | TEST_CUSTOM(smallenum, smallenum, { (smallenum)42 }); |
1512 | // CHECK-LABEL: @test_smallenum_custom() |
1513 | // CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]] |
1514 | // CHECK-NEXT: store i32 42, i32* %custom, align [[ALIGN]] |
1515 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1516 | |
1517 | |
1518 | TEST_UNINIT(intvec16, int __attribute__((vector_size(16)))); |
1519 | // CHECK-LABEL: @test_intvec16_uninit() |
1520 | // CHECK: %uninit = alloca <4 x i32>, align |
1521 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1522 | // PATTERN-LABEL: @test_intvec16_uninit() |
1523 | // PATTERN: store <4 x i32> <i32 -1431655766, i32 -1431655766, i32 -1431655766, i32 -1431655766>, <4 x i32>* %uninit, align 16 |
1524 | // ZERO-LABEL: @test_intvec16_uninit() |
1525 | // ZERO: store <4 x i32> zeroinitializer, <4 x i32>* %uninit, align 16 |
1526 | |
1527 | TEST_BRACES(intvec16, int __attribute__((vector_size(16)))); |
1528 | // CHECK-LABEL: @test_intvec16_braces() |
1529 | // CHECK: %braces = alloca <4 x i32>, align [[ALIGN:[0-9]*]] |
1530 | // CHECK-NEXT: store <4 x i32> zeroinitializer, <4 x i32>* %braces, align [[ALIGN]] |
1531 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1532 | |
1533 | TEST_CUSTOM(intvec16, int __attribute__((vector_size(16))), { 0x44444444, 0x44444444, 0x44444444, 0x44444444 }); |
1534 | // CHECK-LABEL: @test_intvec16_custom() |
1535 | // CHECK: %custom = alloca <4 x i32>, align [[ALIGN:[0-9]*]] |
1536 | // CHECK-NEXT: store <4 x i32> <i32 1145324612, i32 1145324612, i32 1145324612, i32 1145324612>, <4 x i32>* %custom, align [[ALIGN]] |
1537 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1538 | |
1539 | TEST_UNINIT(longlongvec32, long long __attribute__((vector_size(32)))); |
1540 | // CHECK-LABEL: @test_longlongvec32_uninit() |
1541 | // CHECK: %uninit = alloca <4 x i64>, align |
1542 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1543 | // PATTERN-LABEL: @test_longlongvec32_uninit() |
1544 | // PATTERN: store <4 x i64> <i64 -6148914691236517206, i64 -6148914691236517206, i64 -6148914691236517206, i64 -6148914691236517206>, <4 x i64>* %uninit, align 32 |
1545 | // ZERO-LABEL: @test_longlongvec32_uninit() |
1546 | // ZERO: store <4 x i64> zeroinitializer, <4 x i64>* %uninit, align 32 |
1547 | |
1548 | TEST_BRACES(longlongvec32, long long __attribute__((vector_size(32)))); |
1549 | // CHECK-LABEL: @test_longlongvec32_braces() |
1550 | // CHECK: %braces = alloca <4 x i64>, align [[ALIGN:[0-9]*]] |
1551 | // CHECK-NEXT: store <4 x i64> zeroinitializer, <4 x i64>* %braces, align [[ALIGN]] |
1552 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1553 | |
1554 | TEST_CUSTOM(longlongvec32, long long __attribute__((vector_size(32))), { 0x3333333333333333, 0x3333333333333333, 0x3333333333333333, 0x3333333333333333 }); |
1555 | // CHECK-LABEL: @test_longlongvec32_custom() |
1556 | // CHECK: %custom = alloca <4 x i64>, align [[ALIGN:[0-9]*]] |
1557 | // CHECK-NEXT: store <4 x i64> <i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323, i64 3689348814741910323>, <4 x i64>* %custom, align [[ALIGN]] |
1558 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1559 | |
1560 | TEST_UNINIT(floatvec16, float __attribute__((vector_size(16)))); |
1561 | // CHECK-LABEL: @test_floatvec16_uninit() |
1562 | // CHECK: %uninit = alloca <4 x float>, align |
1563 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1564 | // PATTERN-LABEL: @test_floatvec16_uninit() |
1565 | // PATTERN: store <4 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, <4 x float>* %uninit, align 16 |
1566 | // ZERO-LABEL: @test_floatvec16_uninit() |
1567 | // ZERO: store <4 x float> zeroinitializer, <4 x float>* %uninit, align 16 |
1568 | |
1569 | TEST_BRACES(floatvec16, float __attribute__((vector_size(16)))); |
1570 | // CHECK-LABEL: @test_floatvec16_braces() |
1571 | // CHECK: %braces = alloca <4 x float>, align [[ALIGN:[0-9]*]] |
1572 | // CHECK-NEXT: store <4 x float> zeroinitializer, <4 x float>* %braces, align [[ALIGN]] |
1573 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1574 | |
1575 | TEST_CUSTOM(floatvec16, float __attribute__((vector_size(16))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 }); |
1576 | // CHECK-LABEL: @test_floatvec16_custom() |
1577 | // CHECK: %custom = alloca <4 x float>, align [[ALIGN:[0-9]*]] |
1578 | // CHECK-NEXT: store <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, <4 x float>* %custom, align [[ALIGN]] |
1579 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1580 | |
1581 | TEST_UNINIT(doublevec32, double __attribute__((vector_size(32)))); |
1582 | // CHECK-LABEL: @test_doublevec32_uninit() |
1583 | // CHECK: %uninit = alloca <4 x double>, align |
1584 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
1585 | // PATTERN-LABEL: @test_doublevec32_uninit() |
1586 | // PATTERN: store <4 x double> <double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF>, <4 x double>* %uninit, align 32 |
1587 | // ZERO-LABEL: @test_doublevec32_uninit() |
1588 | // ZERO: store <4 x double> zeroinitializer, <4 x double>* %uninit, align 32 |
1589 | |
1590 | TEST_BRACES(doublevec32, double __attribute__((vector_size(32)))); |
1591 | // CHECK-LABEL: @test_doublevec32_braces() |
1592 | // CHECK: %braces = alloca <4 x double>, align [[ALIGN:[0-9]*]] |
1593 | // CHECK-NEXT: store <4 x double> zeroinitializer, <4 x double>* %braces, align [[ALIGN]] |
1594 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
1595 | |
1596 | TEST_CUSTOM(doublevec32, double __attribute__((vector_size(32))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 }); |
1597 | // CHECK-LABEL: @test_doublevec32_custom() |
1598 | // CHECK: %custom = alloca <4 x double>, align [[ALIGN:[0-9]*]] |
1599 | // CHECK-NEXT: store <4 x double> <double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18, double 0x400921FB54442D18>, <4 x double>* %custom, align [[ALIGN]] |
1600 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
1601 | |
1602 | |
1603 | } // extern "C" |
1604 | |