@@ -228,3 +228,21 @@ void complex_init_atomic() {
228228// OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
229229// OGCG: store float 1.000000e+00, ptr %[[A_REAL_PTR]], align 8
230230// OGCG: store float 2.000000e+00, ptr %[[A_IMAG_PTR]], align 4
231+
232+ void complex_opaque_value_expr () {
233+ float _Complex a;
234+ float b = 1 .0f ?: __real__ a;
235+ }
236+
237+ // CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a"]
238+ // CIR: %[[B_ADDR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["b", init]
239+ // CIR: %[[CONST_1:.*]] = cir.const #cir.fp<1.000000e+00> : !cir.float
240+ // CIR: cir.store align(4) %[[CONST_1]], %[[B_ADDR]] : !cir.float, !cir.ptr<!cir.float>
241+
242+ // LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 4
243+ // LLVM: %[[B_ADDR:.*]] = alloca float, i64 1, align 4
244+ // LLVM: store float 1.000000e+00, ptr %[[B_ADDR]], align 4
245+
246+ // OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 4
247+ // OGCG: %[[B_ADDR:.*]] = alloca float, align 4
248+ // OGCG: store float 1.000000e+00, ptr %[[B_ADDR]], align 4
0 commit comments