| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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 | |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 31 | // None of the synthesized globals should contain `undef`. |
| 32 | // PATTERN-NOT: undef |
| 33 | // ZERO-NOT: undef |
| 34 | |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 37 | struct empty {}; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 44 | struct small { char c; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 51 | struct smallinit { char c = 42; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 58 | struct smallpartinit { char c = 42, d; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 65 | struct nullinit { char* null = nullptr; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | cdf26f1 | 2019-04-30 23:27:28 +0000 | [diff] [blame] | 67 | // PATTERN-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 |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 72 | struct padded { char c; int i; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 79 | struct paddednullinit { char c = 0; int i = 0; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 80 | // PATTERN-O0: @__const.test_paddedpacked_uninit.uninit = private unnamed_addr constant %struct.paddedpacked <{ i8 -86, i32 -1431655766 }>, align 1 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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)); |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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]; }; |
| Peter Collingbourne | 68b4673 | 2019-03-16 19:25:39 +0000 | [diff] [blame] | 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)); |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | cdf26f1 | 2019-04-30 23:27:28 +0000 | [diff] [blame] | 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] zeroinitializer, i32 13371337 }, { i8, [3 x i8], i32 } { i8 43, [3 x i8] zeroinitializer, i32 13371338 } }, align 4 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 104 | struct bitfield { int i : 4; int j : 2; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 119 | struct arraytail { int i; int arr[]; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 | |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | cdf26f1 | 2019-04-30 23:27:28 +0000 | [diff] [blame] | 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] 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 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 140 | struct tailpad { short s; char c; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 143 | struct notlockfree { long long a[4]; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 163 | struct semivolatile { int i; volatile int vi; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 172 | struct semivolatileinit { int i = 0x11111111; volatile int vi = 0x11111111; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 177 | struct base { virtual ~base(); }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 182 | struct derived : public base {}; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 187 | struct virtualderived : public virtual base, public virtual derived {}; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 194 | union matching { int i; float f; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 201 | union matchingreverse { float f; int i; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 208 | union unmatched { char c; int i; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 215 | union unmatchedreverse { int i; char c; }; |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 230 | // CHECK: %uninit = alloca i8, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 231 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 236 | |
| 237 | TEST_BRACES(char, char); |
| 238 | // CHECK-LABEL: @test_char_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 239 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
| 240 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 241 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 242 | |
| 243 | TEST_UNINIT(uchar, unsigned char); |
| 244 | // CHECK-LABEL: @test_uchar_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 245 | // CHECK: %uninit = alloca i8, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 246 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 251 | |
| 252 | TEST_BRACES(uchar, unsigned char); |
| 253 | // CHECK-LABEL: @test_uchar_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 254 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
| 255 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 256 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 257 | |
| 258 | TEST_UNINIT(schar, signed char); |
| 259 | // CHECK-LABEL: @test_schar_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 260 | // CHECK: %uninit = alloca i8, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 261 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 266 | |
| 267 | TEST_BRACES(schar, signed char); |
| 268 | // CHECK-LABEL: @test_schar_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 269 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
| 270 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 271 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 272 | |
| 273 | TEST_UNINIT(wchar_t, wchar_t); |
| 274 | // CHECK-LABEL: @test_wchar_t_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 275 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 276 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 281 | |
| 282 | TEST_BRACES(wchar_t, wchar_t); |
| 283 | // CHECK-LABEL: @test_wchar_t_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 284 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
| 285 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 286 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 287 | |
| 288 | TEST_UNINIT(short, short); |
| 289 | // CHECK-LABEL: @test_short_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 290 | // CHECK: %uninit = alloca i16, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 291 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 296 | |
| 297 | TEST_BRACES(short, short); |
| 298 | // CHECK-LABEL: @test_short_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 299 | // CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]] |
| 300 | // CHECK-NEXT: store i16 0, i16* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 301 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 302 | |
| 303 | TEST_UNINIT(ushort, unsigned short); |
| 304 | // CHECK-LABEL: @test_ushort_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 305 | // CHECK: %uninit = alloca i16, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 306 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 311 | |
| 312 | TEST_BRACES(ushort, unsigned short); |
| 313 | // CHECK-LABEL: @test_ushort_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 314 | // CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]] |
| 315 | // CHECK-NEXT: store i16 0, i16* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 316 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 317 | |
| 318 | TEST_UNINIT(int, int); |
| 319 | // CHECK-LABEL: @test_int_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 320 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 321 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 326 | |
| 327 | TEST_BRACES(int, int); |
| 328 | // CHECK-LABEL: @test_int_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 329 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
| 330 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 331 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 332 | |
| 333 | TEST_UNINIT(unsigned, unsigned); |
| 334 | // CHECK-LABEL: @test_unsigned_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 335 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 336 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 341 | |
| 342 | TEST_BRACES(unsigned, unsigned); |
| 343 | // CHECK-LABEL: @test_unsigned_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 344 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
| 345 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 346 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 347 | |
| 348 | TEST_UNINIT(long, long); |
| 349 | // CHECK-LABEL: @test_long_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 350 | // CHECK: %uninit = alloca i64, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 351 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 356 | |
| 357 | TEST_BRACES(long, long); |
| 358 | // CHECK-LABEL: @test_long_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 359 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
| 360 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 361 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 362 | |
| 363 | TEST_UNINIT(ulong, unsigned long); |
| 364 | // CHECK-LABEL: @test_ulong_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 365 | // CHECK: %uninit = alloca i64, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 366 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 371 | |
| 372 | TEST_BRACES(ulong, unsigned long); |
| 373 | // CHECK-LABEL: @test_ulong_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 374 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
| 375 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 376 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 377 | |
| 378 | TEST_UNINIT(longlong, long long); |
| 379 | // CHECK-LABEL: @test_longlong_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 380 | // CHECK: %uninit = alloca i64, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 381 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 386 | |
| 387 | TEST_BRACES(longlong, long long); |
| 388 | // CHECK-LABEL: @test_longlong_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 389 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
| 390 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 391 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 392 | |
| 393 | TEST_UNINIT(ulonglong, unsigned long long); |
| 394 | // CHECK-LABEL: @test_ulonglong_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 395 | // CHECK: %uninit = alloca i64, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 396 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 401 | |
| 402 | TEST_BRACES(ulonglong, unsigned long long); |
| 403 | // CHECK-LABEL: @test_ulonglong_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 404 | // CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]] |
| 405 | // CHECK-NEXT: store i64 0, i64* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 406 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 407 | |
| 408 | TEST_UNINIT(int128, __int128); |
| 409 | // CHECK-LABEL: @test_int128_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 410 | // CHECK: %uninit = alloca i128, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 411 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 416 | |
| 417 | TEST_BRACES(int128, __int128); |
| 418 | // CHECK-LABEL: @test_int128_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 419 | // CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]] |
| 420 | // CHECK-NEXT: store i128 0, i128* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 421 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 422 | |
| 423 | TEST_UNINIT(uint128, unsigned __int128); |
| 424 | // CHECK-LABEL: @test_uint128_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 425 | // CHECK: %uninit = alloca i128, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 426 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 431 | |
| 432 | TEST_BRACES(uint128, unsigned __int128); |
| 433 | // CHECK-LABEL: @test_uint128_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 434 | // CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]] |
| 435 | // CHECK-NEXT: store i128 0, i128* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 436 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 437 | |
| 438 | |
| 439 | TEST_UNINIT(fp16, __fp16); |
| 440 | // CHECK-LABEL: @test_fp16_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 441 | // CHECK: %uninit = alloca half, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 442 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 447 | |
| 448 | TEST_BRACES(fp16, __fp16); |
| 449 | // CHECK-LABEL: @test_fp16_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 450 | // CHECK: %braces = alloca half, align [[ALIGN:[0-9]*]] |
| 451 | // CHECK-NEXT: store half 0xH0000, half* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 452 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 453 | |
| 454 | TEST_UNINIT(float, float); |
| 455 | // CHECK-LABEL: @test_float_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 456 | // CHECK: %uninit = alloca float, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 457 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 462 | |
| 463 | TEST_BRACES(float, float); |
| 464 | // CHECK-LABEL: @test_float_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 465 | // CHECK: %braces = alloca float, align [[ALIGN:[0-9]*]] |
| 466 | // CHECK-NEXT: store float 0.000000e+00, float* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 467 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 468 | |
| 469 | TEST_UNINIT(double, double); |
| 470 | // CHECK-LABEL: @test_double_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 471 | // CHECK: %uninit = alloca double, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 472 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 477 | |
| 478 | TEST_BRACES(double, double); |
| 479 | // CHECK-LABEL: @test_double_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 480 | // CHECK: %braces = alloca double, align [[ALIGN:[0-9]*]] |
| 481 | // CHECK-NEXT: store double 0.000000e+00, double* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 482 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 483 | |
| 484 | TEST_UNINIT(longdouble, long double); |
| 485 | // CHECK-LABEL: @test_longdouble_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 486 | // CHECK: %uninit = alloca x86_fp80, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 487 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 492 | |
| 493 | TEST_BRACES(longdouble, long double); |
| 494 | // CHECK-LABEL: @test_longdouble_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 495 | // CHECK: %braces = alloca x86_fp80, align [[ALIGN:[0-9]*]] |
| 496 | // CHECK-NEXT: store x86_fp80 0xK00000000000000000000, x86_fp80* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 497 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 498 | |
| 499 | |
| 500 | TEST_UNINIT(intptr, int*); |
| 501 | // CHECK-LABEL: @test_intptr_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 502 | // CHECK: %uninit = alloca i32*, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 503 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 508 | |
| 509 | TEST_BRACES(intptr, int*); |
| 510 | // CHECK-LABEL: @test_intptr_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 511 | // CHECK: %braces = alloca i32*, align [[ALIGN:[0-9]*]] |
| 512 | // CHECK-NEXT: store i32* null, i32** %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 513 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 514 | |
| 515 | TEST_UNINIT(intptrptr, int**); |
| 516 | // CHECK-LABEL: @test_intptrptr_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 517 | // CHECK: %uninit = alloca i32**, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 518 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 523 | |
| 524 | TEST_BRACES(intptrptr, int**); |
| 525 | // CHECK-LABEL: @test_intptrptr_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 526 | // CHECK: %braces = alloca i32**, align [[ALIGN:[0-9]*]] |
| 527 | // CHECK-NEXT: store i32** null, i32*** %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 528 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 529 | |
| 530 | TEST_UNINIT(function, void(*)()); |
| 531 | // CHECK-LABEL: @test_function_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 532 | // CHECK: %uninit = alloca void ()*, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 533 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 538 | |
| 539 | TEST_BRACES(function, void(*)()); |
| 540 | // CHECK-LABEL: @test_function_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 541 | // CHECK: %braces = alloca void ()*, align [[ALIGN:[0-9]*]] |
| 542 | // CHECK-NEXT: store void ()* null, void ()** %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 543 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 544 | |
| 545 | TEST_UNINIT(bool, bool); |
| 546 | // CHECK-LABEL: @test_bool_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 547 | // CHECK: %uninit = alloca i8, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 548 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 553 | |
| 554 | TEST_BRACES(bool, bool); |
| 555 | // CHECK-LABEL: @test_bool_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 556 | // CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]] |
| 557 | // CHECK-NEXT: store i8 0, i8* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 558 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 559 | |
| 560 | |
| 561 | TEST_UNINIT(empty, empty); |
| 562 | // CHECK-LABEL: @test_empty_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 563 | // CHECK: %uninit = alloca %struct.empty, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 564 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 565 | // PATTERN-LABEL: @test_empty_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 566 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_empty_uninit.uninit |
| 567 | // PATTERN-O1: store i8 -86, {{.*}} align 1 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 568 | // ZERO-LABEL: @test_empty_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 569 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 570 | // ZERO-O1: store i8 0, {{.*}} align 1 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 571 | |
| 572 | TEST_BRACES(empty, empty); |
| 573 | // CHECK-LABEL: @test_empty_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 574 | // CHECK: %braces = alloca %struct.empty, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 581 | // CHECK: %uninit = alloca %struct.small, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 582 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 583 | // PATTERN-LABEL: @test_small_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 584 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_small_uninit.uninit |
| 585 | // PATTERN-O1: store i8 -86, {{.*}} align 1 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 586 | // ZERO-LABEL: @test_small_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 587 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 588 | // ZERO-O1: store i8 0, {{.*}} align 1 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 589 | |
| 590 | TEST_BRACES(small, small); |
| 591 | // CHECK-LABEL: @test_small_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 592 | // CHECK: %braces = alloca %struct.small, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 593 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 594 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 1, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 595 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 596 | |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 597 | TEST_CUSTOM(small, small, { 42 }); |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 598 | // CHECK-LABEL: @test_small_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 599 | // CHECK: %custom = alloca %struct.small, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 606 | // CHECK: %uninit = alloca %struct.smallinit, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 612 | // CHECK: %braces = alloca %struct.smallinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 613 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, %struct.smallinit* %braces, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 614 | // CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 615 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 616 | |
| 617 | TEST_CUSTOM(smallinit, smallinit, { 100 }); |
| 618 | // CHECK-LABEL: @test_smallinit_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 619 | // CHECK: %custom = alloca %struct.smallinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 620 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallinit, %struct.smallinit* %custom, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 621 | // CHECK-NEXT: store i8 100, i8* %[[C]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 622 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 623 | |
| 624 | TEST_UNINIT(smallpartinit, smallpartinit); |
| 625 | // CHECK-LABEL: @test_smallpartinit_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 626 | // CHECK: %uninit = alloca %struct.smallpartinit, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 627 | // CHECK-NEXT: call void @{{.*}}smallpartinit{{.*}}%uninit) |
| 628 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 629 | // PATTERN-LABEL: @test_smallpartinit_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 633 | // ZERO-LABEL: @test_smallpartinit_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 634 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 635 | // ZERO-O1: store i16 0, i16* %uninit, align 2 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 636 | |
| 637 | TEST_BRACES(smallpartinit, smallpartinit); |
| 638 | // CHECK-LABEL: @test_smallpartinit_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 639 | // CHECK: %braces = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 640 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %braces, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 641 | // CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 642 | // CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %braces, i32 0, i32 1 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 643 | // CHECK-NEXT: store i8 0, i8* %[[D]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 644 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 645 | |
| 646 | TEST_CUSTOM(smallpartinit, smallpartinit, { 100, 42 }); |
| 647 | // CHECK-LABEL: @test_smallpartinit_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 648 | // CHECK: %custom = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 649 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %custom, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 650 | // CHECK-NEXT: store i8 100, i8* %[[C]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 651 | // CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds %struct.smallpartinit, %struct.smallpartinit* %custom, i32 0, i32 1 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 652 | // CHECK-NEXT: store i8 42, i8* %[[D]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 653 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 654 | |
| 655 | TEST_UNINIT(nullinit, nullinit); |
| 656 | // CHECK-LABEL: @test_nullinit_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 657 | // CHECK: %uninit = alloca %struct.nullinit, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 663 | // CHECK: %braces = alloca %struct.nullinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 664 | // CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, %struct.nullinit* %braces, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 665 | // CHECK-NEXT: store i8* null, i8** %[[N]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 666 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 667 | |
| 668 | TEST_CUSTOM(nullinit, nullinit, { (char*)"derp" }); |
| 669 | // CHECK-LABEL: @test_nullinit_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 670 | // CHECK: %custom = alloca %struct.nullinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 671 | // CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds %struct.nullinit, %struct.nullinit* %custom, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 672 | // CHECK-NEXT: store i8* getelementptr inbounds {{.*}}, i8** %[[N]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 673 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 674 | |
| 675 | TEST_UNINIT(padded, padded); |
| 676 | // CHECK-LABEL: @test_padded_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 677 | // CHECK: %uninit = alloca %struct.padded, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 678 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 679 | // PATTERN-LABEL: @test_padded_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 680 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_padded_uninit.uninit |
| 681 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 682 | // ZERO-LABEL: @test_padded_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 683 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 684 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 685 | |
| 686 | TEST_BRACES(padded, padded); |
| 687 | // CHECK-LABEL: @test_padded_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 688 | // CHECK: %braces = alloca %struct.padded, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 689 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 690 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 691 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 692 | |
| 693 | TEST_CUSTOM(padded, padded, { 42, 13371337 }); |
| 694 | // CHECK-LABEL: @test_padded_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 695 | // CHECK: %custom = alloca %struct.padded, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 702 | // CHECK: %uninit = alloca %struct.paddednullinit, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 703 | // CHECK-NEXT: call void @{{.*}}paddednullinit{{.*}}%uninit) |
| 704 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 705 | // PATTERN-LABEL: @test_paddednullinit_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 706 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit |
| 707 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 708 | // ZERO-LABEL: @test_paddednullinit_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 709 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 710 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 711 | |
| 712 | TEST_BRACES(paddednullinit, paddednullinit); |
| 713 | // CHECK-LABEL: @test_paddednullinit_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 714 | // CHECK: %braces = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 715 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %braces, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 716 | // CHECK-NEXT: store i8 0, i8* %[[C]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 717 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %braces, i32 0, i32 1 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 718 | // CHECK-NEXT: store i32 0, i32* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 719 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 720 | |
| 721 | TEST_CUSTOM(paddednullinit, paddednullinit, { 42, 13371337 }); |
| 722 | // CHECK-LABEL: @test_paddednullinit_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 723 | // CHECK: %custom = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 724 | // CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %custom, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 725 | // CHECK-NEXT: store i8 42, i8* %[[C]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 726 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.paddednullinit, %struct.paddednullinit* %custom, i32 0, i32 1 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 727 | // CHECK-NEXT: store i32 13371337, i32* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 728 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 729 | |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 | |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 755 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpacked_custom.custom |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 780 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackedarray_custom.custom |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 781 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 782 | |
| Peter Collingbourne | 68b4673 | 2019-03-16 19:25:39 +0000 | [diff] [blame] | 783 | TEST_UNINIT(unpackedinpacked, unpackedinpacked); |
| 784 | // CHECK-LABEL: @test_unpackedinpacked_uninit() |
| 785 | // PATTERN-O0: call void @llvm.memcpy{{.*}}, i64 9, i1 false) |
| 786 | |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 809 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddednested_custom.custom |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 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 |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 834 | // CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackednested_custom.custom |
| Alexander Potapenko | 4f7bc0e | 2019-02-26 10:46:21 +0000 | [diff] [blame] | 835 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 836 | |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 837 | TEST_UNINIT(bitfield, bitfield); |
| 838 | // CHECK-LABEL: @test_bitfield_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 839 | // CHECK: %uninit = alloca %struct.bitfield, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 840 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 841 | // PATTERN-LABEL: @test_bitfield_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 842 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfield_uninit.uninit |
| 843 | // PATTERN-O1: store i32 -1431655766, i32* %uninit, align 4 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 844 | // ZERO-LABEL: @test_bitfield_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 845 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 846 | // ZERO-O1: store i32 0, i32* %uninit, align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 847 | |
| 848 | TEST_BRACES(bitfield, bitfield); |
| 849 | // CHECK-LABEL: @test_bitfield_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 850 | // CHECK: %braces = alloca %struct.bitfield, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 857 | // CHECK: %custom = alloca %struct.bitfield, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 864 | // CHECK: %uninit = alloca %struct.bitfieldaligned, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 865 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 866 | // PATTERN-LABEL: @test_bitfieldaligned_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 867 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfieldaligned_uninit.uninit |
| 868 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 869 | // ZERO-LABEL: @test_bitfieldaligned_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 870 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 871 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 872 | |
| 873 | TEST_BRACES(bitfieldaligned, bitfieldaligned); |
| 874 | // CHECK-LABEL: @test_bitfieldaligned_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 875 | // CHECK: %braces = alloca %struct.bitfieldaligned, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 882 | // CHECK: %custom = alloca %struct.bitfieldaligned, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 889 | // CHECK: %uninit = alloca %struct.big, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 890 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 895 | |
| 896 | TEST_BRACES(big, big); |
| 897 | // CHECK-LABEL: @test_big_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 898 | // CHECK: %braces = alloca %struct.big, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 899 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 900 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 104, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 905 | // CHECK: %custom = alloca %struct.big, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 906 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 907 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 -86, i64 104, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 908 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 909 | |
| 910 | TEST_UNINIT(arraytail, arraytail); |
| 911 | // CHECK-LABEL: @test_arraytail_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 912 | // CHECK: %uninit = alloca %struct.arraytail, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 913 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 914 | // PATTERN-LABEL: @test_arraytail_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 915 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_arraytail_uninit.uninit |
| 916 | // PATTERN-O1: store i32 -1431655766, {{.*}} align 4 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 917 | // ZERO-LABEL: @test_arraytail_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 918 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 919 | // ZERO-O1: store i32 0, {{.*}} align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 920 | |
| 921 | TEST_BRACES(arraytail, arraytail); |
| 922 | // CHECK-LABEL: @test_arraytail_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 923 | // CHECK: %braces = alloca %struct.arraytail, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 924 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 925 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 926 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 927 | |
| 928 | TEST_CUSTOM(arraytail, arraytail, { 0xdead }); |
| 929 | // CHECK-LABEL: @test_arraytail_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 930 | // CHECK: %custom = alloca %struct.arraytail, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 938 | // CHECK: %uninit = alloca [0 x i32], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 939 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 940 | // PATTERN-LABEL: @test_int0_uninit() |
| 941 | // PATTERN: %uninit = alloca [0 x i32], align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 942 | // PATTERN-O0-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 943 | // ZERO-LABEL: @test_int0_uninit() |
| 944 | // ZERO: %uninit = alloca [0 x i32], align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 945 | // ZERO-O0-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 946 | |
| 947 | TEST_BRACES(int0, int[0]); |
| 948 | // CHECK-LABEL: @test_int0_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 949 | // CHECK: %braces = alloca [0 x i32], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 950 | // CHECK-NEXT: bitcast |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 951 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 952 | |
| 953 | TEST_UNINIT(int1, int[1]); |
| 954 | // CHECK-LABEL: @test_int1_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 955 | // CHECK: %uninit = alloca [1 x i32], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 956 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 957 | // PATTERN-LABEL: @test_int1_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 958 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_int1_uninit.uninit |
| 959 | // PATTERN-O1: store i32 -1431655766, {{.*}} align 4 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 960 | // ZERO-LABEL: @test_int1_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 961 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 962 | // ZERO-O1: store i32 0, {{.*}} align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 963 | |
| 964 | TEST_BRACES(int1, int[1]); |
| 965 | // CHECK-LABEL: @test_int1_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 966 | // CHECK: %braces = alloca [1 x i32], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 967 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 968 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 969 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 970 | |
| 971 | TEST_CUSTOM(int1, int[1], { 0x33333333 }); |
| 972 | // CHECK-LABEL: @test_int1_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 973 | // CHECK: %custom = alloca [1 x i32], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 980 | // CHECK: %uninit = alloca [64 x i32], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 981 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 986 | |
| 987 | TEST_BRACES(int64, int[64]); |
| 988 | // CHECK-LABEL: @test_int64_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 989 | // CHECK: %braces = alloca [64 x i32], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 990 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 991 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 256, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 996 | // CHECK: %custom = alloca [64 x i32], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 997 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 998 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 17, i64 256, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 999 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1000 | |
| 1001 | TEST_UNINIT(bool4, bool[4]); |
| 1002 | // CHECK-LABEL: @test_bool4_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1003 | // CHECK: %uninit = alloca [4 x i8], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1004 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1005 | // PATTERN-LABEL: @test_bool4_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1006 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bool4_uninit.uninit |
| 1007 | // PATTERN-O1: store i32 -1431655766, i32* %uninit, align 4 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1008 | // ZERO-LABEL: @test_bool4_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1009 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1010 | // ZERO-O1: store i32 0, i32* %uninit, align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1011 | |
| 1012 | TEST_BRACES(bool4, bool[4]); |
| 1013 | // CHECK-LABEL: @test_bool4_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1014 | // CHECK: %braces = alloca [4 x i8], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1015 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1016 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1017 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1018 | |
| 1019 | TEST_CUSTOM(bool4, bool[4], { true, true, true, true }); |
| 1020 | // CHECK-LABEL: @test_bool4_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1021 | // CHECK: %custom = alloca [4 x i8], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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]); |
| JF Bastien | b5e5bc7 | 2019-03-08 01:26:49 +0000 | [diff] [blame] | 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, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1041 | |
| 1042 | TEST_BRACES(intptr4, int*[4]); |
| 1043 | // CHECK-LABEL: @test_intptr4_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1044 | // CHECK: %braces = alloca [4 x i32*], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1045 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1046 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 32, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1051 | // CHECK: %custom = alloca [4 x i32*], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1058 | // CHECK: %uninit = alloca [4 x %struct.tailpad], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1059 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1060 | // PATTERN-LABEL: @test_tailpad4_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1064 | // ZERO-LABEL: @test_tailpad4_uninit() |
| 1065 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1066 | |
| 1067 | TEST_BRACES(tailpad4, tailpad[4]); |
| 1068 | // CHECK-LABEL: @test_tailpad4_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1069 | // CHECK: %braces = alloca [4 x %struct.tailpad], align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1070 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1071 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1072 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1073 | |
| JF Bastien | fe2ea82 | 2018-08-08 17:05:17 +0000 | [diff] [blame] | 1074 | TEST_CUSTOM(tailpad4, tailpad[4], { {257, 1}, {257, 1}, {257, 1}, {257, 1} }); |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1075 | // CHECK-LABEL: @test_tailpad4_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1076 | // CHECK: %custom = alloca [4 x %struct.tailpad], align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1077 | // CHECK-NEXT: bitcast |
| 1078 | // CHECK-NEXT: call void @llvm.memcpy |
| 1079 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1080 | |
| JF Bastien | fe2ea82 | 2018-08-08 17:05:17 +0000 | [diff] [blame] | 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) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1085 | // PATTERN-LABEL: @test_tailpad9_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1086 | // PATTERN-O0: call void @llvm.memset{{.*}}, i8 -86, |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1087 | // ZERO-LABEL: @test_tailpad9_uninit() |
| 1088 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
| JF Bastien | fe2ea82 | 2018-08-08 17:05:17 +0000 | [diff] [blame] | 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 | |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1104 | |
| 1105 | TEST_UNINIT(atomicbool, _Atomic(bool)); |
| 1106 | // CHECK-LABEL: @test_atomicbool_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1107 | // CHECK: %uninit = alloca i8, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1108 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1113 | |
| 1114 | TEST_UNINIT(atomicint, _Atomic(int)); |
| 1115 | // CHECK-LABEL: @test_atomicint_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1116 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1117 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1122 | |
| 1123 | TEST_UNINIT(atomicdouble, _Atomic(double)); |
| 1124 | // CHECK-LABEL: @test_atomicdouble_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1125 | // CHECK: %uninit = alloca double, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1126 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1131 | |
| 1132 | TEST_UNINIT(atomicnotlockfree, _Atomic(notlockfree)); |
| 1133 | // CHECK-LABEL: @test_atomicnotlockfree_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1134 | // CHECK: %uninit = alloca %struct.notlockfree, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1135 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1136 | // PATTERN-LABEL: @test_atomicnotlockfree_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1137 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicnotlockfree_uninit.uninit |
| 1138 | // PATTERN-O1: bitcast |
| JF Bastien | b5e5bc7 | 2019-03-08 01:26:49 +0000 | [diff] [blame] | 1139 | // PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 -86, i64 32 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1140 | // ZERO-LABEL: @test_atomicnotlockfree_uninit() |
| 1141 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1142 | |
| 1143 | TEST_UNINIT(atomicpadded, _Atomic(padded)); |
| 1144 | // CHECK-LABEL: @test_atomicpadded_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1145 | // CHECK: %uninit = alloca %struct.padded, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1146 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1147 | // PATTERN-LABEL: @test_atomicpadded_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1148 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicpadded_uninit.uninit |
| 1149 | // PATTERN-O1: store i64 -6148914691236517206, i64* %uninit, align 8 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1150 | // ZERO-LABEL: @test_atomicpadded_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1151 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1152 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1153 | |
| 1154 | TEST_UNINIT(atomictailpad, _Atomic(tailpad)); |
| 1155 | // CHECK-LABEL: @test_atomictailpad_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1156 | // CHECK: %uninit = alloca %struct.tailpad, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1157 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1158 | // PATTERN-LABEL: @test_atomictailpad_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1159 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomictailpad_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1160 | // ZERO-LABEL: @test_atomictailpad_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1161 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1162 | // ZERO-O1: store i32 0, i32* %uninit, align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1163 | |
| 1164 | TEST_UNINIT(complexfloat, _Complex float); |
| 1165 | // CHECK-LABEL: @test_complexfloat_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1166 | // CHECK: %uninit = alloca { float, float }, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1167 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1168 | // PATTERN-LABEL: @test_complexfloat_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 | |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1175 | // ZERO-LABEL: @test_complexfloat_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1176 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1177 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1178 | |
| 1179 | TEST_BRACES(complexfloat, _Complex float); |
| 1180 | // CHECK-LABEL: @test_complexfloat_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1181 | // CHECK: %braces = alloca { float, float }, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1184 | // CHECK-NEXT: store float 0.000000e+00, float* %[[R]], align [[ALIGN]] |
| 1185 | // CHECK-NEXT: store float 0.000000e+00, float* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1186 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1187 | |
| 1188 | TEST_CUSTOM(complexfloat, _Complex float, { 3.1415926535897932384626433, 3.1415926535897932384626433 }); |
| 1189 | // CHECK-LABEL: @test_complexfloat_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1190 | // CHECK: %custom = alloca { float, float }, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1193 | // CHECK-NEXT: store float 0x400921FB60000000, float* %[[R]], align [[ALIGN]] |
| 1194 | // CHECK-NEXT: store float 0x400921FB60000000, float* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1195 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1196 | |
| 1197 | TEST_UNINIT(complexdouble, _Complex double); |
| 1198 | // CHECK-LABEL: @test_complexdouble_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1199 | // CHECK: %uninit = alloca { double, double }, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1200 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1201 | // PATTERN-LABEL: @test_complexdouble_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1202 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexdouble_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1203 | // ZERO-LABEL: @test_complexdouble_uninit() |
| 1204 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1205 | |
| 1206 | TEST_BRACES(complexdouble, _Complex double); |
| 1207 | // CHECK-LABEL: @test_complexdouble_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1208 | // CHECK: %braces = alloca { double, double }, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1211 | // CHECK-NEXT: store double 0.000000e+00, double* %[[R]], align [[ALIGN]] |
| 1212 | // CHECK-NEXT: store double 0.000000e+00, double* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1213 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1214 | |
| 1215 | TEST_CUSTOM(complexdouble, _Complex double, { 3.1415926535897932384626433, 3.1415926535897932384626433 }); |
| 1216 | // CHECK-LABEL: @test_complexdouble_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1217 | // CHECK: %custom = alloca { double, double }, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1220 | // CHECK-NEXT: store double 0x400921FB54442D18, double* %[[R]], align [[ALIGN]] |
| 1221 | // CHECK-NEXT: store double 0x400921FB54442D18, double* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1222 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1223 | |
| 1224 | |
| 1225 | TEST_UNINIT(volatileint, volatile int); |
| 1226 | // CHECK-LABEL: @test_volatileint_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1227 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1228 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1233 | |
| 1234 | TEST_BRACES(volatileint, volatile int); |
| 1235 | // CHECK-LABEL: @test_volatileint_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1236 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
| 1237 | // CHECK-NEXT: store volatile i32 0, i32* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1238 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1239 | |
| 1240 | TEST_UNINIT(semivolatile, semivolatile); |
| 1241 | // CHECK-LABEL: @test_semivolatile_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1242 | // CHECK: %uninit = alloca %struct.semivolatile, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1243 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1244 | // PATTERN-LABEL: @test_semivolatile_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1245 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_semivolatile_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1246 | // ZERO-LABEL: @test_semivolatile_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1247 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1248 | // ZERO-O1: store i64 0, i64* %uninit, align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1249 | |
| 1250 | TEST_BRACES(semivolatile, semivolatile); |
| 1251 | // CHECK-LABEL: @test_semivolatile_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1252 | // CHECK: %braces = alloca %struct.semivolatile, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1253 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1254 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1255 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1256 | |
| 1257 | TEST_CUSTOM(semivolatile, semivolatile, { 0x44444444, 0x44444444 }); |
| 1258 | // CHECK-LABEL: @test_semivolatile_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1259 | // CHECK: %custom = alloca %struct.semivolatile, align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1264 | |
| 1265 | TEST_UNINIT(semivolatileinit, semivolatileinit); |
| 1266 | // CHECK-LABEL: @test_semivolatileinit_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1267 | // CHECK: %uninit = alloca %struct.semivolatileinit, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1273 | // CHECK: %braces = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1274 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %braces, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1275 | // CHECK-NEXT: store i32 286331153, i32* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1276 | // CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %braces, i32 0, i32 1 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1277 | // CHECK-NEXT: store volatile i32 286331153, i32* %[[VI]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1278 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1279 | |
| 1280 | TEST_CUSTOM(semivolatileinit, semivolatileinit, { 0x44444444, 0x44444444 }); |
| 1281 | // CHECK-LABEL: @test_semivolatileinit_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1282 | // CHECK: %custom = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1283 | // CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %custom, i32 0, i32 0 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1284 | // CHECK-NEXT: store i32 1145324612, i32* %[[I]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1285 | // CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds %struct.semivolatileinit, %struct.semivolatileinit* %custom, i32 0, i32 1 |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1286 | // CHECK-NEXT: store volatile i32 1145324612, i32* %[[VI]], align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1287 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1288 | |
| 1289 | |
| 1290 | TEST_UNINIT(base, base); |
| 1291 | // CHECK-LABEL: @test_base_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1292 | // CHECK: %uninit = alloca %struct.base, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1293 | // CHECK-NEXT: call void @{{.*}}base{{.*}}%uninit) |
| 1294 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1295 | // PATTERN-LABEL: @test_base_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1296 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_base_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1297 | // ZERO-LABEL: @test_base_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1298 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1299 | // ZERO-O1: store i64 0, {{.*}} align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1300 | |
| 1301 | TEST_BRACES(base, base); |
| 1302 | // CHECK-LABEL: @test_base_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1303 | // CHECK: %braces = alloca %struct.base, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1304 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1305 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1311 | // CHECK: %uninit = alloca %struct.derived, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1312 | // CHECK-NEXT: call void @{{.*}}derived{{.*}}%uninit) |
| 1313 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1314 | // PATTERN-LABEL: @test_derived_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1315 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_derived_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1316 | // ZERO-LABEL: @test_derived_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1317 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1318 | // ZERO-O1: store i64 0, {{.*}} align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1319 | |
| 1320 | TEST_BRACES(derived, derived); |
| 1321 | // CHECK-LABEL: @test_derived_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1322 | // CHECK: %braces = alloca %struct.derived, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1323 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1324 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1330 | // CHECK: %uninit = alloca %struct.virtualderived, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1331 | // CHECK-NEXT: call void @{{.*}}virtualderived{{.*}}%uninit) |
| 1332 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1333 | // PATTERN-LABEL: @test_virtualderived_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1334 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_virtualderived_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1335 | // ZERO-LABEL: @test_virtualderived_uninit() |
| 1336 | // ZERO: call void @llvm.memset{{.*}}, i8 0, |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1337 | |
| 1338 | TEST_BRACES(virtualderived, virtualderived); |
| 1339 | // CHECK-LABEL: @test_virtualderived_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1340 | // CHECK: %braces = alloca %struct.virtualderived, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1341 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1342 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1349 | // CHECK: %uninit = alloca %union.matching, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1350 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1351 | // PATTERN-LABEL: @test_matching_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1352 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matching_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1353 | // ZERO-LABEL: @test_matching_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1354 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1355 | // ZERO-O1: store i32 0, {{.*}} align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1356 | |
| 1357 | TEST_BRACES(matching, matching); |
| 1358 | // CHECK-LABEL: @test_matching_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1359 | // CHECK: %braces = alloca %union.matching, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1360 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1361 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1362 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1363 | |
| 1364 | TEST_CUSTOM(matching, matching, { .f = 0xf00f }); |
| 1365 | // CHECK-LABEL: @test_matching_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1366 | // CHECK: %custom = alloca %union.matching, align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1372 | |
| 1373 | TEST_UNINIT(matchingreverse, matchingreverse); |
| 1374 | // CHECK-LABEL: @test_matchingreverse_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1375 | // CHECK: %uninit = alloca %union.matchingreverse, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1376 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1377 | // PATTERN-LABEL: @test_matchingreverse_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1378 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matchingreverse_uninit.uninit |
| 1379 | // PATTERN-O1: store float 0xFFFFFFFFE0000000 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1380 | // ZERO-LABEL: @test_matchingreverse_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1381 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1382 | // ZERO-O1: store i32 0, {{.*}} align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1383 | |
| 1384 | TEST_BRACES(matchingreverse, matchingreverse); |
| 1385 | // CHECK-LABEL: @test_matchingreverse_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1386 | // CHECK: %braces = alloca %union.matchingreverse, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1387 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1388 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1389 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1390 | |
| 1391 | TEST_CUSTOM(matchingreverse, matchingreverse, { .i = 0xf00f }); |
| 1392 | // CHECK-LABEL: @test_matchingreverse_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1393 | // CHECK: %custom = alloca %union.matchingreverse, align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1398 | |
| 1399 | TEST_UNINIT(unmatched, unmatched); |
| 1400 | // CHECK-LABEL: @test_unmatched_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1401 | // CHECK: %uninit = alloca %union.unmatched, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1402 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1403 | // PATTERN-LABEL: @test_unmatched_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1404 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatched_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1405 | // ZERO-LABEL: @test_unmatched_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1406 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1407 | // ZERO-O1: store i32 0, {{.*}} align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1408 | |
| 1409 | TEST_BRACES(unmatched, unmatched); |
| 1410 | // CHECK-LABEL: @test_unmatched_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1411 | // CHECK: %braces = alloca %union.unmatched, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1418 | // CHECK: %custom = alloca %union.unmatched, align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1423 | |
| 1424 | TEST_UNINIT(unmatchedreverse, unmatchedreverse); |
| 1425 | // CHECK-LABEL: @test_unmatchedreverse_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1426 | // CHECK: %uninit = alloca %union.unmatchedreverse, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1427 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1428 | // PATTERN-LABEL: @test_unmatchedreverse_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1429 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedreverse_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1430 | // ZERO-LABEL: @test_unmatchedreverse_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1431 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1432 | // ZERO-O1: store i32 0, {{.*}} align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1433 | |
| 1434 | TEST_BRACES(unmatchedreverse, unmatchedreverse); |
| 1435 | // CHECK-LABEL: @test_unmatchedreverse_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1436 | // CHECK: %braces = alloca %union.unmatchedreverse, align [[ALIGN:[0-9]*]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1437 | // CHECK-NEXT: bitcast |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1438 | // CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false) |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1439 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1440 | |
| 1441 | TEST_CUSTOM(unmatchedreverse, unmatchedreverse, { .c = 42 }); |
| 1442 | // CHECK-LABEL: @test_unmatchedreverse_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1443 | // CHECK: %custom = alloca %union.unmatchedreverse, align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1449 | |
| 1450 | TEST_UNINIT(unmatchedfp, unmatchedfp); |
| 1451 | // CHECK-LABEL: @test_unmatchedfp_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1452 | // CHECK: %uninit = alloca %union.unmatchedfp, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1453 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1454 | // PATTERN-LABEL: @test_unmatchedfp_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1455 | // PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedfp_uninit.uninit |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1456 | // ZERO-LABEL: @test_unmatchedfp_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1457 | // ZERO-O0: call void @llvm.memset{{.*}}, i8 0, |
| 1458 | // ZERO-O1: store i64 0, {{.*}} align 8 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1459 | |
| 1460 | TEST_BRACES(unmatchedfp, unmatchedfp); |
| 1461 | // CHECK-LABEL: @test_unmatchedfp_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1462 | // CHECK: %braces = alloca %union.unmatchedfp, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1469 | // CHECK: %custom = alloca %union.unmatchedfp, align |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1474 | |
| 1475 | TEST_UNINIT(emptyenum, emptyenum); |
| 1476 | // CHECK-LABEL: @test_emptyenum_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1477 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1478 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1479 | // PATTERN-LABEL: @test_emptyenum_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1480 | // PATTERN: store i32 -1431655766, i32* %uninit, align 4 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1481 | // ZERO-LABEL: @test_emptyenum_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1482 | // ZERO: store i32 0, i32* %uninit, align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1483 | |
| 1484 | TEST_BRACES(emptyenum, emptyenum); |
| 1485 | // CHECK-LABEL: @test_emptyenum_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1486 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
| 1487 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1488 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1489 | |
| 1490 | TEST_CUSTOM(emptyenum, emptyenum, { (emptyenum)42 }); |
| 1491 | // CHECK-LABEL: @test_emptyenum_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1492 | // CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]] |
| 1493 | // CHECK-NEXT: store i32 42, i32* %custom, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1494 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1495 | |
| 1496 | TEST_UNINIT(smallenum, smallenum); |
| 1497 | // CHECK-LABEL: @test_smallenum_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1498 | // CHECK: %uninit = alloca i32, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1499 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1500 | // PATTERN-LABEL: @test_smallenum_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1501 | // PATTERN: store i32 -1431655766, i32* %uninit, align 4 |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1502 | // ZERO-LABEL: @test_smallenum_uninit() |
| Alexander Potapenko | fa61ddd | 2019-03-01 09:00:41 +0000 | [diff] [blame] | 1503 | // ZERO: store i32 0, i32* %uninit, align 4 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1504 | |
| 1505 | TEST_BRACES(smallenum, smallenum); |
| 1506 | // CHECK-LABEL: @test_smallenum_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1507 | // CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]] |
| 1508 | // CHECK-NEXT: store i32 0, i32* %braces, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1509 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1510 | |
| 1511 | TEST_CUSTOM(smallenum, smallenum, { (smallenum)42 }); |
| 1512 | // CHECK-LABEL: @test_smallenum_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1513 | // CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]] |
| 1514 | // CHECK-NEXT: store i32 42, i32* %custom, align [[ALIGN]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1515 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1516 | |
| 1517 | |
| 1518 | TEST_UNINIT(intvec16, int __attribute__((vector_size(16)))); |
| 1519 | // CHECK-LABEL: @test_intvec16_uninit() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 1520 | // CHECK: %uninit = alloca <4 x i32>, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1521 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1526 | |
| 1527 | TEST_BRACES(intvec16, int __attribute__((vector_size(16)))); |
| 1528 | // CHECK-LABEL: @test_intvec16_braces() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1531 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%braces) |
| 1532 | |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 1533 | TEST_CUSTOM(intvec16, int __attribute__((vector_size(16))), { 0x44444444, 0x44444444, 0x44444444, 0x44444444 }); |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1534 | // CHECK-LABEL: @test_intvec16_custom() |
| JF Bastien | cc365c3 | 2018-08-07 22:43:44 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1537 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1538 | |
| 1539 | TEST_UNINIT(longlongvec32, long long __attribute__((vector_size(32)))); |
| 1540 | // CHECK-LABEL: @test_longlongvec32_uninit() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 1541 | // CHECK: %uninit = alloca <4 x i64>, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1542 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1547 | |
| 1548 | TEST_BRACES(longlongvec32, long long __attribute__((vector_size(32)))); |
| 1549 | // CHECK-LABEL: @test_longlongvec32_braces() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1558 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1559 | |
| 1560 | TEST_UNINIT(floatvec16, float __attribute__((vector_size(16)))); |
| 1561 | // CHECK-LABEL: @test_floatvec16_uninit() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 1562 | // CHECK: %uninit = alloca <4 x float>, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1563 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1568 | |
| 1569 | TEST_BRACES(floatvec16, float __attribute__((vector_size(16)))); |
| 1570 | // CHECK-LABEL: @test_floatvec16_braces() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1579 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1580 | |
| 1581 | TEST_UNINIT(doublevec32, double __attribute__((vector_size(32)))); |
| 1582 | // CHECK-LABEL: @test_doublevec32_uninit() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 1583 | // CHECK: %uninit = alloca <4 x double>, align |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1584 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit) |
| JF Bastien | 14daa20 | 2018-12-18 05:12:21 +0000 | [diff] [blame] | 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 |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1589 | |
| 1590 | TEST_BRACES(doublevec32, double __attribute__((vector_size(32)))); |
| 1591 | // CHECK-LABEL: @test_doublevec32_braces() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 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() |
| JF Bastien | 8137793 | 2018-08-07 04:44:13 +0000 | [diff] [blame] | 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]] |
| JF Bastien | c70f65e | 2018-08-07 03:12:52 +0000 | [diff] [blame] | 1600 | // CHECK-NEXT: call void @{{.*}}used{{.*}}%custom) |
| 1601 | |
| 1602 | |
| 1603 | } // extern "C" |