1695 lines · cpp
1// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,CHECK-O02// 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-O03// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=pattern %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=PATTERN,PATTERN-O14// 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-O05// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown -fblocks -ftrivial-auto-var-init=zero %s -O1 -emit-llvm -o - | FileCheck %s -check-prefixes=ZERO,ZERO-O16// 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-O07 8#pragma clang diagnostic ignored "-Winaccessible-base"9 10#ifdef __x86_64__11char inits[] = {"-86/-21846/-1431655766/i64/-6148914691236517206/-6148914691236517206/i128/-113427455640312821154458202477256070486/i64/-6148914691236517206/AA/"};12#else13char inits[] = {"-1/-1/-1/i32/-1/-1/i32/-1/i32/-1/FF/"};14#define __int128 int;15#endif16// PATTERN: @inits = {{.*}} c"[[I8:[^/]+]]/[[I16:[^/]+]]/[[I32:[^/]+]]/[[ILONGT:[^/]+]]/[[ILONG:[^/]+]]/[[I64:[^/]+]]/[[I128T:[^/]+]]/[[I128:[^/]+]]/[[IPTRT:[^/]+]]/[[IPTR:[^/]+]]/[[IC:[^/]+]]/\00", align 117 18template<typename T> void used(T &) noexcept;19 20#define TEST_UNINIT(NAME, TYPE) \21 using type_##NAME = TYPE; \22 void test_##NAME##_uninit() { \23 type_##NAME uninit; \24 used(uninit); \25 }26 27// Value initialization on scalars, aggregate initialization on aggregates.28#define TEST_BRACES(NAME, TYPE) \29 using type_##NAME = TYPE; \30 void test_##NAME##_braces() { \31 type_##NAME braces = {}; \32 used(braces); \33 }34 35#define TEST_CUSTOM(NAME, TYPE, ...) \36 using type_##NAME = TYPE; \37 void test_##NAME##_custom() { \38 type_##NAME custom __VA_ARGS__; \39 used(custom); \40 }41 42// None of the synthesized globals should contain `undef`.43// PATTERN-NOT: undef44// ZERO-NOT: undef45 46// PATTERN-O0: @__const.test_empty_uninit.uninit = private unnamed_addr constant %struct.empty { i8 [[I8]] }, align 147// PATTERN-O1-NOT: @__const.test_empty_uninit.uninit48struct empty {};49// PATTERN-O0: @__const.test_small_uninit.uninit = private unnamed_addr constant %struct.small { i8 [[I8]] }, align 150// PATTERN-O0: @__const.test_small_custom.custom = private unnamed_addr constant %struct.small { i8 42 }, align 151// ZERO-O0: @__const.test_small_custom.custom = private unnamed_addr constant %struct.small { i8 42 }, align 152// PATTERN-O1-NOT: @__const.test_small_uninit.uninit53// PATTERN-O1-NOT: @__const.test_small_custom.custom54// ZERO-O1-NOT: @__const.test_small_custom.custom55struct small { char c; };56// PATTERN-O0: @__const.test_smallinit_uninit.uninit = private unnamed_addr constant %struct.smallinit { i8 [[I8]] }, align 157// PATTERN-O0: @__const.test_smallinit_braces.braces = private unnamed_addr constant %struct.smallinit { i8 [[I8]] }, align 158// PATTERN-O0: @__const.test_smallinit_custom.custom = private unnamed_addr constant %struct.smallinit { i8 [[I8]] }, align 159// PATTERN-O1-NOT: @__const.test_smallinit_uninit.uninit60// PATTERN-O1-NOT: @__const.test_smallinit_braces.braces61// PATTERN-O1-NOT: @__const.test_smallinit_custom.custom62struct smallinit { char c = 42; };63// PATTERN-O0: @__const.test_smallpartinit_uninit.uninit = private unnamed_addr constant %struct.smallpartinit { i8 [[I8]], i8 [[I8]] }, align 164// PATTERN-O0: @__const.test_smallpartinit_braces.braces = private unnamed_addr constant %struct.smallpartinit { i8 [[I8]], i8 [[I8]] }, align 165// PATTERN-O0: @__const.test_smallpartinit_custom.custom = private unnamed_addr constant %struct.smallpartinit { i8 [[I8]], i8 [[I8]] }, align 166// PATTERN-O1-NOT: @__const.test_smallpartinit_uninit.uninit67// PATTERN-O1-NOT: @__const.test_smallpartinit_braces.braces68// PATTERN-O1-NOT: @__const.test_smallpartinit_custom.custom69struct smallpartinit { char c = 42, d; };70// PATTERN-O0: @__const.test_nullinit_uninit.uninit = private unnamed_addr constant %struct.nullinit { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align71// PATTERN-O0: @__const.test_nullinit_braces.braces = private unnamed_addr constant %struct.nullinit { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align72// PATTERN-O0: @__const.test_nullinit_custom.custom = private unnamed_addr constant %struct.nullinit { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align73// PATTERN-O1-NOT: @__const.test_nullinit_uninit.uninit74// PATTERN-O1-NOT: @__const.test_nullinit_braces.braces75// PATTERN-O1-NOT: @__const.test_nullinit_custom.custom76struct nullinit { char* null = nullptr; };77// 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 478// 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 479// 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 480// PATTERN-O1-NOT: @__const.test_padded_uninit.uninit81// PATTERN-O1-NOT: @__const.test_padded_custom.custom82// ZERO-O1-NOT: @__const.test_padded_custom.custom83struct padded { char c; int i; };84// 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 485// 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 486// 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 487// PATTERN-O1-NOT: @__const.test_paddednullinit_uninit.uninit88// PATTERN-O1-NOT: @__const.test_paddednullinit_braces.braces89// PATTERN-O1-NOT: @__const.test_paddednullinit_custom.custom90struct paddednullinit { char c = 0; int i = 0; };91// PATTERN-O0: @__const.test_paddedpacked_uninit.uninit = private unnamed_addr constant %struct.paddedpacked <{ i8 [[I8]], i32 [[I32]] }>, align 192struct paddedpacked { char c; int i; } __attribute__((packed));93// 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 194struct paddedpackedarray { struct paddedpacked p[2]; };95// 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 196struct unpackedinpacked { padded a; char b; } __attribute__((packed));97// 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 498struct paddednested { struct padded p1, p2; };99// 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 1100struct paddedpackednested { struct paddedpacked p1, p2; };101// PATTERN-O0: @__const.test_bitfield_uninit.uninit = private unnamed_addr constant %struct.bitfield { i8 [[I8]], [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]" }, align 4102// PATTERN-O0: @__const.test_bitfield_custom.custom = private unnamed_addr constant %struct.bitfield { i8 20, [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]" }, align 4103// ZERO-O0: @__const.test_bitfield_custom.custom = private unnamed_addr constant %struct.bitfield { i8 20, [3 x i8] zeroinitializer }, align 4104// PATTERN-O1-NOT: @__const.test_bitfield_uninit.uninit105// PATTERN-O1-NOT: @__const.test_bitfield_custom.custom106// ZERO-O1-NOT: @__const.test_bitfield_custom.custom107struct bitfield { int i : 4; int j : 2; };108// 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 4109// 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 4110// 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 4111// PATTERN-O1-NOT: @__const.test_bitfieldaligned_uninit.uninit112// PATTERN-O1-NOT: @__const.test_bitfieldaligned_custom.custom113// ZERO-O1-NOT: @__const.test_bitfieldaligned_custom.custom114struct bitfieldaligned { int i : 4; int : 0; int j : 2; };115struct 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; };116// PATTERN-O0: @__const.test_arraytail_uninit.uninit = private unnamed_addr constant %struct.arraytail { i32 [[I32]], [0 x i32] zeroinitializer }, align 4117// PATTERN-O0: @__const.test_arraytail_custom.custom = private unnamed_addr constant %struct.arraytail { i32 57005, [0 x i32] zeroinitializer }, align 4118// ZERO-O0: @__const.test_arraytail_custom.custom = private unnamed_addr constant %struct.arraytail { i32 57005, [0 x i32] zeroinitializer }, align 4119// PATTERN-O1-NOT: @__const.test_arraytail_uninit.uninit120// PATTERN-O1-NOT: @__const.test_arraytail_custom.custom121// ZERO-O1-NOT: @__const.test_arraytail_custom.custom122struct arraytail { int i; int arr[]; };123// PATTERN-O0: @__const.test_int1_uninit.uninit = private unnamed_addr constant [1 x i32] {{\[}}i32 [[I32]]], align 4124// PATTERN-O0: @__const.test_int1_custom.custom = private unnamed_addr constant [1 x i32] [i32 858993459], align 4125// ZERO-O0: @__const.test_int1_custom.custom = private unnamed_addr constant [1 x i32] [i32 858993459], align 4126// PATTERN-O1-NOT: @__const.test_int1_uninit.uninit127// PATTERN-O1-NOT: @__const.test_int1_custom.custom128// ZERO-O1-NOT: @__const.test_int1_custom.custom129 130// PATTERN-O0: @__const.test_bool4_uninit.uninit = private unnamed_addr constant [4 x i8] c"\[[IC]]\[[IC]]\[[IC]]\[[IC]]", align 1131// PATTERN-O0: @__const.test_bool4_custom.custom = private unnamed_addr constant [4 x i8] c"\01\01\01\01", align 1132// ZERO-O0: @__const.test_bool4_custom.custom = private unnamed_addr constant [4 x i8] c"\01\01\01\01", align 1133// PATTERN-O1-NOT: @__const.test_bool4_uninit.uninit134// PATTERN-O1-NOT: @__const.test_bool4_custom.custom135// ZERO-O1-NOT: @__const.test_bool4_custom.custom136 137// 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]]" }], align138// PATTERN-O1-NOT: @__const.test_tailpad4_uninit.uninit139struct tailpad { short s; char c; };140// PATTERN-O0: @__const.test_atomicnotlockfree_uninit.uninit = private unnamed_addr constant %struct.notlockfree { [4 x i64] {{\[}}i64 [[I64]], i64 [[I64]], i64 [[I64]], i64 [[I64]]] }, align141// PATTERN-O1-NOT: @__const.test_atomicnotlockfree_uninit.uninit142struct notlockfree { long long a[4]; };143// 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 8144// PATTERN-O1-NOT: @__const.test_atomicpadded_uninit.uninit145// 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 4146// PATTERN-O1-NOT: @__const.test_atomictailpad_uninit.uninit147// PATTERN-O0: @__const.test_complexfloat_uninit.uninit = private unnamed_addr constant { float, float } { float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000 }, align 4148// PATTERN-O1-NOT: @__const.test_complexfloat_uninit.uninit149// PATTERN-O0: @__const.test_complexdouble_uninit.uninit = private unnamed_addr constant { double, double } { double 0xFFFFFFFFFFFFFFFF, double 0xFFFFFFFFFFFFFFFF }, align 8150// PATTERN-O1-NOT: @__const.test_complexdouble_uninit.uninit151// PATTERN-O0: @__const.test_semivolatile_uninit.uninit = private unnamed_addr constant %struct.semivolatile { i32 [[I32]], i32 [[I32]] }, align 4152// PATTERN-O0: @__const.test_semivolatile_custom.custom = private unnamed_addr constant %struct.semivolatile { i32 1145324612, i32 1145324612 }, align 4153// PATTERN-O1-NOT: @__const.test_semivolatile_custom.custom154struct semivolatile { int i; volatile int vi; };155// PATTERN-O0: @__const.test_semivolatileinit_uninit.uninit = private unnamed_addr constant %struct.semivolatileinit { i32 [[I32]], i32 [[I32]] }, align 4156// PATTERN-O1-NOT: @__const.test_semivolatileinit_uninit.uninit157// PATTERN-O0: @__const.test_semivolatileinit_braces.braces = private unnamed_addr constant %struct.semivolatileinit { i32 [[I32]], i32 [[I32]] }, align 4158// PATTERN-O1-NOT: @__const.test_semivolatileinit_braces.braces159// PATTERN-O0: @__const.test_semivolatileinit_custom.custom = private unnamed_addr constant %struct.semivolatileinit { i32 [[I32]], i32 [[I32]] }, align 4160// PATTERN-O1-NOT: @__const.test_semivolatileinit_custom.custom = private unnamed_addr constant %struct.semivolatileinit { i32 [[I32]], i32 [[I32]] }, align 4161// ZERO-O0: @__const.test_semivolatile_custom.custom = private unnamed_addr constant %struct.semivolatile { i32 1145324612, i32 1145324612 }, align 4162// ZERO-O1-NOT: @__const.test_semivolatile_custom.custom163struct semivolatileinit { int i = 0x11111111; volatile int vi = 0x11111111; };164// PATTERN-O0: @__const.test_base_uninit.uninit = private unnamed_addr constant %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align165// PATTERN-O1-NOT: @__const.test_base_uninit.uninit166// PATTERN-O0: @__const.test_base_braces.braces = private unnamed_addr constant %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, align167// PATTERN-O1-NOT: @__const.test_base_braces.braces168struct base { virtual ~base(); };169// PATTERN-O0: @__const.test_derived_uninit.uninit = private unnamed_addr constant %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } }, align170// PATTERN-O1-NOT: @__const.test_derived_uninit.uninit171// PATTERN-O0: @__const.test_derived_braces.braces = private unnamed_addr constant %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } }, align172// PATTERN-O1-NOT: @__const.test_derived_braces.braces173struct derived : public base {};174// PATTERN-O0: @__const.test_virtualderived_uninit.uninit = private unnamed_addr constant %struct.virtualderived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } } }, align175// PATTERN-O1-NOT: @__const.test_virtualderived_uninit.uninit176// PATTERN-O0: @__const.test_virtualderived_braces.braces = private unnamed_addr constant %struct.virtualderived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) }, %struct.derived { %struct.base { ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr) } } }, align177// PATTERN-O1-NOT: @__const.test_virtualderived_braces.braces178struct virtualderived : public virtual base, public virtual derived {};179// PATTERN-O0: @__const.test_matching_uninit.uninit = private unnamed_addr constant %union.matching { i32 [[I32]] }, align 4180// PATTERN-O1-NOT: @__const.test_matching_uninit.uninit181// PATTERN-O0: @__const.test_matching_custom.custom = private unnamed_addr constant { float } { float 6.145500e+04 }, align 4182// PATTERN-O1-NOT: @__const.test_matching_custom.custom183// ZERO-O0: @__const.test_matching_custom.custom = private unnamed_addr constant { float } { float 6.145500e+04 }, align 4184// ZERO-O1-NOT: @__const.test_matching_custom.custom185union matching { int i; float f; };186// PATTERN-O0: @__const.test_matchingreverse_uninit.uninit = private unnamed_addr constant %union.matchingreverse { float 0xFFFFFFFFE0000000 }, align 4187// PATTERN-O1-NOT: @__const.test_matchingreverse_uninit.uninit188// PATTERN-O0: @__const.test_matchingreverse_custom.custom = private unnamed_addr constant { i32 } { i32 61455 }, align 4189// PATTERN-O1-NOT: @__const.test_matchingreverse_custom.custom190// ZERO-O0: @__const.test_matchingreverse_custom.custom = private unnamed_addr constant { i32 } { i32 61455 }, align 4191// ZERO-O1-NOT: @__const.test_matchingreverse_custom.custom192union matchingreverse { float f; int i; };193// PATTERN-O0: @__const.test_unmatched_uninit.uninit = private unnamed_addr constant %union.unmatched { i32 [[I32]] }, align 4194// PATTERN-O1-NOT: @__const.test_unmatched_uninit.uninit195// PATTERN-O0: @__const.test_unmatched_custom.custom = private unnamed_addr constant %union.unmatched { i32 1001242351 }, align 4196// PATTERN-O1-NOT: @__const.test_unmatched_custom.custom197// ZERO-O0: @__const.test_unmatched_custom.custom = private unnamed_addr constant %union.unmatched { i32 1001242351 }, align 4198// ZERO-O1-NOT: @__const.test_unmatched_custom.custom199union unmatched { char c; int i; };200// PATTERN-O0: @__const.test_unmatchedreverse_uninit.uninit = private unnamed_addr constant %union.unmatchedreverse { i32 [[I32]] }, align 4201// PATTERN-O1-NOT: @__const.test_unmatchedreverse_uninit.uninit202// 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 4203// PATTERN-O1-NOT: @__const.test_unmatchedreverse_custom.custom204// ZERO-O0: @__const.test_unmatchedreverse_custom.custom = private unnamed_addr constant { i8, [3 x i8] } { i8 42, [3 x i8] zeroinitializer }, align 4205// ZERO-O1-NOT: @__const.test_unmatchedreverse_custom.custom206union unmatchedreverse { int i; char c; };207// PATTERN-O0: @__const.test_unmatchedfp_uninit.uninit = private unnamed_addr constant %union.unmatchedfp { double 0xFFFFFFFFFFFFFFFF }, align208// PATTERN-O1-NOT: @__const.test_unmatchedfp_uninit.uninit209// PATTERN-O0: @__const.test_unmatchedfp_custom.custom = private unnamed_addr constant %union.unmatchedfp { double 0x400921FB54442D18 }, align210// PATTERN-O1-NOT: @__const.test_unmatchedfp_custom.custom211// ZERO-O0: @__const.test_unmatchedfp_custom.custom = private unnamed_addr constant %union.unmatchedfp { double 0x400921FB54442D18 }, align 8212// ZERO-O1-NOT: @__const.test_unmatchedfp_custom.custom213union unmatchedfp { float f; double d; };214enum emptyenum {};215enum smallenum { VALUE };216 217extern "C" {218 219TEST_UNINIT(char, char);220// CHECK-LABEL: @test_char_uninit()221// CHECK: %uninit = alloca i8, align222// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)223// PATTERN-LABEL: @test_char_uninit()224// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT:!.+]]225// ZERO-LABEL: @test_char_uninit()226// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT:!.+]]227 228TEST_BRACES(char, char);229// CHECK-LABEL: @test_char_braces()230// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]231// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]232// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)233 234TEST_UNINIT(uchar, unsigned char);235// CHECK-LABEL: @test_uchar_uninit()236// CHECK: %uninit = alloca i8, align237// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)238// PATTERN-LABEL: @test_uchar_uninit()239// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]240// ZERO-LABEL: @test_uchar_uninit()241// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]242 243TEST_BRACES(uchar, unsigned char);244// CHECK-LABEL: @test_uchar_braces()245// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]246// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]247// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)248 249TEST_UNINIT(schar, signed char);250// CHECK-LABEL: @test_schar_uninit()251// CHECK: %uninit = alloca i8, align252// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)253// PATTERN-LABEL: @test_schar_uninit()254// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]255// ZERO-LABEL: @test_schar_uninit()256// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]257 258TEST_BRACES(schar, signed char);259// CHECK-LABEL: @test_schar_braces()260// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]261// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]262// CHECK-NOT: !annotation263// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)264 265TEST_UNINIT(wchar_t, wchar_t);266// CHECK-LABEL: @test_wchar_t_uninit()267// CHECK: %uninit = alloca i32, align268// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)269// PATTERN-LABEL: @test_wchar_t_uninit()270// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]271// ZERO-LABEL: @test_wchar_t_uninit()272// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]273 274TEST_BRACES(wchar_t, wchar_t);275// CHECK-LABEL: @test_wchar_t_braces()276// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]277// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]278// CHECK-NOT: !annotation279// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)280 281TEST_UNINIT(short, short);282// CHECK-LABEL: @test_short_uninit()283// CHECK: %uninit = alloca i16, align284// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)285// PATTERN-LABEL: @test_short_uninit()286// PATTERN: store i16 [[I16]], ptr %uninit, align 2, !annotation [[AUTO_INIT]]287// ZERO-LABEL: @test_short_uninit()288// ZERO: store i16 0, ptr %uninit, align 2, !annotation [[AUTO_INIT]]289 290TEST_BRACES(short, short);291// CHECK-LABEL: @test_short_braces()292// CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]]293// CHECK-NEXT: store i16 0, ptr %braces, align [[ALIGN]]294// CHECK-NOT: !annotation295// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)296 297TEST_UNINIT(ushort, unsigned short);298// CHECK-LABEL: @test_ushort_uninit()299// CHECK: %uninit = alloca i16, align300// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)301// PATTERN-LABEL: @test_ushort_uninit()302// PATTERN: store i16 [[I16]], ptr %uninit, align 2, !annotation [[AUTO_INIT]]303// ZERO-LABEL: @test_ushort_uninit()304// ZERO: store i16 0, ptr %uninit, align 2, !annotation [[AUTO_INIT]]305 306TEST_BRACES(ushort, unsigned short);307// CHECK-LABEL: @test_ushort_braces()308// CHECK: %braces = alloca i16, align [[ALIGN:[0-9]*]]309// CHECK-NEXT: store i16 0, ptr %braces, align [[ALIGN]]310//CHECK-NOT: !annotation311// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)312 313TEST_UNINIT(int, int);314// CHECK-LABEL: @test_int_uninit()315// CHECK: %uninit = alloca i32, align316// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)317// PATTERN-LABEL: @test_int_uninit()318// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]319// ZERO-LABEL: @test_int_uninit()320// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]321 322TEST_BRACES(int, int);323// CHECK-LABEL: @test_int_braces()324// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]325// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]326// CHECK-NOT: !annotation327// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)328 329TEST_UNINIT(unsigned, unsigned);330// CHECK-LABEL: @test_unsigned_uninit()331// CHECK: %uninit = alloca i32, align332// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)333// PATTERN-LABEL: @test_unsigned_uninit()334// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]335// ZERO-LABEL: @test_unsigned_uninit()336// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]337 338TEST_BRACES(unsigned, unsigned);339// CHECK-LABEL: @test_unsigned_braces()340// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]341// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]342// CHECK-NOT: !annotation343// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)344 345TEST_UNINIT(long, long);346// CHECK-LABEL: @test_long_uninit()347// CHECK: %uninit = alloca i64, align348// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)349// PATTERN-LABEL: @test_long_uninit()350// PATTERN: store [[ILONGT]] [[ILONG]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]351// ZERO-LABEL: @test_long_uninit()352// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]353 354TEST_BRACES(long, long);355// CHECK-LABEL: @test_long_braces()356// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]357// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]358// CHECK-NOT: !annotation359// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)360 361TEST_UNINIT(ulong, unsigned long);362// CHECK-LABEL: @test_ulong_uninit()363// CHECK: %uninit = alloca i64, align364// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)365// PATTERN-LABEL: @test_ulong_uninit()366// PATTERN: store [[ILONGT]] [[ILONG]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]367// ZERO-LABEL: @test_ulong_uninit()368// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]369 370TEST_BRACES(ulong, unsigned long);371// CHECK-LABEL: @test_ulong_braces()372// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]373// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]374// CHECK-NOT: !annotation375// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)376 377TEST_UNINIT(longlong, long long);378// CHECK-LABEL: @test_longlong_uninit()379// CHECK: %uninit = alloca i64, align380// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)381// PATTERN-LABEL: @test_longlong_uninit()382// PATTERN: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]383// ZERO-LABEL: @test_longlong_uninit()384// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]385 386TEST_BRACES(longlong, long long);387// CHECK-LABEL: @test_longlong_braces()388// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]389// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]390// CHECK-NOT: !annotation391// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)392 393TEST_UNINIT(ulonglong, unsigned long long);394// CHECK-LABEL: @test_ulonglong_uninit()395// CHECK: %uninit = alloca i64, align396// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)397// PATTERN-LABEL: @test_ulonglong_uninit()398// PATTERN: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]399// ZERO-LABEL: @test_ulonglong_uninit()400// ZERO: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]401 402TEST_BRACES(ulonglong, unsigned long long);403// CHECK-LABEL: @test_ulonglong_braces()404// CHECK: %braces = alloca i64, align [[ALIGN:[0-9]*]]405// CHECK-NEXT: store i64 0, ptr %braces, align [[ALIGN]]406// CHECK-NOT: !annotation407// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)408 409TEST_UNINIT(int128, __int128);410// CHECK-LABEL: @test_int128_uninit()411// CHECK: %uninit = alloca i128, align412// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)413// PATTERN-LABEL: @test_int128_uninit()414// PATTERN: store [[I128T]] [[I128]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]415// ZERO-LABEL: @test_int128_uninit()416// ZERO: store i128 0, ptr %uninit, align 16, !annotation [[AUTO_INIT]]417 418TEST_BRACES(int128, __int128);419// CHECK-LABEL: @test_int128_braces()420// CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]]421// CHECK-NEXT: store i128 0, ptr %braces, align [[ALIGN]]422// CHECK-NOT: !annotation423// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)424 425TEST_UNINIT(uint128, unsigned __int128);426// CHECK-LABEL: @test_uint128_uninit()427// CHECK: %uninit = alloca i128, align428// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)429// PATTERN-LABEL: @test_uint128_uninit()430// PATTERN: store [[I128T]] [[I128]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]431// ZERO-LABEL: @test_uint128_uninit()432// ZERO: store i128 0, ptr %uninit, align 16, !annotation [[AUTO_INIT]]433 434TEST_BRACES(uint128, unsigned __int128);435// CHECK-LABEL: @test_uint128_braces()436// CHECK: %braces = alloca i128, align [[ALIGN:[0-9]*]]437// CHECK-NEXT: store i128 0, ptr %braces, align [[ALIGN]]438// CHECK-NOT: !annotation439// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)440 441TEST_UNINIT(fp16, __fp16);442// CHECK-LABEL: @test_fp16_uninit()443// CHECK: %uninit = alloca half, align444// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)445// PATTERN-LABEL: @test_fp16_uninit()446// PATTERN: store half 0xHFFFF, ptr %uninit, align 2, !annotation [[AUTO_INIT]]447// ZERO-LABEL: @test_fp16_uninit()448// ZERO: store half 0xH0000, ptr %uninit, align 2, !annotation [[AUTO_INIT]]449 450TEST_BRACES(fp16, __fp16);451// CHECK-LABEL: @test_fp16_braces()452// CHECK: %braces = alloca half, align [[ALIGN:[0-9]*]]453// CHECK-NEXT: store half 0xH0000, ptr %braces, align [[ALIGN]]454// CHECK-NOT: !annotation455// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)456 457TEST_UNINIT(float, float);458// CHECK-LABEL: @test_float_uninit()459// CHECK: %uninit = alloca float, align460// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)461// PATTERN-LABEL: @test_float_uninit()462// PATTERN: store float 0xFFFFFFFFE0000000, ptr %uninit, align 4, !annotation [[AUTO_INIT]]463// ZERO-LABEL: @test_float_uninit()464// ZERO: store float 0.000000e+00, ptr %uninit, align 4, !annotation [[AUTO_INIT]]465 466TEST_BRACES(float, float);467// CHECK-LABEL: @test_float_braces()468// CHECK: %braces = alloca float, align [[ALIGN:[0-9]*]]469// CHECK-NEXT: store float 0.000000e+00, ptr %braces, align [[ALIGN]]470// CHECK-NOT: !annotation471// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)472 473TEST_UNINIT(double, double);474// CHECK-LABEL: @test_double_uninit()475// CHECK: %uninit = alloca double, align476// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)477// PATTERN-LABEL: @test_double_uninit()478// PATTERN: store double 0xFFFFFFFFFFFFFFFF, ptr %uninit, align 8, !annotation [[AUTO_INIT]]479// ZERO-LABEL: @test_double_uninit()480// ZERO: store double 0.000000e+00, ptr %uninit, align 8, !annotation [[AUTO_INIT]]481 482TEST_BRACES(double, double);483// CHECK-LABEL: @test_double_braces()484// CHECK: %braces = alloca double, align [[ALIGN:[0-9]*]]485// CHECK-NEXT: store double 0.000000e+00, ptr %braces, align [[ALIGN]]486// CHECK-NOT: !annotation487// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)488 489TEST_UNINIT(longdouble, long double);490// CHECK-LABEL: @test_longdouble_uninit()491// CHECK: %uninit = alloca x86_fp80, align492// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)493// PATTERN-LABEL: @test_longdouble_uninit()494// PATTERN: store x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]495// ZERO-LABEL: @test_longdouble_uninit()496// ZERO: store x86_fp80 0xK00000000000000000000, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]497 498TEST_BRACES(longdouble, long double);499// CHECK-LABEL: @test_longdouble_braces()500// CHECK: %braces = alloca x86_fp80, align [[ALIGN:[0-9]*]]501// CHECK-NEXT: store x86_fp80 0xK00000000000000000000, ptr %braces, align [[ALIGN]]502// CHECK-NOT: !annotation503// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)504 505TEST_UNINIT(intptr, int*);506// CHECK-LABEL: @test_intptr_uninit()507// CHECK: %uninit = alloca ptr, align508// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)509// PATTERN-LABEL: @test_intptr_uninit()510// PATTERN: store ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr), ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]511// ZERO-LABEL: @test_intptr_uninit()512// ZERO: store ptr null, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]513 514TEST_BRACES(intptr, int*);515// CHECK-LABEL: @test_intptr_braces()516// CHECK: %braces = alloca ptr, align [[ALIGN:[0-9]*]]517// CHECK-NEXT: store ptr null, ptr %braces, align [[ALIGN]]518// CHECK-NOT: !annotation519// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)520 521TEST_UNINIT(intptrptr, int**);522// CHECK-LABEL: @test_intptrptr_uninit()523// CHECK: %uninit = alloca ptr, align524// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)525// PATTERN-LABEL: @test_intptrptr_uninit()526// PATTERN: store ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr), ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]527// ZERO-LABEL: @test_intptrptr_uninit()528// ZERO: store ptr null, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]529 530TEST_BRACES(intptrptr, int**);531// CHECK-LABEL: @test_intptrptr_braces()532// CHECK: %braces = alloca ptr, align [[ALIGN:[0-9]*]]533// CHECK-NEXT: store ptr null, ptr %braces, align [[ALIGN]]534// CHECK-NOT: !annotation535// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)536 537TEST_UNINIT(function, void(*)());538// CHECK-LABEL: @test_function_uninit()539// CHECK: %uninit = alloca ptr, align540// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)541// PATTERN-LABEL: @test_function_uninit()542// PATTERN: store ptr inttoptr ([[IPTRT]] [[IPTR]] to ptr), ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]543// ZERO-LABEL: @test_function_uninit()544// ZERO: store ptr null, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]545 546TEST_BRACES(function, void(*)());547// CHECK-LABEL: @test_function_braces()548// CHECK: %braces = alloca ptr, align [[ALIGN:[0-9]*]]549// CHECK-NEXT: store ptr null, ptr %braces, align [[ALIGN]]550// CHECK-NOT: !annotation551// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)552 553TEST_UNINIT(bool, bool);554// CHECK-LABEL: @test_bool_uninit()555// CHECK: %uninit = alloca i8, align556// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)557// PATTERN-LABEL: @test_bool_uninit()558// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]559// ZERO-LABEL: @test_bool_uninit()560// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]561 562TEST_BRACES(bool, bool);563// CHECK-LABEL: @test_bool_braces()564// CHECK: %braces = alloca i8, align [[ALIGN:[0-9]*]]565// CHECK-NEXT: store i8 0, ptr %braces, align [[ALIGN]]566// CHECK-NOT: !annotation567// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)568 569TEST_UNINIT(empty, empty);570// CHECK-LABEL: @test_empty_uninit()571// CHECK: %uninit = alloca %struct.empty, align572// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)573// PATTERN-LABEL: @test_empty_uninit()574// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_empty_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]575// PATTERN-O1: store i8 [[I8]], {{.*}} align 1, !annotation [[AUTO_INIT]]576// ZERO-LABEL: @test_empty_uninit()577// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]578// ZERO-O1: store i8 0, {{.*}} align 1, !annotation [[AUTO_INIT]]579 580TEST_BRACES(empty, empty);581// CHECK-LABEL: @test_empty_braces()582// CHECK: %braces = alloca %struct.empty, align583// CHECK-NEXT: call void @llvm.memcpy584// CHECK-NOT: !annotation585// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)586 587TEST_UNINIT(small, small);588// CHECK-LABEL: @test_small_uninit()589// CHECK: %uninit = alloca %struct.small, align590// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)591// PATTERN-LABEL: @test_small_uninit()592// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_small_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]593// PATTERN-O1: store i8 [[I8]], {{.*}} align 1, !annotation [[AUTO_INIT]]594// ZERO-LABEL: @test_small_uninit()595// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]596// ZERO-O1: store i8 0, {{.*}} align 1, !annotation [[AUTO_INIT]]597 598TEST_BRACES(small, small);599// CHECK-LABEL: @test_small_braces()600// CHECK: %braces = alloca %struct.small, align [[ALIGN:[0-9]*]]601// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 1, i1 false)602// CHECK-NOT: !annotation603// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)604 605TEST_CUSTOM(small, small, { 42 });606// CHECK-LABEL: @test_small_custom()607// CHECK: %custom = alloca %struct.small, align608// CHECK-NEXT: call void @llvm.memcpy609// CHECK-NOT: !annotation610// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)611 612TEST_UNINIT(smallinit, smallinit);613// CHECK-LABEL: @test_smallinit_uninit()614// CHECK: %uninit = alloca %struct.smallinit, align615// CHECK-NEXT: call void @{{.*}}smallinit{{.*}}%uninit)616// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)617 618TEST_BRACES(smallinit, smallinit);619// CHECK-LABEL: @test_smallinit_braces()620// CHECK: %braces = alloca %struct.smallinit, align [[ALIGN:[0-9]*]]621// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds nuw %struct.smallinit, ptr %braces, i32 0, i32 0622// CHECK-NEXT: store i8 42, ptr %[[C]], align [[ALIGN]]623// CHECK-NOT: !annotation624// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)625 626TEST_CUSTOM(smallinit, smallinit, { 100 });627// CHECK-LABEL: @test_smallinit_custom()628// CHECK: %custom = alloca %struct.smallinit, align [[ALIGN:[0-9]*]]629// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds nuw %struct.smallinit, ptr %custom, i32 0, i32 0630// CHECK-NEXT: store i8 100, ptr %[[C]], align [[ALIGN]]631// CHECK-NOT: !annotation632// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)633 634TEST_UNINIT(smallpartinit, smallpartinit);635// CHECK-LABEL: @test_smallpartinit_uninit()636// CHECK: %uninit = alloca %struct.smallpartinit, align637// CHECK-NEXT: call void @{{.*}}smallpartinit{{.*}}%uninit)638// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)639// PATTERN-LABEL: @test_smallpartinit_uninit()640// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_smallpartinit_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]641// PATTERN-O1: store i8 [[I8]], {{.*}} align 1, !annotation [[AUTO_INIT]]642// PATTERN-O1: store i8 42, {{.*}} align 1643// ZERO-LABEL: @test_smallpartinit_uninit()644// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]645// ZERO-O1: store i16 0, ptr %uninit, align 2, !annotation [[AUTO_INIT]]646 647TEST_BRACES(smallpartinit, smallpartinit);648// CHECK-LABEL: @test_smallpartinit_braces()649// CHECK: %braces = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]]650// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds nuw %struct.smallpartinit, ptr %braces, i32 0, i32 0651// CHECK-NEXT: store i8 42, ptr %[[C]], align [[ALIGN]]652// CHECK-NOT: !annotation653// CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds nuw %struct.smallpartinit, ptr %braces, i32 0, i32 1654// CHECK-NEXT: store i8 0, ptr %[[D]], align [[ALIGN]]655// CHECK-NOT: !annotation656// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)657 658TEST_CUSTOM(smallpartinit, smallpartinit, { 100, 42 });659// CHECK-LABEL: @test_smallpartinit_custom()660// CHECK: %custom = alloca %struct.smallpartinit, align [[ALIGN:[0-9]*]]661// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds nuw %struct.smallpartinit, ptr %custom, i32 0, i32 0662// CHECK-NEXT: store i8 100, ptr %[[C]], align [[ALIGN]]663// CHECK-NOT: !annotation664// CHECK-NEXT: %[[D:[^ ]*]] = getelementptr inbounds nuw %struct.smallpartinit, ptr %custom, i32 0, i32 1665// CHECK-NEXT: store i8 42, ptr %[[D]], align [[ALIGN]]666// CHECK-NOT: !annotation667// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)668 669TEST_UNINIT(nullinit, nullinit);670// CHECK-LABEL: @test_nullinit_uninit()671// CHECK: %uninit = alloca %struct.nullinit, align672// CHECK-NEXT: call void @{{.*}}nullinit{{.*}}%uninit)673// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)674 675TEST_BRACES(nullinit, nullinit);676// CHECK-LABEL: @test_nullinit_braces()677// CHECK: %braces = alloca %struct.nullinit, align [[ALIGN:[0-9]*]]678// CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds nuw %struct.nullinit, ptr %braces, i32 0, i32 0679// CHECK-NEXT: store ptr null, ptr %[[N]], align [[ALIGN]]680// CHECK-NOT: !annotation681// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)682 683TEST_CUSTOM(nullinit, nullinit, { (char*)"derp" });684// CHECK-LABEL: @test_nullinit_custom()685// CHECK: %custom = alloca %struct.nullinit, align [[ALIGN:[0-9]*]]686// CHECK-NEXT: %[[N:[^ ]*]] = getelementptr inbounds nuw %struct.nullinit, ptr %custom, i32 0, i32 0687// CHECK-NEXT: store ptr {{.*}}, ptr %[[N]], align [[ALIGN]]688// CHECK-NOT: !annotation689// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)690 691TEST_UNINIT(padded, padded);692// CHECK-LABEL: @test_padded_uninit()693// CHECK: %uninit = alloca %struct.padded, align694// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)695// PATTERN-LABEL: @test_padded_uninit()696// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_padded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]697// PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8698// PATTERN-O1-NOT: !annotation699// ZERO-LABEL: @test_padded_uninit()700// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]701// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]702 703TEST_BRACES(padded, padded);704// CHECK-LABEL: @test_padded_braces()705// CHECK: %braces = alloca %struct.padded, align [[ALIGN:[0-9]*]]706// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)707// CHECK-NOT: !annotation708// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)709 710TEST_CUSTOM(padded, padded, { 42, 13371337 });711// CHECK-LABEL: @test_padded_custom()712// CHECK: %custom = alloca %struct.padded, align713// CHECK-NEXT: call void @llvm.memcpy714// CHECK-NOT: !annotation715// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)716 717TEST_UNINIT(paddednullinit, paddednullinit);718// CHECK-LABEL: @test_paddednullinit_uninit()719// CHECK: %uninit = alloca %struct.paddednullinit, align720// CHECK-NEXT: call void @{{.*}}paddednullinit{{.*}}%uninit)721// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)722// PATTERN-LABEL: @test_paddednullinit_uninit()723// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]724// PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8725// PATTERN-O1-NOT: !annotation726// ZERO-LABEL: @test_paddednullinit_uninit()727// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.*}}, !annotation [[AUTO_INIT]]728// ZERO-O1: store i64 0, ptr %uninit, align 8729// FIXME: !annotation dropped by optimizations730// ZERO-O1-NOT: !annotation731// ZERO: ret732 733 734TEST_BRACES(paddednullinit, paddednullinit);735// CHECK-LABEL: @test_paddednullinit_braces()736// CHECK: %braces = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]]737// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds nuw %struct.paddednullinit, ptr %braces, i32 0, i32 0738// CHECK-NEXT: store i8 0, ptr %[[C]], align [[ALIGN]]739// CHECK-NOT: !annotation740// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw %struct.paddednullinit, ptr %braces, i32 0, i32 1741// CHECK-NEXT: store i32 0, ptr %[[I]], align [[ALIGN]]742// CHECK-NOT: !annotation743// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)744 745TEST_CUSTOM(paddednullinit, paddednullinit, { 42, 13371337 });746// CHECK-LABEL: @test_paddednullinit_custom()747// CHECK: %custom = alloca %struct.paddednullinit, align [[ALIGN:[0-9]*]]748// CHECK-NEXT: %[[C:[^ ]*]] = getelementptr inbounds nuw %struct.paddednullinit, ptr %custom, i32 0, i32 0749// CHECK-NEXT: store i8 42, ptr %[[C]], align [[ALIGN]]750// CHECK-NOT: !annotation751// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw %struct.paddednullinit, ptr %custom, i32 0, i32 1752// CHECK-NEXT: store i32 13371337, ptr %[[I]], align [[ALIGN]]753// CHECK-NOT: !annotation754// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)755 756TEST_UNINIT(paddedpacked, paddedpacked);757// CHECK-LABEL: @test_paddedpacked_uninit()758// CHECK: %uninit = alloca %struct.paddedpacked, align759// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)760// PATTERN-LABEL: @test_paddedpacked_uninit()761// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpacked_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]762// PATTERN-O1: store i8 [[I8]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]763// PATTERN-O1: %[[I:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 1764// PATTERN-O1: store i32 [[I32]], ptr %[[I]], align {{.+}}, !annotation [[AUTO_INIT]]765// ZERO-LABEL: @test_paddedpacked_uninit()766// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]767 768TEST_BRACES(paddedpacked, paddedpacked);769// CHECK-LABEL: @test_paddedpacked_braces()770// CHECK: %braces = alloca %struct.paddedpacked, align [[ALIGN:[0-9]*]]771// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 5, i1 false)772// CHECK-NOT: !annotation773// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)774 775TEST_CUSTOM(paddedpacked, paddedpacked, { 42, 13371337 });776// CHECK-LABEL: @test_paddedpacked_custom()777// CHECK: %custom = alloca %struct.paddedpacked, align778// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpacked_custom.custom779// CHECK-NOT: !annotation780// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)781 782TEST_UNINIT(paddedpackedarray, paddedpackedarray);783// CHECK-LABEL: @test_paddedpackedarray_uninit()784// CHECK: %uninit = alloca %struct.paddedpackedarray, align785// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)786// PATTERN-LABEL: @test_paddedpackedarray_uninit()787// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackedarray_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]788// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}i8 [[I8]], i64 10789// FIXME: !annotation dropped by optimizations790// PATTERN-O1-NOT: !annotation791// ZERO-LABEL: @test_paddedpackedarray_uninit()792// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]793 794TEST_BRACES(paddedpackedarray, paddedpackedarray);795// CHECK-LABEL: @test_paddedpackedarray_braces()796// CHECK: %braces = alloca %struct.paddedpackedarray, align [[ALIGN:[0-9]*]]797// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false)798// CHECK-NOT: !annotation799// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)800 801TEST_CUSTOM(paddedpackedarray, paddedpackedarray, { {{ 42, 13371337 }, { 43, 13371338 }} });802// CHECK-LABEL: @test_paddedpackedarray_custom()803// CHECK: %custom = alloca %struct.paddedpackedarray, align804// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackedarray_custom.custom805// CHECK-NOT: !annotation806// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)807 808TEST_UNINIT(unpackedinpacked, unpackedinpacked);809// PATTERN-LABEL: @test_unpackedinpacked_uninit()810// PATTERN-O0: call void @llvm.memcpy{{.*}} 9, i1 false), !annotation [[AUTO_INIT]]811 812TEST_UNINIT(paddednested, paddednested);813// CHECK-LABEL: @test_paddednested_uninit()814// CHECK: %uninit = alloca %struct.paddednested, align815// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)816// PATTERN-LABEL: @test_paddednested_uninit()817// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednested_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]818// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 16{{.+}})819// FIXME: !annotation dropped by optimizations820// PATTERN-O1-NOT: !annotation821// ZERO-LABEL: @test_paddednested_uninit()822// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]823 824TEST_BRACES(paddednested, paddednested);825// CHECK-LABEL: @test_paddednested_braces()826// CHECK: %braces = alloca %struct.paddednested, align [[ALIGN:[0-9]*]]827// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)828// CHECK-NOT: !annotation829// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)830 831TEST_CUSTOM(paddednested, paddednested, { { 42, 13371337 }, { 43, 13371338 } });832// CHECK-LABEL: @test_paddednested_custom()833// CHECK: %custom = alloca %struct.paddednested, align834// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddednested_custom.custom835// CHECK-NOT: !annotation836// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)837 838TEST_UNINIT(paddedpackednested, paddedpackednested);839// CHECK-LABEL: @test_paddedpackednested_uninit()840// CHECK: %uninit = alloca %struct.paddedpackednested, align841// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)842// PATTERN-LABEL: @test_paddedpackednested_uninit()843// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpackednested_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]844// PATTERN-O1: call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %uninit, i8 [[I8]], i64 10, i1 false)845// FIXME: !annotation dropped by optimizations846// PATTERN-O1-NOT: !annotation847// ZERO-LABEL: @test_paddedpackednested_uninit()848// ZERO: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]849 850TEST_BRACES(paddedpackednested, paddedpackednested);851// CHECK-LABEL: @test_paddedpackednested_braces()852// CHECK: %braces = alloca %struct.paddedpackednested, align [[ALIGN:[0-9]*]]853// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 10, i1 false)854// CHECK-NOT: !annotation855// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)856 857TEST_CUSTOM(paddedpackednested, paddedpackednested, { { 42, 13371337 }, { 43, 13371338 } });858// CHECK-LABEL: @test_paddedpackednested_custom()859// CHECK: %custom = alloca %struct.paddedpackednested, align860// CHECK-NEXT: call void @llvm.memcpy{{.*}}({{.*}}@__const.test_paddedpackednested_custom.custom861// CHECK-NOT: !annotation862// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)863 864TEST_UNINIT(bitfield, bitfield);865// CHECK-LABEL: @test_bitfield_uninit()866// CHECK: %uninit = alloca %struct.bitfield, align867// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)868// PATTERN-LABEL: @test_bitfield_uninit()869// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfield_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]870// PATTERN-O1: store i32 [[I32]], ptr %uninit, align 4871// FIXME: !annotation dropped by optimizations872// PATTERN-O1-NOT: !annotation873// ZERO-LABEL: @test_bitfield_uninit()874// ZERO-O0: call void @llvm.memset{{.*}}, i8 0{{.+}}), !annotation [[AUTO_INIT]]875// ZERO-O1: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]876 877TEST_BRACES(bitfield, bitfield);878// CHECK-LABEL: @test_bitfield_braces()879// CHECK: %braces = alloca %struct.bitfield, align880// CHECK-NEXT: call void @llvm.memcpy881// CHECK-NOT: !annotation882// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)883 884TEST_CUSTOM(bitfield, bitfield, { 4, 1 });885// CHECK-LABEL: @test_bitfield_custom()886// CHECK: %custom = alloca %struct.bitfield, align887// CHECK-NEXT: call void @llvm.memcpy888// CHECK-NOT: !annotation889// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)890 891TEST_UNINIT(bitfieldaligned, bitfieldaligned);892// CHECK-LABEL: @test_bitfieldaligned_uninit()893// CHECK: %uninit = alloca %struct.bitfieldaligned, align894// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)895// PATTERN-LABEL: @test_bitfieldaligned_uninit()896// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bitfieldaligned_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]897// PATTERN-O1: store i64 [[IPTR]], ptr %uninit, align 8898// FIXME: !annotation dropped by optimizations899// PATTERN-O1-NOT: !annotation900// ZERO-LABEL: @test_bitfieldaligned_uninit()901// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]902// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]903 904TEST_BRACES(bitfieldaligned, bitfieldaligned);905// CHECK-LABEL: @test_bitfieldaligned_braces()906// CHECK: %braces = alloca %struct.bitfieldaligned, align907// CHECK-NEXT: call void @llvm.memcpy908// CHECK-NOT: !annotation909// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)910 911TEST_CUSTOM(bitfieldaligned, bitfieldaligned, { 4, 1 });912// CHECK-LABEL: @test_bitfieldaligned_custom()913// CHECK: %custom = alloca %struct.bitfieldaligned, align914// CHECK-NEXT: call void @llvm.memcpy915// CHECK-NOT: !annotation916// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)917 918TEST_UNINIT(big, big);919// CHECK-LABEL: @test_big_uninit()920// CHECK: %uninit = alloca %struct.big, align921// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)922// PATTERN-LABEL: @test_big_uninit()923// PATTERN: call void @llvm.memset{{.*}}, i8 [[I8]],{{.+}}), !annotation [[AUTO_INIT]]924// ZERO-LABEL: @test_big_uninit()925// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]926 927TEST_BRACES(big, big);928// CHECK-LABEL: @test_big_braces()929// CHECK: %braces = alloca %struct.big, align [[ALIGN:[0-9]*]]930// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 104, i1 false)931// CHECK-NOT: !annotation932// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)933 934TEST_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 });935// CHECK-LABEL: @test_big_custom()936// CHECK: %custom = alloca %struct.big, align [[ALIGN:[0-9]*]]937// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 -86, i64 104, i1 false)938// CHECK-NOT: !annotation939// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)940 941TEST_UNINIT(arraytail, arraytail);942// CHECK-LABEL: @test_arraytail_uninit()943// CHECK: %uninit = alloca %struct.arraytail, align944// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)945// PATTERN-LABEL: @test_arraytail_uninit()946// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_arraytail_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]947// PATTERN-O1: store i32 [[I32]], {{.*}} align 4, !annotation [[AUTO_INIT]]948// ZERO-LABEL: @test_arraytail_uninit()949// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]950// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]951 952TEST_BRACES(arraytail, arraytail);953// CHECK-LABEL: @test_arraytail_braces()954// CHECK: %braces = alloca %struct.arraytail, align [[ALIGN:[0-9]*]]955// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)956// CHECK-NOT: !annotation957// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)958 959TEST_CUSTOM(arraytail, arraytail, { 0xdead });960// CHECK-LABEL: @test_arraytail_custom()961// CHECK: %custom = alloca %struct.arraytail, align962// CHECK-NEXT: call void @llvm.memcpy963// CHECK-NOT: !annotation964// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)965 966TEST_UNINIT(int0, int[0]);967// CHECK-LABEL: @test_int0_uninit()968// CHECK: %uninit = alloca [0 x i32], align969// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)970// PATTERN-LABEL: @test_int0_uninit()971// PATTERN: %uninit = alloca [0 x i32], align972// PATTERN-O0-NEXT: call void @{{.*}}used{{.*}}%uninit)973// ZERO-LABEL: @test_int0_uninit()974// ZERO: %uninit = alloca [0 x i32], align975// ZERO-O0-NEXT: call void @{{.*}}used{{.*}}%uninit)976 977TEST_BRACES(int0, int[0]);978// CHECK-LABEL: @test_int0_braces()979// CHECK: %braces = alloca [0 x i32], align [[ALIGN:[0-9]*]]980// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)981 982TEST_UNINIT(int1, int[1]);983// CHECK-LABEL: @test_int1_uninit()984// CHECK: %uninit = alloca [1 x i32], align [[ALIGN:[0-9]*]]985// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)986// PATTERN-LABEL: @test_int1_uninit()987// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_int1_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]988// PATTERN-O1: store i32 [[I32]], {{.*}} align 4, !annotation [[AUTO_INIT]]989// ZERO-LABEL: @test_int1_uninit()990// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]991// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]992 993TEST_BRACES(int1, int[1]);994// CHECK-LABEL: @test_int1_braces()995// CHECK: %braces = alloca [1 x i32], align [[ALIGN:[0-9]*]]996// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)997// CHECK-NOT: !annotation998// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)999 1000TEST_CUSTOM(int1, int[1], { 0x33333333 });1001// CHECK-LABEL: @test_int1_custom()1002// CHECK: %custom = alloca [1 x i32], align1003// CHECK-NEXT: call void @llvm.memcpy1004// CHECK-NOT: !annotation1005// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1006 1007TEST_UNINIT(int64, int[64]);1008// CHECK-LABEL: @test_int64_uninit()1009// CHECK: %uninit = alloca [64 x i32], align1010// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1011// PATTERN-LABEL: @test_int64_uninit()1012// PATTERN: call void @llvm.memset{{.*}}, i8 [[I8]],{{.+}}), !annotation [[AUTO_INIT]]1013// ZERO-LABEL: @test_int64_uninit()1014// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1015 1016TEST_BRACES(int64, int[64]);1017// CHECK-LABEL: @test_int64_braces()1018// CHECK: %braces = alloca [64 x i32], align [[ALIGN:[0-9]*]]1019// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 256, i1 false)1020// CHECK-NOT: !annotation1021// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1022 1023TEST_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 });1024// CHECK-LABEL: @test_int64_custom()1025// CHECK: %custom = alloca [64 x i32], align [[ALIGN:[0-9]*]]1026// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 17, i64 256, i1 false)1027// CHECK-NOT: !annotation1028// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1029 1030TEST_UNINIT(bool4, bool[4]);1031// CHECK-LABEL: @test_bool4_uninit()1032// CHECK: %uninit = alloca [4 x i8], align1033// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1034// PATTERN-LABEL: @test_bool4_uninit()1035// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_bool4_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1036// PATTERN-O1: store i32 [[I32]], ptr %uninit, align 41037// FIXME: !annotation dropped by optimizations1038// PATTERN-O1-NOT: !annotation1039// ZERO-LABEL: @test_bool4_uninit()1040// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1041// ZERO-O1: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]1042 1043TEST_BRACES(bool4, bool[4]);1044// CHECK-LABEL: @test_bool4_braces()1045// CHECK: %braces = alloca [4 x i8], align [[ALIGN:[0-9]*]]1046// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)1047// CHECK-NOT: !annotation1048// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1049 1050TEST_CUSTOM(bool4, bool[4], { true, true, true, true });1051// CHECK-LABEL: @test_bool4_custom()1052// CHECK: %custom = alloca [4 x i8], align1053// CHECK-NEXT: call void @llvm.memcpy1054// CHECK-NOT: !annotation1055// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1056 1057TEST_UNINIT(intptr4, int*[4]);1058// CHECK-LABEL: @test_intptr4_uninit()1059// CHECK: %uninit = alloca [4 x ptr], align1060// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1061// PATTERN-O1-LABEL: @test_intptr4_uninit()1062// PATTERN-O1: call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %{{.*}}, i8 -86, i64 32, i1 false)1063// FIXME: !annotation dropped by optimizations1064// PATTERN-O1-NOT: !annotation1065// ZERO-LABEL: @test_intptr4_uninit()1066// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1067 1068TEST_BRACES(intptr4, int*[4]);1069// CHECK-LABEL: @test_intptr4_braces()1070// CHECK: %braces = alloca [4 x ptr], align [[ALIGN:[0-9]*]]1071// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 32, i1 false)1072// CHECK-NOT: !annotation1073// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1074 1075TEST_CUSTOM(intptr4, int *[4], = {(int *)0x22222222, (int *)0x22222222, (int *)0x22222222, (int *)0x22222222});1076// CHECK-LABEL: @test_intptr4_custom()1077// CHECK: %custom = alloca [4 x ptr], align1078// CHECK-NEXT: call void @llvm.memcpy1079// CHECK-NOT: !annotation1080// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1081 1082TEST_UNINIT(tailpad4, tailpad[4]);1083// CHECK-LABEL: @test_tailpad4_uninit()1084// CHECK: %uninit = alloca [4 x %struct.tailpad], align1085// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1086// PATTERN-LABEL: @test_tailpad4_uninit()1087// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_tailpad4_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1088// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 16{{.+}})1089// FIXME: !annotation dropped by optimizations1090// PATTERN-O1-NOT: !annotation1091// ZERO-LABEL: @test_tailpad4_uninit()1092// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1093 1094TEST_BRACES(tailpad4, tailpad[4]);1095// CHECK-LABEL: @test_tailpad4_braces()1096// CHECK: %braces = alloca [4 x %struct.tailpad], align [[ALIGN:[0-9]*]]1097// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)1098// CHECK-NOT: !annotation1099// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1100 1101TEST_CUSTOM(tailpad4, tailpad[4], { {257, 1}, {257, 1}, {257, 1}, {257, 1} });1102// CHECK-LABEL: @test_tailpad4_custom()1103// CHECK: %custom = alloca [4 x %struct.tailpad], align1104// CHECK-NEXT: call void @llvm.memcpy1105// CHECK-NOT: !annotation1106// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1107 1108TEST_UNINIT(tailpad9, tailpad[9]);1109// CHECK-LABEL: @test_tailpad9_uninit()1110// CHECK: %uninit = alloca [9 x %struct.tailpad], align1111// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1112// PATTERN-LABEL: @test_tailpad9_uninit()1113// PATTERN-O0: call void @llvm.memset{{.*}}, i8 [[I8]],{{.+}}), !annotation [[AUTO_INIT]]1114// ZERO-LABEL: @test_tailpad9_uninit()1115// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1116 1117TEST_BRACES(tailpad9, tailpad[9]);1118// CHECK-LABEL: @test_tailpad9_braces()1119// CHECK: %braces = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]]1120// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 36, i1 false)1121// CHECK-NOT: !annotation1122// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1123 1124TEST_CUSTOM(tailpad9, tailpad[9], { {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1}, {257, 1} });1125// CHECK-LABEL: @test_tailpad9_custom()1126// CHECK: %custom = alloca [9 x %struct.tailpad], align [[ALIGN:[0-9]*]]1127// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 1, i64 36, i1 false)1128// CHECK-NOT: !annotation1129// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1130 1131TEST_UNINIT(atomicbool, _Atomic(bool));1132// CHECK-LABEL: @test_atomicbool_uninit()1133// CHECK: %uninit = alloca i8, align1134// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1135// PATTERN-LABEL: @test_atomicbool_uninit()1136// PATTERN: store i8 [[I8]], ptr %uninit, align 1, !annotation [[AUTO_INIT]]1137// ZERO-LABEL: @test_atomicbool_uninit()1138// ZERO: store i8 0, ptr %uninit, align 1, !annotation [[AUTO_INIT]]1139 1140TEST_UNINIT(atomicint, _Atomic(int));1141// CHECK-LABEL: @test_atomicint_uninit()1142// CHECK: %uninit = alloca i32, align1143// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1144// PATTERN-LABEL: @test_atomicint_uninit()1145// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]1146// ZERO-LABEL: @test_atomicint_uninit()1147// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]1148 1149TEST_UNINIT(atomicdouble, _Atomic(double));1150// CHECK-LABEL: @test_atomicdouble_uninit()1151// CHECK: %uninit = alloca double, align1152// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1153// PATTERN-LABEL: @test_atomicdouble_uninit()1154// PATTERN: store double 0xFFFFFFFFFFFFFFFF, ptr %uninit, align 8, !annotation [[AUTO_INIT]]1155// ZERO-LABEL: @test_atomicdouble_uninit()1156// ZERO: store double 0.000000e+00, ptr %uninit, align 8, !annotation [[AUTO_INIT]]1157 1158TEST_UNINIT(atomicnotlockfree, _Atomic(notlockfree));1159// CHECK-LABEL: @test_atomicnotlockfree_uninit()1160// CHECK: %uninit = alloca %struct.notlockfree, align1161// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1162// PATTERN-LABEL: @test_atomicnotlockfree_uninit()1163// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicnotlockfree_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1164// PATTERN-O1: call void @llvm.memset{{.*}}({{.*}}, i8 [[I8]], i64 32{{.*}}1165// FIXME: !annotation dropped by optimizations1166// PATTERN-O1-NOT: !annotation1167// ZERO-LABEL: @test_atomicnotlockfree_uninit()1168// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1169 1170TEST_UNINIT(atomicpadded, _Atomic(padded));1171// CHECK-LABEL: @test_atomicpadded_uninit()1172// CHECK: %uninit = alloca %struct.padded, align1173// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1174// PATTERN-LABEL: @test_atomicpadded_uninit()1175// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicpadded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1176// PATTERN-O1: store i64 [[IPTR]], ptr %uninit, align 81177// PATTERN-O1-NOT: !annotation1178// ZERO-LABEL: @test_atomicpadded_uninit()1179// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1180// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]1181 1182TEST_UNINIT(atomictailpad, _Atomic(tailpad));1183// CHECK-LABEL: @test_atomictailpad_uninit()1184// CHECK: %uninit = alloca %struct.tailpad, align1185// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1186// PATTERN-LABEL: @test_atomictailpad_uninit()1187// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomictailpad_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1188// ZERO-LABEL: @test_atomictailpad_uninit()1189// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1190// ZERO-O1: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]1191 1192TEST_UNINIT(complexfloat, _Complex float);1193// CHECK-LABEL: @test_complexfloat_uninit()1194// CHECK: %uninit = alloca { float, float }, align1195// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1196// PATTERN-LABEL: @test_complexfloat_uninit()1197// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexfloat_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1198// PATTERN-O1: store float 0xFFFFFFFFE0000000, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]1199// PATTERN-O1: %[[F2:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 41200// PATTERN-O1: store float 0xFFFFFFFFE0000000, ptr %[[F2]], align {{.+}}, !annotation [[AUTO_INIT]]1201 1202// ZERO-LABEL: @test_complexfloat_uninit()1203// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1204// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]1205 1206TEST_BRACES(complexfloat, _Complex float);1207// CHECK-LABEL: @test_complexfloat_braces()1208// CHECK: %braces = alloca { float, float }, align [[ALIGN:[0-9]*]]1209// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds nuw { float, float }, ptr %braces, i32 0, i32 01210// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw { float, float }, ptr %braces, i32 0, i32 11211// CHECK-NEXT: store float 0.000000e+00, ptr %[[R]], align [[ALIGN]]1212// CHECK-NOT: !annotation1213// CHECK-NEXT: store float 0.000000e+00, ptr %[[I]], align [[ALIGN]]1214// CHECK-NOT: !annotation1215// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1216 1217TEST_CUSTOM(complexfloat, _Complex float, { 3.1415926535897932384626433, 3.1415926535897932384626433 });1218// CHECK-LABEL: @test_complexfloat_custom()1219// CHECK: %custom = alloca { float, float }, align [[ALIGN:[0-9]*]]1220// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds nuw { float, float }, ptr %custom, i32 0, i32 01221// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw { float, float }, ptr %custom, i32 0, i32 11222// CHECK-NEXT: store float 0x400921FB60000000, ptr %[[R]], align [[ALIGN]]1223// CHECK-NOT: !annotation1224// CHECK-NEXT: store float 0x400921FB60000000, ptr %[[I]], align [[ALIGN]]1225// CHECK-NOT: !annotation1226// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1227 1228TEST_UNINIT(complexdouble, _Complex double);1229// CHECK-LABEL: @test_complexdouble_uninit()1230// CHECK: %uninit = alloca { double, double }, align1231// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1232// PATTERN-LABEL: @test_complexdouble_uninit()1233// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexdouble_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1234// ZERO-LABEL: @test_complexdouble_uninit()1235// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1236 1237TEST_BRACES(complexdouble, _Complex double);1238// CHECK-LABEL: @test_complexdouble_braces()1239// CHECK: %braces = alloca { double, double }, align [[ALIGN:[0-9]*]]1240// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds nuw { double, double }, ptr %braces, i32 0, i32 01241// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw { double, double }, ptr %braces, i32 0, i32 11242// CHECK-NEXT: store double 0.000000e+00, ptr %[[R]], align [[ALIGN]]1243// CHECK-NOT: !annotation1244// CHECK-NEXT: store double 0.000000e+00, ptr %[[I]], align [[ALIGN]]1245// CHECK-NOT: !annotation1246// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1247 1248TEST_CUSTOM(complexdouble, _Complex double, { 3.1415926535897932384626433, 3.1415926535897932384626433 });1249// CHECK-LABEL: @test_complexdouble_custom()1250// CHECK: %custom = alloca { double, double }, align [[ALIGN:[0-9]*]]1251// CHECK-NEXT: %[[R:[^ ]*]] = getelementptr inbounds nuw { double, double }, ptr %custom, i32 0, i32 01252// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw { double, double }, ptr %custom, i32 0, i32 11253// CHECK-NEXT: store double 0x400921FB54442D18, ptr %[[R]], align [[ALIGN]]1254// CHECK-NOT: !annotation1255// CHECK-NEXT: store double 0x400921FB54442D18, ptr %[[I]], align [[ALIGN]]1256// CHECK-NOT: !annotation1257// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1258 1259TEST_UNINIT(volatileint, volatile int);1260// CHECK-LABEL: @test_volatileint_uninit()1261// CHECK: %uninit = alloca i32, align1262// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1263// PATTERN-LABEL: @test_volatileint_uninit()1264// PATTERN: store volatile i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]1265// ZERO-LABEL: @test_volatileint_uninit()1266// ZERO: store volatile i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]1267 1268TEST_BRACES(volatileint, volatile int);1269// CHECK-LABEL: @test_volatileint_braces()1270// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]1271// CHECK-NEXT: store volatile i32 0, ptr %braces, align [[ALIGN]]1272// CHECK-NOT: !annotation1273// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1274 1275TEST_UNINIT(semivolatile, semivolatile);1276// CHECK-LABEL: @test_semivolatile_uninit()1277// CHECK: %uninit = alloca %struct.semivolatile, align1278// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1279// PATTERN-LABEL: @test_semivolatile_uninit()1280// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_semivolatile_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1281// ZERO-LABEL: @test_semivolatile_uninit()1282// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1283// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]1284 1285TEST_BRACES(semivolatile, semivolatile);1286// CHECK-LABEL: @test_semivolatile_braces()1287// CHECK: %braces = alloca %struct.semivolatile, align [[ALIGN:[0-9]*]]1288// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)1289// CHECK-NOT: !annotation1290// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1291 1292TEST_CUSTOM(semivolatile, semivolatile, { 0x44444444, 0x44444444 });1293// CHECK-LABEL: @test_semivolatile_custom()1294// CHECK: %custom = alloca %struct.semivolatile, align1295// CHECK-O0: call void @llvm.memcpy1296// CHECK-NOT: !annotation1297// CHECK-O0: call void @{{.*}}used{{.*}}%custom)1298// PATTERN-O1: store i32 1145324612, ptr %custom, align 41299// PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw i8, ptr %custom, i64 41300// PATTERN-O1-NEXT: store i32 1145324612, ptr %[[I]], align 41301// ZERO-O1: store i64 4919131752989213764, ptr %custom, align 81302// CHECK-NOT: !annotation1303 1304TEST_UNINIT(semivolatileinit, semivolatileinit);1305// CHECK-LABEL: @test_semivolatileinit_uninit()1306// CHECK: %uninit = alloca %struct.semivolatileinit, align1307// CHECK-NEXT: call void @{{.*}}semivolatileinit{{.*}}%uninit)1308// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1309 1310TEST_BRACES(semivolatileinit, semivolatileinit);1311// CHECK-LABEL: @test_semivolatileinit_braces()1312// CHECK: %braces = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]]1313// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw %struct.semivolatileinit, ptr %braces, i32 0, i32 01314// CHECK-NEXT: store i32 286331153, ptr %[[I]], align [[ALIGN]]1315// CHECK-NOT: !annotation1316// CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds nuw %struct.semivolatileinit, ptr %braces, i32 0, i32 11317// CHECK-NEXT: store volatile i32 286331153, ptr %[[VI]], align [[ALIGN]]1318// CHECK-NOT: !annotation1319// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1320 1321TEST_CUSTOM(semivolatileinit, semivolatileinit, { 0x44444444, 0x44444444 });1322// CHECK-LABEL: @test_semivolatileinit_custom()1323// CHECK: %custom = alloca %struct.semivolatileinit, align [[ALIGN:[0-9]*]]1324// CHECK-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw %struct.semivolatileinit, ptr %custom, i32 0, i32 01325// CHECK-NEXT: store i32 1145324612, ptr %[[I]], align [[ALIGN]]1326// CHECK-NOT: !annotation1327// CHECK-NEXT: %[[VI:[^ ]*]] = getelementptr inbounds nuw %struct.semivolatileinit, ptr %custom, i32 0, i32 11328// CHECK-NEXT: store volatile i32 1145324612, ptr %[[VI]], align [[ALIGN]]1329// CHECK-NOT: !annotation1330// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1331 1332TEST_UNINIT(base, base);1333// CHECK-LABEL: @test_base_uninit()1334// CHECK: %uninit = alloca %struct.base, align1335// CHECK-NEXT: call void @{{.*}}base{{.*}}%uninit)1336// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1337// PATTERN-LABEL: @test_base_uninit()1338// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_base_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1339// ZERO-LABEL: @test_base_uninit()1340// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1341// ZERO-O1: store ptr getelementptr inbounds nuw inrange(-16, 16) (i8, ptr @_ZTV4base, i64 16), {{.*}}, align 81342// ZERO-O1-NOT: !annotation1343 1344TEST_BRACES(base, base);1345// ZERO-LABEL: @test_base_braces()1346// CHECK-LABEL: @test_base_braces()1347// CHECK: %braces = alloca %struct.base, align [[ALIGN:[0-9]*]]1348// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)1349// CHECK-NOT: !annotation1350// CHECK-NEXT: call void @{{.*}}base{{.*}}%braces)1351// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1352 1353TEST_UNINIT(derived, derived);1354// CHECK-LABEL: @test_derived_uninit()1355// CHECK: %uninit = alloca %struct.derived, align1356// CHECK-NEXT: call void @{{.*}}derived{{.*}}%uninit)1357// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1358// PATTERN-LABEL: @test_derived_uninit()1359// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_derived_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1360// ZERO-LABEL: @test_derived_uninit()1361// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1362// ZERO-O1: store i64 0, {{.*}} align 8, !annotation [[AUTO_INIT]]1363// ZERO-O1: store ptr getelementptr inbounds nuw inrange(-16, 16) (i8, ptr @_ZTV7derived, i64 16), {{.*}} align 81364 1365TEST_BRACES(derived, derived);1366// CHECK-LABEL: @test_derived_braces()1367// CHECK: %braces = alloca %struct.derived, align [[ALIGN:[0-9]*]]1368// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 8, i1 false)1369// CHECK-NOT: !annotation1370// CHECK-NEXT: call void @{{.*}}derived{{.*}}%braces)1371// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1372 1373TEST_UNINIT(virtualderived, virtualderived);1374// CHECK-LABEL: @test_virtualderived_uninit()1375// CHECK: %uninit = alloca %struct.virtualderived, align1376// CHECK-NEXT: call void @{{.*}}virtualderived{{.*}}%uninit)1377// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1378// PATTERN-LABEL: @test_virtualderived_uninit()1379// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_virtualderived_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1380// ZERO-LABEL: @test_virtualderived_uninit()1381// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1382// ZERO-O1: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1383 1384TEST_BRACES(virtualderived, virtualderived);1385// CHECK-LABEL: @test_virtualderived_braces()1386// CHECK: %braces = alloca %struct.virtualderived, align [[ALIGN:[0-9]*]]1387// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 16, i1 false)1388// CHECK-NOT: !annotation1389// CHECK-NEXT: call void @{{.*}}virtualderived{{.*}}%braces)1390// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1391 1392TEST_UNINIT(matching, matching);1393// CHECK-LABEL: @test_matching_uninit()1394// CHECK: %uninit = alloca %union.matching, align1395// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1396// PATTERN-LABEL: @test_matching_uninit()1397// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matching_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1398// ZERO-LABEL: @test_matching_uninit()1399// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1400// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]1401 1402TEST_BRACES(matching, matching);1403// CHECK-LABEL: @test_matching_braces()1404// CHECK: %braces = alloca %union.matching, align [[ALIGN:[0-9]*]]1405// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)1406// CHECK-NOT: !annotation1407// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1408 1409TEST_CUSTOM(matching, matching, { .f = 0xf00f });1410// CHECK-LABEL: @test_matching_custom()1411// CHECK: %custom = alloca %union.matching, align1412// CHECK-O0: call void @llvm.memcpy1413// CHECK-NOT: !annotation1414// CHECK-O0: call void @{{.*}}used{{.*}}%custom)1415// PATTERN-O1: store float 6.145500e+04, ptr {{.*}}, align 41416// ZERO-O1: store i32 1198526208, ptr %custom, align 41417// CHECK-NOT: !annotation1418 1419TEST_UNINIT(matchingreverse, matchingreverse);1420// CHECK-LABEL: @test_matchingreverse_uninit()1421// CHECK: %uninit = alloca %union.matchingreverse, align1422// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1423// PATTERN-LABEL: @test_matchingreverse_uninit()1424// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_matchingreverse_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1425// PATTERN-O1: store float 0xFFFFFFFFE0000000, {{.+}}, !annotation [[AUTO_INIT]]1426// ZERO-LABEL: @test_matchingreverse_uninit()1427// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]1428// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]1429 1430TEST_BRACES(matchingreverse, matchingreverse);1431// CHECK-LABEL: @test_matchingreverse_braces()1432// CHECK: %braces = alloca %union.matchingreverse, align [[ALIGN:[0-9]*]]1433// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)1434// CHECK-NOT: !annotation1435// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1436 1437TEST_CUSTOM(matchingreverse, matchingreverse, { .i = 0xf00f });1438// CHECK-LABEL: @test_matchingreverse_custom()1439// CHECK: %custom = alloca %union.matchingreverse, align1440// CHECK-O0: call void @llvm.memcpy1441// CHECK-NOT: !annotation1442// CHECK-O0: call void @{{.*}}used{{.*}}%custom)1443// PATTERN-O1: store i32 61455, ptr %custom, align 41444// ZERO-O1: store i32 61455, ptr %custom, align 41445// CHECK-NOT: !annotation1446 1447TEST_UNINIT(unmatched, unmatched);1448// CHECK-LABEL: @test_unmatched_uninit()1449// CHECK: %uninit = alloca %union.unmatched, align1450// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1451// PATTERN-LABEL: @test_unmatched_uninit()1452// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatched_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1453// ZERO-LABEL: @test_unmatched_uninit()1454// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1455// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]1456 1457TEST_BRACES(unmatched, unmatched);1458// CHECK-LABEL: @test_unmatched_braces()1459// CHECK: %braces = alloca %union.unmatched, align1460// CHECK-NEXT: call void @llvm.memcpy1461// CHECK-NOT: !annotation1462// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1463 1464TEST_CUSTOM(unmatched, unmatched, { .i = 0x3badbeef });1465// CHECK-LABEL: @test_unmatched_custom()1466// CHECK: %custom = alloca %union.unmatched, align1467// CHECK-O0: call void @llvm.memcpy1468// CHECK-NOT: !annotation1469// CHECK-O0: call void @{{.*}}used{{.*}}%custom)1470// PATTERN-O1: store i32 1001242351, ptr {{.*}}, align 41471// ZERO-O1: store i32 1001242351, ptr {{.*}}, align 41472// CHECK-NOT: !annotation1473 1474TEST_UNINIT(unmatchedreverse, unmatchedreverse);1475// CHECK-LABEL: @test_unmatchedreverse_uninit()1476// CHECK: %uninit = alloca %union.unmatchedreverse, align1477// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1478// PATTERN-LABEL: @test_unmatchedreverse_uninit()1479// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedreverse_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1480// ZERO-LABEL: @test_unmatchedreverse_uninit()1481// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1482// ZERO-O1: store i32 0, {{.*}} align 4, !annotation [[AUTO_INIT]]1483 1484TEST_BRACES(unmatchedreverse, unmatchedreverse);1485// CHECK-LABEL: @test_unmatchedreverse_braces()1486// CHECK: %braces = alloca %union.unmatchedreverse, align [[ALIGN:[0-9]*]]1487// CHECK-NEXT: call void @llvm.memset{{.*}}(ptr align [[ALIGN]] %{{.*}}, i8 0, i64 4, i1 false)1488// CHECK-NOT: !annotation1489// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1490 1491TEST_CUSTOM(unmatchedreverse, unmatchedreverse, { .c = 42 });1492// CHECK-LABEL: @test_unmatchedreverse_custom()1493// CHECK: %custom = alloca %union.unmatchedreverse, align1494// CHECK-O0: call void @llvm.memcpy1495// CHECK-NOT: !annotation1496// CHECK-O0: call void @{{.*}}used{{.*}}%custom)1497// PATTERN-O1: store i8 42, ptr {{.*}}, align 41498// PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw i8, ptr %custom, i64 11499// PATTERN-O1-NEXT: store i8 -86, ptr %[[I]], align {{.*}}1500// PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw i8, ptr %custom, i64 21501// PATTERN-O1-NEXT: store i8 -86, ptr %[[I]], align {{.*}}1502// PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds nuw i8, ptr %custom, i64 31503// PATTERN-O1-NEXT: store i8 -86, ptr %[[I]], align {{.*}}1504// ZERO-O1: store i32 42, ptr {{.*}}, align 41505 1506TEST_UNINIT(unmatchedfp, unmatchedfp);1507// CHECK-LABEL: @test_unmatchedfp_uninit()1508// CHECK: %uninit = alloca %union.unmatchedfp, align1509// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1510// PATTERN-LABEL: @test_unmatchedfp_uninit()1511// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_unmatchedfp_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]1512// ZERO-LABEL: @test_unmatchedfp_uninit()1513// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]1514// ZERO-O1: store i64 0, {{.*}} align 8, !annotation [[AUTO_INIT]]1515 1516TEST_BRACES(unmatchedfp, unmatchedfp);1517// CHECK-LABEL: @test_unmatchedfp_braces()1518// CHECK: %braces = alloca %union.unmatchedfp, align1519// CHECK-NEXT: call void @llvm.memcpy1520// CHECK-NOT: !annotation1521// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1522 1523TEST_CUSTOM(unmatchedfp, unmatchedfp, { .d = 3.1415926535897932384626433 });1524// CHECK-LABEL: @test_unmatchedfp_custom()1525// CHECK: %custom = alloca %union.unmatchedfp, align1526// CHECK-O0: call void @llvm.memcpy1527// CHECK-NOT: !annotation1528// CHECK-O0: call void @{{.*}}used{{.*}}%custom)1529// PATTERN-O1: store double 0x400921FB54442D18, ptr %custom, align 81530// ZERO-O1: store i64 4614256656552045848, ptr %custom, align 81531// CHECK-NOT: !annotation1532 1533TEST_UNINIT(emptyenum, emptyenum);1534// CHECK-LABEL: @test_emptyenum_uninit()1535// CHECK: %uninit = alloca i32, align1536// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1537// PATTERN-LABEL: @test_emptyenum_uninit()1538// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]1539// ZERO-LABEL: @test_emptyenum_uninit()1540// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]1541 1542TEST_BRACES(emptyenum, emptyenum);1543// CHECK-LABEL: @test_emptyenum_braces()1544// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]1545// CHECK-NOT: !annotation1546// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]1547// CHECK-NOT: !annotation1548// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1549 1550TEST_CUSTOM(emptyenum, emptyenum, { (emptyenum)42 });1551// CHECK-LABEL: @test_emptyenum_custom()1552// CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]]1553// CHECK-NEXT: store i32 42, ptr %custom, align [[ALIGN]]1554// CHECK-NOT: !annotation1555// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1556 1557TEST_UNINIT(smallenum, smallenum);1558// CHECK-LABEL: @test_smallenum_uninit()1559// CHECK: %uninit = alloca i32, align1560// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1561// PATTERN-LABEL: @test_smallenum_uninit()1562// PATTERN: store i32 [[I32]], ptr %uninit, align 4, !annotation [[AUTO_INIT]]1563// ZERO-LABEL: @test_smallenum_uninit()1564// ZERO: store i32 0, ptr %uninit, align 4, !annotation [[AUTO_INIT]]1565 1566TEST_BRACES(smallenum, smallenum);1567// CHECK-LABEL: @test_smallenum_braces()1568// CHECK: %braces = alloca i32, align [[ALIGN:[0-9]*]]1569// CHECK-NEXT: store i32 0, ptr %braces, align [[ALIGN]]1570// CHECK-NOT: !annotation1571// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1572 1573TEST_CUSTOM(smallenum, smallenum, { (smallenum)42 });1574// CHECK-LABEL: @test_smallenum_custom()1575// CHECK: %custom = alloca i32, align [[ALIGN:[0-9]*]]1576// CHECK-NEXT: store i32 42, ptr %custom, align [[ALIGN]]1577// CHECK-NOT: !annotation1578// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1579 1580TEST_UNINIT(intvec16, int __attribute__((vector_size(16))));1581// CHECK-LABEL: @test_intvec16_uninit()1582// CHECK: %uninit = alloca <4 x i32>, align1583// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1584// PATTERN-LABEL: @test_intvec16_uninit()1585// PATTERN: store <4 x i32> splat (i32 [[I32]]), ptr %uninit, align 16, !annotation [[AUTO_INIT]]1586// ZERO-LABEL: @test_intvec16_uninit()1587// ZERO: store <4 x i32> zeroinitializer, ptr %uninit, align 16, !annotation [[AUTO_INIT]]1588 1589TEST_BRACES(intvec16, int __attribute__((vector_size(16))));1590// CHECK-LABEL: @test_intvec16_braces()1591// CHECK: %braces = alloca <4 x i32>, align [[ALIGN:[0-9]*]]1592// CHECK-NEXT: store <4 x i32> zeroinitializer, ptr %braces, align [[ALIGN]]1593// CHECK-NOT: !annotation1594// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1595 1596TEST_CUSTOM(intvec16, int __attribute__((vector_size(16))), { 0x44444444, 0x44444444, 0x44444444, 0x44444444 });1597// CHECK-LABEL: @test_intvec16_custom()1598// CHECK: %custom = alloca <4 x i32>, align [[ALIGN:[0-9]*]]1599// CHECK-NEXT: store <4 x i32> splat (i32 1145324612), ptr %custom, align [[ALIGN]]1600// CHECK-NOT: !annotation1601// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1602 1603TEST_UNINIT(longlongvec32, long long __attribute__((vector_size(32))));1604// CHECK-LABEL: @test_longlongvec32_uninit()1605// CHECK: %uninit = alloca <4 x i64>, align1606// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1607// PATTERN-LABEL: @test_longlongvec32_uninit()1608// PATTERN: store <4 x i64> splat (i64 [[I64]]), ptr %uninit, align 32, !annotation [[AUTO_INIT]]1609// ZERO-LABEL: @test_longlongvec32_uninit()1610// ZERO: store <4 x i64> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]1611 1612TEST_BRACES(longlongvec32, long long __attribute__((vector_size(32))));1613// CHECK-LABEL: @test_longlongvec32_braces()1614// CHECK: %braces = alloca <4 x i64>, align [[ALIGN:[0-9]*]]1615// CHECK-NEXT: store <4 x i64> zeroinitializer, ptr %braces, align [[ALIGN]]1616// CHECK-NOT: !annotation1617// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1618 1619TEST_CUSTOM(longlongvec32, long long __attribute__((vector_size(32))), { 0x3333333333333333, 0x3333333333333333, 0x3333333333333333, 0x3333333333333333 });1620// CHECK-LABEL: @test_longlongvec32_custom()1621// CHECK: %custom = alloca <4 x i64>, align [[ALIGN:[0-9]*]]1622// CHECK-NEXT: store <4 x i64> splat (i64 3689348814741910323), ptr %custom, align [[ALIGN]]1623// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1624 1625TEST_UNINIT(floatvec16, float __attribute__((vector_size(16))));1626// CHECK-LABEL: @test_floatvec16_uninit()1627// CHECK: %uninit = alloca <4 x float>, align1628// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1629// PATTERN-LABEL: @test_floatvec16_uninit()1630// PATTERN: store <4 x float> splat (float 0xFFFFFFFFE0000000), ptr %uninit, align 16, !annotation [[AUTO_INIT]]1631// ZERO-LABEL: @test_floatvec16_uninit()1632// ZERO: store <4 x float> zeroinitializer, ptr %uninit, align 16, !annotation [[AUTO_INIT]]1633 1634TEST_BRACES(floatvec16, float __attribute__((vector_size(16))));1635// CHECK-LABEL: @test_floatvec16_braces()1636// CHECK: %braces = alloca <4 x float>, align [[ALIGN:[0-9]*]]1637// CHECK-NEXT: store <4 x float> zeroinitializer, ptr %braces, align [[ALIGN]]1638// CHECK-NOT: !annotation1639// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1640 1641TEST_CUSTOM(floatvec16, float __attribute__((vector_size(16))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });1642// CHECK-LABEL: @test_floatvec16_custom()1643// CHECK: %custom = alloca <4 x float>, align [[ALIGN:[0-9]*]]1644// CHECK-NEXT: store <4 x float> splat (float 0x400921FB60000000), ptr %custom, align [[ALIGN]]1645// CHECK-NOT: !annotation1646// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1647 1648TEST_UNINIT(doublevec32, double __attribute__((vector_size(32))));1649// CHECK-LABEL: @test_doublevec32_uninit()1650// CHECK: %uninit = alloca <4 x double>, align1651// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1652// PATTERN-LABEL: @test_doublevec32_uninit()1653// PATTERN: store <4 x double> splat (double 0xFFFFFFFFFFFFFFFF), ptr %uninit, align 32, !annotation [[AUTO_INIT]]1654// ZERO-LABEL: @test_doublevec32_uninit()1655// ZERO: store <4 x double> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]1656 1657TEST_BRACES(doublevec32, double __attribute__((vector_size(32))));1658// CHECK-LABEL: @test_doublevec32_braces()1659// CHECK: %braces = alloca <4 x double>, align [[ALIGN:[0-9]*]]1660// CHECK-NEXT: store <4 x double> zeroinitializer, ptr %braces, align [[ALIGN]]1661// CHECK-NOT: !annotation1662// CHECK-NEXT: call void @{{.*}}used{{.*}}%braces)1663 1664TEST_CUSTOM(doublevec32, double __attribute__((vector_size(32))), { 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433, 3.1415926535897932384626433 });1665// CHECK-LABEL: @test_doublevec32_custom()1666// CHECK: %custom = alloca <4 x double>, align [[ALIGN:[0-9]*]]1667// CHECK-NEXT: store <4 x double> splat (double 0x400921FB54442D18), ptr %custom, align [[ALIGN]]1668// CHECK-NOT: !annotation1669// CHECK-NEXT: call void @{{.*}}used{{.*}}%custom)1670 1671// TODO: This vector has tail padding1672TEST_UNINIT(doublevec24, double __attribute__((vector_size(24))));1673// CHECK-LABEL: @test_doublevec24_uninit()1674// CHECK: %uninit = alloca <3 x double>, align1675// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1676// PATTERN-LABEL: @test_doublevec24_uninit()1677// PATTERN: store <3 x double> splat (double 0xFFFFFFFFFFFFFFFF), ptr %uninit, align 32, !annotation [[AUTO_INIT]]1678// ZERO-LABEL: @test_doublevec24_uninit()1679// ZERO: store <3 x double> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]1680 1681// TODO: This vector has tail padding1682TEST_UNINIT(longdoublevec32, long double __attribute__((vector_size(sizeof(long double)*2))));1683// CHECK-LABEL: @test_longdoublevec32_uninit()1684// CHECK: %uninit = alloca <2 x x86_fp80>, align1685// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)1686// PATTERN-LABEL: @test_longdoublevec32_uninit()1687// PATTERN: store <2 x x86_fp80> splat (x86_fp80 0xKFFFFFFFFFFFFFFFFFFFF), ptr %uninit, align 32, !annotation [[AUTO_INIT]]1688// ZERO-LABEL: @test_longdoublevec32_uninit()1689// ZERO: store <2 x x86_fp80> zeroinitializer, ptr %uninit, align 32, !annotation [[AUTO_INIT]]1690 1691} // extern "C"1692 1693// PATTERN: [[AUTO_INIT]] = !{!"auto-init"}1694// ZERO: [[AUTO_INIT]] = !{!"auto-init"}1695