@@ -210,3 +210,21 @@ void complex_cxx_default_init_expr() {
210210// OGCG: %[[C_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[C_ADDR]], i32 0, i32 1
211211// OGCG: store float 0.000000e+00, ptr %[[C_REAL_PTR]], align 4
212212// OGCG: store float 0.000000e+00, ptr %[[C_IMAG_PTR]], align 4
213+
214+ void complex_init_atomic () {
215+ _Atomic (float _Complex ) a;
216+ __c11_atomic_init (&a, {1 .0f , 2 .0f });
217+ }
218+
219+ // CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a"]
220+ // CIR: %[[CONST_COMPLEX:.*]] = cir.const #cir.complex<#cir.fp<1.000000e+00> : !cir.float, #cir.fp<2.000000e+00> : !cir.float> : !cir.complex<!cir.float>
221+ // CIR: cir.store{{.*}} %[[CONST_COMPLEX]], %[[A_ADDR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
222+
223+ // LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 8
224+ // LLVM: store { float, float } { float 1.000000e+00, float 2.000000e+00 }, ptr %[[A_ADDR]], align 8
225+
226+ // OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 8
227+ // OGCG: %[[A_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 0
228+ // OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
229+ // OGCG: store float 1.000000e+00, ptr %[[A_REAL_PTR]], align 8
230+ // OGCG: store float 2.000000e+00, ptr %[[A_IMAG_PTR]], align 4
0 commit comments