diff options
Diffstat (limited to 'clang/test/CIR/CodeGen/struct-init.cpp')
| -rw-r--r-- | clang/test/CIR/CodeGen/struct-init.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/clang/test/CIR/CodeGen/struct-init.cpp b/clang/test/CIR/CodeGen/struct-init.cpp index 7988619..8f14668 100644 --- a/clang/test/CIR/CodeGen/struct-init.cpp +++ b/clang/test/CIR/CodeGen/struct-init.cpp @@ -65,41 +65,16 @@ void init() { // CIR: cir.func{{.*}} @_Z4initv() // CIR: %[[S1:.*]] = cir.alloca !rec_S, !cir.ptr<!rec_S>, ["s1", init] // CIR: %[[S2:.*]] = cir.alloca !rec_S, !cir.ptr<!rec_S>, ["s2", init] -// CIR: %[[S1_A:.*]] = cir.get_member %[[S1]][0] {name = "a"} -// CIR: %[[ONE:.*]] = cir.const #cir.int<1> -// CIR: cir.store{{.*}} %[[ONE]], %[[S1_A]] -// CIR: %[[S1_B:.*]] = cir.get_member %[[S1]][1] {name = "b"} -// CIR: %[[TWO:.*]] = cir.const #cir.int<2> -// CIR: cir.store{{.*}} %[[TWO]], %[[S1_B]] -// CIR: %[[S1_C:.*]] = cir.get_member %[[S1]][2] {name = "c"} -// CIR: %[[THREE:.*]] = cir.const #cir.int<3> -// CIR: cir.store{{.*}} %[[THREE]], %[[S1_C]] -// CIR: %[[S2_A:.*]] = cir.get_member %[[S2]][0] {name = "a"} -// CIR: %[[FOUR:.*]] = cir.const #cir.int<4> -// CIR: cir.store{{.*}} %[[FOUR]], %[[S2_A]] -// CIR: %[[S2_B:.*]] = cir.get_member %[[S2]][1] {name = "b"} -// CIR: %[[FIVE:.*]] = cir.const #cir.int<5> -// CIR: cir.store{{.*}} %[[FIVE]], %[[S2_B]] -// CIR: %[[S2_C:.*]] = cir.get_member %[[S2]][2] {name = "c"} -// CIR: %[[ZERO:.*]] = cir.const #cir.int<0> -// CIR: cir.store{{.*}} %[[ZERO]], %[[S2_C]] -// CIR: cir.return +// CIR: %[[CONST_1:.*]] = cir.const #cir.const_record<{#cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i}> : !rec_S +// CIR: cir.store{{.*}} %[[CONST_1]], %[[S1]] +// CIR: %[[CONST_2:.*]] = cir.const #cir.const_record<{#cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<0> : !s32i}> : !rec_S +// CIR: cir.store{{.*}} %[[CONST_2]], %[[S2]] // LLVM: define{{.*}} void @_Z4initv() // LLVM: %[[S1:.*]] = alloca %struct.S // LLVM: %[[S2:.*]] = alloca %struct.S -// LLVM: %[[S1_A:.*]] = getelementptr %struct.S, ptr %[[S1]], i32 0, i32 0 -// LLVM: store i32 1, ptr %[[S1_A]] -// LLVM: %[[S1_B:.*]] = getelementptr %struct.S, ptr %[[S1]], i32 0, i32 1 -// LLVM: store i32 2, ptr %[[S1_B]] -// LLVM: %[[S1_C:.*]] = getelementptr %struct.S, ptr %[[S1]], i32 0, i32 2 -// LLVM: store i32 3, ptr %[[S1_C]] -// LLVM: %[[S2_A:.*]] = getelementptr %struct.S, ptr %[[S2]], i32 0, i32 0 -// LLVM: store i32 4, ptr %[[S2_A]] -// LLVM: %[[S2_B:.*]] = getelementptr %struct.S, ptr %[[S2]], i32 0, i32 1 -// LLVM: store i32 5, ptr %[[S2_B]] -// LLVM: %[[S2_C:.*]] = getelementptr %struct.S, ptr %[[S2]], i32 0, i32 2 -// LLVM: store i32 0, ptr %[[S2_C]] +// LLVM: store %struct.S { i32 1, i32 2, i32 3 }, ptr %[[S1]], align 4 +// LLVM: store %struct.S { i32 4, i32 5, i32 0 }, ptr %[[S2]], align 4 // OGCG: @__const._Z4initv.s1 = private unnamed_addr constant %struct.S { i32 1, i32 2, i32 3 } // OGCG: @__const._Z4initv.s2 = private unnamed_addr constant %struct.S { i32 4, i32 5, i32 0 } |
