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