@@ -89,22 +89,14 @@ struct padded { char c; int i; };
8989// PATTERN-O1-NOT: @__const.test_paddednullinit_custom.custom
9090struct paddednullinit { char c = 0 ; int i = 0 ; };
9191// PATTERN-O0: @__const.test_paddedpacked_uninit.uninit = private unnamed_addr constant %struct.paddedpacked <{ i8 [[I8]], i32 [[I32]] }>, align 1
92- // PATTERN: @__const.test_paddedpacked_custom.custom = private unnamed_addr constant %struct.paddedpacked <{ i8 42, i32 13371337 }>, align 1
93- // ZERO: @__const.test_paddedpacked_custom.custom = private unnamed_addr constant %struct.paddedpacked <{ i8 42, i32 13371337 }>, align 1
9492struct paddedpacked { char c; int i; } __attribute__((packed));
9593// PATTERN-O0: @__const.test_paddedpackedarray_uninit.uninit = private unnamed_addr constant %struct.paddedpackedarray { [2 x %struct.paddedpacked] [%struct.paddedpacked <{ i8 [[I8]], i32 [[I32]] }>, %struct.paddedpacked <{ i8 [[I8]], i32 [[I32]] }>] }, align 1
96- // PATTERN: @__const.test_paddedpackedarray_custom.custom = private unnamed_addr constant %struct.paddedpackedarray { [2 x %struct.paddedpacked] [%struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }>] }, align 1
97- // ZERO: @__const.test_paddedpackedarray_custom.custom = private unnamed_addr constant %struct.paddedpackedarray { [2 x %struct.paddedpacked] [%struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }>] }, align 1
9894struct paddedpackedarray { struct paddedpacked p[2 ]; };
9995// PATTERN-O0: @__const.test_unpackedinpacked_uninit.uninit = private unnamed_addr constant <{ { i8, [3 x i8], i32 }, i8 }> <{ { i8, [3 x i8], i32 } { i8 [[I8]], [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]", i32 [[I32]] }, i8 [[I8]] }>, align 1
10096struct unpackedinpacked { padded a; char b; } __attribute__((packed));
10197// PATTERN-O0: @__const.test_paddednested_uninit.uninit = private unnamed_addr constant { { i8, [3 x i8], i32 }, { i8, [3 x i8], i32 } } { { i8, [3 x i8], i32 } { i8 [[I8]], [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]", i32 [[I32]] }, { i8, [3 x i8], i32 } { i8 [[I8]], [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]", i32 [[I32]] } }, align 4
102- // PATTERN: @__const.test_paddednested_custom.custom = private unnamed_addr constant { { i8, [3 x i8], i32 }, { i8, [3 x i8], i32 } } { { i8, [3 x i8], i32 } { i8 42, [3 x i8] zeroinitializer, i32 13371337 }, { i8, [3 x i8], i32 } { i8 43, [3 x i8] zeroinitializer, i32 13371338 } }, align 4
103- // ZERO: @__const.test_paddednested_custom.custom = private unnamed_addr constant { { i8, [3 x i8], i32 }, { i8, [3 x i8], i32 } } { { i8, [3 x i8], i32 } { i8 42, [3 x i8] zeroinitializer, i32 13371337 }, { i8, [3 x i8], i32 } { i8 43, [3 x i8] zeroinitializer, i32 13371338 } }, align 4
10498struct paddednested { struct padded p1, p2; };
10599// PATTERN-O0: @__const.test_paddedpackednested_uninit.uninit = private unnamed_addr constant %struct.paddedpackednested { %struct.paddedpacked <{ i8 [[I8]], i32 [[I32]] }>, %struct.paddedpacked <{ i8 [[I8]], i32 [[I32]] }> }, align 1
106- // PATTERN: @__const.test_paddedpackednested_custom.custom = private unnamed_addr constant %struct.paddedpackednested { %struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }> }, align 1
107- // ZERO: @__const.test_paddedpackednested_custom.custom = private unnamed_addr constant %struct.paddedpackednested { %struct.paddedpacked <{ i8 42, i32 13371337 }>, %struct.paddedpacked <{ i8 43, i32 13371338 }> }, align 1
108100struct paddedpackednested { struct paddedpacked p1, p2; };
109101// PATTERN-O0: @__const.test_bitfield_uninit.uninit = private unnamed_addr constant %struct.bitfield { i8 [[I8]], [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]" }, align 4
110102// PATTERN-O0: @__const.test_bitfield_custom.custom = private unnamed_addr constant %struct.bitfield { i8 20, [3 x i8] c"\[[IC]]\[[IC]]\[[IC]]" }, align 4
@@ -142,12 +134,8 @@ struct arraytail { int i; int arr[]; };
142134// PATTERN-O1-NOT: @__const.test_bool4_custom.custom
143135// ZERO-O1-NOT: @__const.test_bool4_custom.custom
144136
145- // PATTERN: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x ptr] [ptr inttoptr ([[IPTRT]] 572662306 to ptr), ptr inttoptr ([[IPTRT]] 572662306 to ptr), ptr inttoptr ([[IPTRT]] 572662306 to ptr), ptr inttoptr ([[IPTRT]] 572662306 to ptr)], align
146- // ZERO: @__const.test_intptr4_custom.custom = private unnamed_addr constant [4 x ptr] [ptr inttoptr (i64 572662306 to ptr), ptr inttoptr (i64 572662306 to ptr), ptr inttoptr (i64 572662306 to ptr), ptr inttoptr (i64 572662306 to ptr)], align 16
147137// PATTERN-O0: @__const.test_tailpad4_uninit.uninit = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }, { i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }, { i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }, { i16, i8, [1 x i8] } { i16 [[I16]], i8 [[I8]], [1 x i8] c"\[[IC]]" }], align
148138// PATTERN-O1-NOT: @__const.test_tailpad4_uninit.uninit
149- // PATTERN: @__const.test_tailpad4_custom.custom = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }], align
150- // ZERO: @__const.test_tailpad4_custom.custom = private unnamed_addr constant [4 x { i16, i8, [1 x i8] }] [{ i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }, { i16, i8, [1 x i8] } { i16 257, i8 1, [1 x i8] zeroinitializer }], align 16
151139struct tailpad { short s; char c; };
152140// PATTERN-O0: @__const.test_atomicnotlockfree_uninit.uninit = private unnamed_addr constant %struct.notlockfree { [4 x i64] {{\[}}i64 [[I64]], i64 [[I64]], i64 [[I64]], i64 [[I64]]] }, align
153141// PATTERN-O1-NOT: @__const.test_atomicnotlockfree_uninit.uninit
@@ -714,7 +702,8 @@ TEST_UNINIT(padded, padded);
714702// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
715703// PATTERN-LABEL: @test_padded_uninit()
716704// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_padded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
717- // PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
705+ // PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8
706+ // PATTERN-O1-NOT: !annotation
718707// ZERO-LABEL: @test_padded_uninit()
719708// ZERO-O0: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
720709// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
@@ -740,7 +729,8 @@ TEST_UNINIT(paddednullinit, paddednullinit);
740729// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
741730// PATTERN-LABEL: @test_paddednullinit_uninit()
742731// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddednullinit_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
743- // PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
732+ // PATTERN-O1: store i64 [[I64]], ptr %uninit, align 8
733+ // PATTERN-O1-NOT: !annotation
744734// ZERO-LABEL: @test_paddednullinit_uninit()
745735// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.*}}, !annotation [[AUTO_INIT]]
746736// ZERO-O1: store i64 0, ptr %uninit, align 8
@@ -778,9 +768,8 @@ TEST_UNINIT(paddedpacked, paddedpacked);
778768// PATTERN-LABEL: @test_paddedpacked_uninit()
779769// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_paddedpacked_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
780770// PATTERN-O1: store i8 [[I8]], ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
781- // PATTERN-O1: %[[I:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 1
771+ // PATTERN-O1: %[[I:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 1
782772// PATTERN-O1: store i32 [[I32]], ptr %[[I]], align {{.+}}, !annotation [[AUTO_INIT]]
783-
784773// ZERO-LABEL: @test_paddedpacked_uninit()
785774// ZERO: call void @llvm.memset{{.*}}, i8 0,{{.+}}), !annotation [[AUTO_INIT]]
786775
@@ -1192,7 +1181,8 @@ TEST_UNINIT(atomicpadded, _Atomic(padded));
11921181// CHECK-NEXT: call void @{{.*}}used{{.*}}%uninit)
11931182// PATTERN-LABEL: @test_atomicpadded_uninit()
11941183// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_atomicpadded_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
1195- // PATTERN-O1: store i64 [[IPTR]], ptr %uninit, align 8, !annotation [[AUTO_INIT]]
1184+ // PATTERN-O1: store i64 [[IPTR]], ptr %uninit, align 8
1185+ // PATTERN-O1-NOT: !annotation
11961186// ZERO-LABEL: @test_atomicpadded_uninit()
11971187// ZERO-O0: call void @llvm.memset{{.*}}, i8 0, {{.+}}), !annotation [[AUTO_INIT]]
11981188// ZERO-O1: store i64 0, ptr %uninit, align 8, !annotation [[AUTO_INIT]]
@@ -1214,8 +1204,7 @@ TEST_UNINIT(complexfloat, _Complex float);
12141204// PATTERN-LABEL: @test_complexfloat_uninit()
12151205// PATTERN-O0: call void @llvm.memcpy{{.*}} @__const.test_complexfloat_uninit.uninit{{.+}}), !annotation [[AUTO_INIT]]
12161206// PATTERN-O1: store float 0xFFFFFFFFE0000000, ptr %uninit, align {{.+}}, !annotation [[AUTO_INIT]]
1217-
1218- // PATTERN-O1: %[[F2:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 0, i32 1
1207+ // PATTERN-O1: %[[F2:[^ ]*]] = getelementptr inbounds {{.*}}%uninit, i64 4
12191208// PATTERN-O1: store float 0xFFFFFFFFE0000000, ptr %[[F2]], align {{.+}}, !annotation [[AUTO_INIT]]
12201209
12211210// ZERO-LABEL: @test_complexfloat_uninit()
@@ -1314,7 +1303,9 @@ TEST_CUSTOM(semivolatile, semivolatile, { 0x44444444, 0x44444444 });
13141303// CHECK-O0: call void @llvm.memcpy
13151304// CHECK-NOT: !annotation
13161305// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
1317- // CHECK-O1: store i64 4919131752989213764, ptr %custom, align 8
1306+ // CHECK-O1: store i32 1145324612, ptr %custom, align 4
1307+ // CHECK-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds i8, ptr %custom, i64 4
1308+ // CHECK-O1-NEXT: store i32 1145324612, ptr %[[I]], align 4
13181309// CHECK-NOT: !annotation
13191310
13201311TEST_UNINIT (semivolatileinit, semivolatileinit);
@@ -1427,7 +1418,7 @@ TEST_CUSTOM(matching, matching, { .f = 0xf00f });
14271418// CHECK-O0: call void @llvm.memcpy
14281419// CHECK-NOT: !annotation
14291420// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
1430- // CHECK-O1: store i32 1198526208 , ptr {{.*}}, align 4
1421+ // CHECK-O1: store float 6.145500e+04 , ptr {{.*}}, align 4
14311422// CHECK-NOT: !annotation
14321423
14331424TEST_UNINIT (matchingreverse, matchingreverse);
@@ -1506,8 +1497,16 @@ TEST_CUSTOM(unmatchedreverse, unmatchedreverse, { .c = 42 });
15061497// CHECK-O0: call void @llvm.memcpy
15071498// CHECK-NOT: !annotation
15081499// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
1509- // PATTERN-O1: store i32 -1431655894, ptr {{.*}}, align 4
1510- // ZERO-O1: store i32 42, ptr {{.*}}, align 4
1500+ // PATTERN-O1: store i8 42, ptr {{.*}}, align 4
1501+ // PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds i8, ptr %custom, i64 1
1502+ // PATTERN-O1-NEXT: store i8 -86, ptr %[[I]], align {{.*}}
1503+ // PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds i8, ptr %custom, i64 2
1504+ // PATTERN-O1-NEXT: store i8 -86, ptr %[[I]], align {{.*}}
1505+ // PATTERN-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds i8, ptr %custom, i64 3
1506+ // PATTERN-O1-NEXT: store i8 -86, ptr %[[I]], align {{.*}}
1507+ // ZERO-O1: store i8 42, ptr {{.*}}, align 4
1508+ // ZERO-O1-NEXT: %[[I:[^ ]*]] = getelementptr inbounds i8, ptr %custom, i64 1
1509+ // ZERO-O1-NEXT: call void @llvm.memset.{{.*}}({{.*}}, i8 0, i64 3, {{.*}})
15111510
15121511TEST_UNINIT (unmatchedfp, unmatchedfp);
15131512// CHECK-LABEL: @test_unmatchedfp_uninit()
@@ -1532,7 +1531,7 @@ TEST_CUSTOM(unmatchedfp, unmatchedfp, { .d = 3.1415926535897932384626433 });
15321531// CHECK-O0: call void @llvm.memcpy
15331532// CHECK-NOT: !annotation
15341533// CHECK-O0: call void @{{.*}}used{{.*}}%custom)
1535- // CHECK-O1: store i64 4614256656552045848 , ptr %custom, align 8
1534+ // CHECK-O1: store double 0x400921FB54442D18 , ptr %custom, align 8
15361535// CHECK-NOT: !annotation
15371536
15381537TEST_UNINIT (emptyenum, emptyenum);
0 commit comments