Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / array-default-argument.cpp
blob70147d99af65bc42290cd50e594bfe6b2628609a
1 // RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple | FileCheck %s
2 // RUN: %clang_cc1 -emit-llvm -o - %s -triple %itanium_abi_triple -std=c++98 -fexceptions -fcxx-exceptions | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-EH
4 struct A {
5 A();
6 ~A();
7 };
9 struct B {
10 B(A = A());
11 ~B();
14 void f();
15 // CHECK-LABEL: define {{(dso_local )?}}void @_Z1gv()
16 void g() {
17 // CHECK: br label %[[LOOP:.*]]
19 // [[LOOP]]:
20 // CHECK: {{call|invoke}} {{.*}} @_ZN1AC1Ev({{.*}} [[TEMPORARY:%.*]])
21 // CHECK-EH: unwind label %[[PARTIAL_ARRAY_LPAD:.*]]
22 // CHECK: {{call|invoke}} {{.*}} @_ZN1BC1E1A({{.*}} [[TEMPORARY]])
23 // CHECK-EH: unwind label %[[A_AND_PARTIAL_ARRAY_LPAD:.*]]
24 // CHECK: {{call|invoke}} {{.*}} @_ZN1AD1Ev({{.*}} [[TEMPORARY]])
25 // CHECK-EH: unwind label %[[PARTIAL_ARRAY_LPAD]]
26 // CHECK: getelementptr {{.*}}, i{{[0-9]*}} 1
27 // CHECK: icmp eq
28 // CHECK: br i1 {{.*}} label %[[LOOP]]
29 B b[5];
31 // CHECK: {{call|invoke}} void @_Z1fv()
32 f();
34 // CHECK-NOT: @_ZN1AD1Ev(
35 // CHECK: {{call|invoke}} {{.*}} @_ZN1BD1Ev(