blob: 282e5d0d5042248f7dad5ab4b1a6c39986d5c6e4 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
Anders Carlsson370e5382009-11-14 01:51:50 +00002
3// PR5484
4namespace PR5484 {
5struct A { };
6extern A a;
7
8void f(const A & = a);
9
10void g() {
11 f();
12}
13}
Anders Carlsson5d4d9462009-11-24 18:43:52 +000014
15struct A1 {
16 A1();
17 ~A1();
18};
19
20struct A2 {
21 A2();
22 ~A2();
23};
24
25struct B {
26 B(const A1& = A1(), const A2& = A2());
27};
28
29// CHECK: define void @_Z2f1v()
30void f1() {
31
32 // CHECK: call void @_ZN2A1C1Ev(
33 // CHECK: call void @_ZN2A2C1Ev(
34 // CHECK: call void @_ZN1BC1ERK2A1RK2A2(
35 // CHECK: call void @_ZN2A2D1Ev
36 // CHECK: call void @_ZN2A1D1Ev
37 B bs[2];
38}
39
40struct C {
41 B bs[2];
42 C();
43};
44
45// CHECK: define void @_ZN1CC1Ev(
46// CHECK: call void @_ZN2A1C1Ev(
47// CHECK: call void @_ZN2A2C1Ev(
48// CHECK: call void @_ZN1BC1ERK2A1RK2A2(
49// CHECK: call void @_ZN2A2D1Ev
50// CHECK: call void @_ZN2A1D1Ev
51
52// CHECK: define void @_ZN1CC2Ev(
53// CHECK: call void @_ZN2A1C1Ev(
54// CHECK: call void @_ZN2A2C1Ev(
55// CHECK: call void @_ZN1BC1ERK2A1RK2A2(
56// CHECK: call void @_ZN2A2D1Ev
57// CHECK: call void @_ZN2A1D1Ev
58C::C() { }
59
60// CHECK: define void @_Z2f3v()
61void f3() {
62 // CHECK: call void @_ZN2A1C1Ev(
63 // CHECK: call void @_ZN2A2C1Ev(
64 // CHECK: call void @_ZN1BC1ERK2A1RK2A2(
65 // CHECK: call void @_ZN2A2D1Ev
66 // CHECK: call void @_ZN2A1D1Ev
67 B *bs = new B[2];
68 delete bs;
69}