Skip to content

Commit b581ea8

Browse files
Update CIR test to reflect changes in trivial copy ctor
- Replaced expected copy constructor calls with direct cir.copy operations in the tests for both A and C structs. - Updated LLVM output to reflect the new memcpy operation, aligning with recent optimizations in CIR code generation for trivial copy constructs.
1 parent c79da29 commit b581ea8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/test/CIR/CodeGen/structural-binding.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void f(A &a) {
6161

6262
auto [x2, y2, z2] = a;
6363
(x2, y2, z2);
64-
// CIR: cir.call @_ZN1AC1ERKS_(%2, {{.*}}) : (!cir.ptr<!rec_A>, !cir.ptr<!rec_A>) -> ()
64+
// CIR: cir.copy %[[a:.*]] to %2 : !cir.ptr<!rec_A>
6565
// CIR: {{.*}} = cir.get_member %2[0] {name = "a"} : !cir.ptr<!rec_A> -> !cir.ptr<!rec_B>
6666
// CIR: {{.*}} = cir.get_member %2[2] {name = "b"} : !cir.ptr<!rec_A> -> !cir.ptr<!s32i>
6767
// CIR: {{.*}} = cir.get_member %2[3] {name = "c"} : !cir.ptr<!rec_A> -> !cir.ptr<!s8i>
@@ -84,14 +84,14 @@ void g(C &c) {
8484

8585
auto [x8, y8] = c;
8686
(x8, y8);
87-
// CIR: cir.call @_ZN1CC1ERKS_(%[[c:.*]], %7) : (!cir.ptr<!rec_C>, !cir.ptr<!rec_C>) -> ()
87+
// CIR: cir.copy %7 to %[[c:.*]] : !cir.ptr<!rec_C>
8888
// CIR: %[[x8:.*]] = cir.call @_Z3getILj0EERKiRK1C(%[[c]]) : (!cir.ptr<!rec_C>) -> !cir.ptr<!s32i>
8989
// CIR: cir.store{{.*}} %[[x8]], %[[x8p:.*]] : !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>
9090
// CIR: %[[x9:.*]] = cir.call @_Z3getILj1EERKiRK1C(%[[c]]) : (!cir.ptr<!rec_C>) -> !cir.ptr<!s32i>
9191
// CIR: cir.store{{.*}} %[[x9]], %[[x9p:.*]] : !cir.ptr<!s32i>, !cir.ptr<!cir.ptr<!s32i>>
9292
// CIR: {{.*}} = cir.load %[[x8p]] : !cir.ptr<!cir.ptr<!s32i>>, !cir.ptr<!s32i>
9393
// CIR: {{.*}} = cir.load %[[x9p]] : !cir.ptr<!cir.ptr<!s32i>>, !cir.ptr<!s32i>
94-
// LLVM: call void @_ZN1CC1ERKS_(ptr {{.*}}, ptr {{.*}})
94+
// LLVM: call void @llvm.memcpy.p0.p0.i32(ptr {{.*}}, ptr {{.*}}, i32 8, i1 false)
9595
// LLVM: {{.*}} = call ptr @_Z3getILj0EERKiRK1C(ptr {{.*}})
9696
// LLVM: {{.*}} = call ptr @_Z3getILj1EERKiRK1C(ptr {{.*}})
9797

0 commit comments

Comments
 (0)