@@ -717,6 +717,24 @@ void foo27(bool cond, int _Complex a, int _Complex b) {
717717// OGCG: store i32 %[[REAL]], ptr %[[RESULT_REAL_PTR]], align 4
718718// OGCG: store i32 %[[IMAG]], ptr %[[RESULT_IMAG_PTR]], align 4
719719
720+ void foo28 () {
721+ using IntComplex = int _Complex ;
722+ int _Complex a = IntComplex ();
723+ }
724+
725+ // CIR: %[[INIT:.*]] = cir.alloca !cir.complex<!s32i>, !cir.ptr<!cir.complex<!s32i>>, ["a", init]
726+ // CIR: %[[COMPLEX:.*]] = cir.const #cir.const_complex<#cir.int<0> : !s32i, #cir.int<0> : !s32i> : !cir.complex<!s32i>
727+ // CIR: cir.store align(4) %[[COMPLEX]], %[[INIT]] : !cir.complex<!s32i>, !cir.ptr<!cir.complex<!s32i>>
728+
729+ // LLVM: %[[INIT:.*]] = alloca { i32, i32 }, i64 1, align 4
730+ // LLVM: store { i32, i32 } zeroinitializer, ptr %[[INIT]], align 4
731+
732+ // OGCG: %[[INIT:.*]] = alloca { i32, i32 }, align 4
733+ // OGCG: %[[INIT_REAL_PTR:.*]] = getelementptr inbounds nuw { i32, i32 }, ptr %[[INIT]], i32 0, i32 0
734+ // OGCG: %[[INIT_IMAG_PTR:.*]] = getelementptr inbounds nuw { i32, i32 }, ptr %[[INIT]], i32 0, i32 1
735+ // OGCG: store i32 0, ptr %[[INIT_REAL_PTR]], align 4
736+ // OGCG: store i32 0, ptr %[[INIT_IMAG_PTR]], align 4
737+
720738void foo29 () {
721739 using IntComplex = int _Complex ;
722740 int _Complex a = IntComplex{};
0 commit comments