Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / copy-constructor-synthesis-2.cpp
blob043dff44f37c261ca2ebf61f461f459d6b92e5ae
1 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -emit-llvm -o - %s | FileCheck %s
3 union PR23373 {
4 PR23373(PR23373&) = default;
5 PR23373 &operator=(PR23373&) = default;
6 int n;
7 float f;
8 };
9 extern PR23373 pr23373_a;
11 PR23373 pr23373_b(pr23373_a);
12 // CHECK-LABEL: define {{.*}} @__cxx_global_var_init(
13 // CHECK: call void @llvm.memcpy.p0.p0.{{i32|i64}}({{.*}}align 4{{.*}}@pr23373_b{{.*}}, {{.*}}align 4{{.*}} @pr23373_a{{.*}}, [[W:i32|i64]] 4, i1 false)
15 PR23373 pr23373_f() { return pr23373_a; }
16 // CHECK-LABEL: define {{.*}} @_Z9pr23373_fv(
17 // CHECK: call void @llvm.memcpy.p0.p0.[[W]]({{.*}}align 4{{.*}}align 4{{.*}}, [[W]] 4, i1 false)
19 void pr23373_g(PR23373 &a, PR23373 &b) { a = b; }
20 // CHECK-LABEL: define {{.*}} @_Z9pr23373_g
21 // CHECK: call void @llvm.memcpy.p0.p0.[[W]]({{.*}}align 4{{.*}}align 4{{.*}}, [[W]] 4, i1 false)
23 struct A { virtual void a(); };
24 A x(A& y) { return y; }
26 // CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(ptr {{.*}}%this, ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
27 // CHECK: store ptr getelementptr inbounds ({ [3 x ptr] }, ptr @_ZTV1A, i32 0, inrange i32 0, i32 2)