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