@@ -14,11 +14,11 @@ struct { int y[]; } b1 = { { 14, 16 } };
1414
1515// sizeof(c) == 8, so this global should be at least 8 bytes.
1616struct { int x ; char c ; char y []; } c = { 1 , 2 , { 13 , 15 } };
17- // CHECK: @c ={{.*}} global { i32, i8, [2 x i8] } { i32 1, i8 2, [2 x i8] c"\0D\0F" }
17+ // CHECK: @c ={{.*}} global { i32, i8, [2 x i8], [1 x i8] } { i32 1, i8 2, [2 x i8] c"\0D\0F", [1 x i8] zeroinitializer }
1818
1919// sizeof(d) == 8, so this global should be at least 8 bytes.
2020struct __attribute((packed , aligned (4 ))) { char a ; int x ; char z []; } d = { 1 , 2 , { 13 , 15 } };
21- // CHECK: @d ={{.*}} <{ i8, i32, [2 x i8], i8 }> <{ i8 1, i32 2, [2 x i8] c"\0D\0F", i8 undef }>,
21+ // CHECK: @d ={{.*}} <{ i8, i32, [2 x i8], i8 }> <{ i8 1, i32 2, [2 x i8] c"\0D\0F", i8 0 }>,
2222
2323// This global needs 9 bytes to hold all the flexible array members.
2424struct __attribute((packed , aligned (4 ))) { char a ; int x ; char z []; } e = { 1 , 2 , { 13 , 15 , 17 , 19 } };
@@ -55,21 +55,21 @@ struct { int a; union { int b; short x[]; }; int c; int d; } hf = {1, 2, {}, 3};
5555
5656// First member is the potential flexible array, initialization requires braces.
5757struct { int a ; union { short x ; int b ; }; int c ; int d ; } i = {1 , 2 , {}, 3 };
58- // CHECK: @i = global { i32, { i16, [2 x i8] }, i32, i32 } { i32 1, { i16, [2 x i8] } { i16 2, [2 x i8] undef }, i32 0, i32 3 }
58+ // CHECK: @i = global { i32, { i16, [2 x i8] }, i32, i32 } { i32 1, { i16, [2 x i8] } { i16 2, [2 x i8] zeroinitializer }, i32 0, i32 3 }
5959struct { int a ; union { short x [0 ]; int b ; }; int c ; int d ; } i0 = {1 , {}, 2 , 3 };
60- // CHECK: @i0 = global { i32, { [0 x i16], [4 x i8] }, i32, i32 } { i32 1, { [0 x i16], [4 x i8] } { [0 x i16] zeroinitializer, [4 x i8] undef } , i32 2, i32 3 }
60+ // CHECK: @i0 = global { i32, { [0 x i16], [4 x i8] }, i32, i32 } { i32 1, { [0 x i16], [4 x i8] } zeroinitializer, i32 2, i32 3 }
6161struct { int a ; union { short x [1 ]; int b ; }; int c ; int d ; } i1 = {1 , {2 }, {}, 3 };
62- // CHECK: @i1 = global { i32, { [1 x i16], [2 x i8] }, i32, i32 } { i32 1, { [1 x i16], [2 x i8] } { [1 x i16] [i16 2], [2 x i8] undef }, i32 0, i32 3 }
62+ // CHECK: @i1 = global { i32, { [1 x i16], [2 x i8] }, i32, i32 } { i32 1, { [1 x i16], [2 x i8] } { [1 x i16] [i16 2], [2 x i8] zeroinitializer }, i32 0, i32 3 }
6363struct { int a ; union { short x []; int b ; }; int c ; int d ; } i_f = {4 , {}, {}, 6 };
64- // CHECK: @i_f = global { i32, { [0 x i16], [4 x i8] }, i32, i32 } { i32 4, { [0 x i16], [4 x i8] } { [0 x i16] zeroinitializer, [4 x i8] undef } , i32 0, i32 6 }
64+ // CHECK: @i_f = global { i32, { [0 x i16], [4 x i8] }, i32, i32 } { i32 4, { [0 x i16], [4 x i8] } zeroinitializer, i32 0, i32 6 }
6565
6666// Named initializers; order doesn't matter.
6767struct { int a ; union { int b ; short x ; }; int c ; int d ; } hn = {.a = 1 , .x = 2 , .c = 3 };
68- // CHECK: @hn = global { i32, { i16, [2 x i8] }, i32, i32 } { i32 1, { i16, [2 x i8] } { i16 2, [2 x i8] undef }, i32 3, i32 0 }
68+ // CHECK: @hn = global { i32, { i16, [2 x i8] }, i32, i32 } { i32 1, { i16, [2 x i8] } { i16 2, [2 x i8] zeroinitializer }, i32 3, i32 0 }
6969struct { int a ; union { int b ; short x [0 ]; }; int c ; int d ; } hn0 = {.a = 1 , .x = {2 }, .c = 3 };
70- // CHECK: @hn0 = global { i32, { [0 x i16], [4 x i8] }, i32, i32 } { i32 1, { [0 x i16], [4 x i8] } { [0 x i16] zeroinitializer, [4 x i8] undef } , i32 3, i32 0 }
70+ // CHECK: @hn0 = global { i32, { [0 x i16], [4 x i8] }, i32, i32 } { i32 1, { [0 x i16], [4 x i8] } zeroinitializer, i32 3, i32 0 }
7171struct { int a ; union { int b ; short x [1 ]; }; int c ; int d ; } hn1 = {.a = 1 , .x = {2 }, .c = 3 };
72- // CHECK: @hn1 = global { i32, { [1 x i16], [2 x i8] }, i32, i32 } { i32 1, { [1 x i16], [2 x i8] } { [1 x i16] [i16 2], [2 x i8] undef }, i32 3, i32 0 }
72+ // CHECK: @hn1 = global { i32, { [1 x i16], [2 x i8] }, i32, i32 } { i32 1, { [1 x i16], [2 x i8] } { [1 x i16] [i16 2], [2 x i8] zeroinitializer }, i32 3, i32 0 }
7373
7474struct { char a []; } empty_struct = {};
7575// CHECK: @empty_struct ={{.*}} global %struct.anon{{.*}} zeroinitializer, align 1
@@ -96,10 +96,10 @@ union { char a[]; } only_in_union0 = {0};
9696// CHECK: @only_in_union0 = global { [1 x i8] } zeroinitializer, align 1
9797
9898union { char a []; int b ; } first_in_union = {};
99- // CHECK: @first_in_union = global { [0 x i8], [4 x i8] } { [0 x i8] zeroinitializer, [4 x i8] undef } , align 4
99+ // CHECK: @first_in_union = global { [0 x i8], [4 x i8] } zeroinitializer, align 4
100100
101101union { char a []; int b ; } first_in_union0 = {0 };
102- // CHECK: @first_in_union0 = global { [1 x i8], [3 x i8] } { [1 x i8] zeroinitializer, [3 x i8] undef } , align 4
102+ // CHECK: @first_in_union0 = global { [1 x i8], [3 x i8] } zeroinitializer, align 4
103103
104104union { char a []; int b ; } first_in_union123 = { {1 , 2 , 3 } };
105- // CHECK: @first_in_union123 = global { [3 x i8], i8 } { [3 x i8] c"\01\02\03", i8 undef }, align 4
105+ // CHECK: @first_in_union123 = global { [3 x i8], i8 } { [3 x i8] c"\01\02\03", i8 0 }, align 4
0 commit comments