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