@@ -909,3 +909,21 @@ void foo33(__builtin_va_list a) {
909909// OGCG: %[[B_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[B_ADDR]], i32 0, i32 1
910910// OGCG: store float %[[RESULT_REAL]], ptr %[[B_REAL_PTR]], align 4
911911// OGCG: store float %[[RESULT_IMAG]], ptr %[[B_IMAG_PTR]], align 4
912+
913+ void foo34 () {
914+ _Atomic (float _Complex ) a;
915+ __c11_atomic_init (&a, {1 .0f , 2 .0f });
916+ }
917+
918+ // CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a"]
919+ // CIR: %[[CONST_COMPLEX:.*]] = cir.const #cir.const_complex<#cir.fp<1.000000e+00> : !cir.float, #cir.fp<2.000000e+00> : !cir.float> : !cir.complex<!cir.float>
920+ // CIR: cir.store{{.*}} %[[CONST_COMPLEX]], %[[A_ADDR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
921+
922+ // LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 8
923+ // LLVM: store { float, float } { float 1.000000e+00, float 2.000000e+00 }, ptr %[[A_ADDR]], align 8
924+
925+ // OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 8
926+ // OGCG: %[[A_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 0
927+ // OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
928+ // OGCG: store float 1.000000e+00, ptr %[[A_REAL_PTR]], align 8
929+ // OGCG: store float 2.000000e+00, ptr %[[A_IMAG_PTR]], align 4
0 commit comments