@@ -183,3 +183,25 @@ void generic_selection() {
183183// OGCG: %[[C_ADDR:.*]] = alloca i32, align 4
184184// OGCG: %[[D_ADDR:.*]] = alloca %struct.CompleteS, align 4
185185// OGCG: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[D_ADDR]], ptr align 4 %[[A_ADDR]], i64 8, i1 false)
186+
187+ void bin_comma () {
188+ CompleteS a = (CompleteS (), CompleteS ());
189+ }
190+
191+ // CIR: cir.func{{.*}} @_Z9bin_commav()
192+ // CIR: %[[A_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["a", init]
193+ // CIR: %[[TMP_ADDR:.*]] = cir.alloca !rec_CompleteS, !cir.ptr<!rec_CompleteS>, ["agg.tmp0"]
194+ // CIR: %[[ZERO:.*]] = cir.const #cir.zero : !rec_CompleteS
195+ // CIR: cir.store{{.*}} %[[ZERO]], %[[TMP_ADDR]] : !rec_CompleteS, !cir.ptr<!rec_CompleteS>
196+ // CIR: %[[ZERO:.*]] = cir.const #cir.zero : !rec_CompleteS
197+ // CIR: cir.store{{.*}} %[[ZERO]], %[[A_ADDR]] : !rec_CompleteS, !cir.ptr<!rec_CompleteS>
198+
199+ // LLVM: define{{.*}} void @_Z9bin_commav()
200+ // LLVM: %[[A_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 4
201+ // LLVM: %[[TMP_ADDR:.*]] = alloca %struct.CompleteS, i64 1, align 4
202+ // LLVM: store %struct.CompleteS zeroinitializer, ptr %[[TMP_ADDR]], align 4
203+ // LLVM: store %struct.CompleteS zeroinitializer, ptr %[[A_ADDR]], align 4
204+
205+ // OGCG: define{{.*}} void @_Z9bin_commav()
206+ // OGCG: %[[A_ADDR:.*]] = alloca %struct.CompleteS, align 4
207+ // OGCG: call void @llvm.memset.p0.i64(ptr align 4 %[[A_ADDR]], i8 0, i64 8, i1 false)
0 commit comments