diff --git a/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp b/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp index 24b6145a33da..2ee53520fa0a 100644 --- a/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp @@ -172,7 +172,7 @@ class AggExprEmitter : public StmtVisitor { << S->getStmtClassName() << "\n"; llvm_unreachable("NYI"); } - void VisitParenExpr(ParenExpr *PE) { llvm_unreachable("NYI"); } + void VisitParenExpr(ParenExpr *PE) { Visit(PE->getSubExpr()); } void VisitGenericSelectionExpr(GenericSelectionExpr *GE) { llvm_unreachable("NYI"); } diff --git a/clang/test/CIR/CodeGen/agg-copy.c b/clang/test/CIR/CodeGen/agg-copy.c index cbc1565dd7f2..9b7f982716d5 100644 --- a/clang/test/CIR/CodeGen/agg-copy.c +++ b/clang/test/CIR/CodeGen/agg-copy.c @@ -72,4 +72,14 @@ A create() { A a; return a; } void foo5() { A a; a = create(); +} + +void foo6(A* a1) { + A a2 = (*a1); +// CHECK: cir.func {{.*@foo6}} +// CHECK: [[TMP0]] = cir.alloca !cir.ptr, cir.ptr >, ["a1", init] {alignment = 8 : i64} +// CHECK: [[TMP1]] = cir.alloca !ty_22A22, cir.ptr , ["a2", init] {alignment = 4 : i64} +// CHECK: cir.store %arg0, [[TMP0]] : !cir.ptr, cir.ptr > +// CHECK: [[TMP2]] = cir.load deref [[TMP0]] : cir.ptr >, !cir.ptr +// CHECK: cir.copy [[TMP2]] to [[TMP1]] : !cir.ptr } \ No newline at end of file