Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s |
Anders Carlsson | 370e538 | 2009-11-14 01:51:50 +0000 | [diff] [blame] | 2 | |
| 3 | // PR5484 |
| 4 | namespace PR5484 { |
| 5 | struct A { }; |
| 6 | extern A a; |
| 7 | |
| 8 | void f(const A & = a); |
| 9 | |
| 10 | void g() { |
| 11 | f(); |
| 12 | } |
| 13 | } |
Anders Carlsson | 5d4d946 | 2009-11-24 18:43:52 +0000 | [diff] [blame] | 14 | |
| 15 | struct A1 { |
| 16 | A1(); |
| 17 | ~A1(); |
| 18 | }; |
| 19 | |
| 20 | struct A2 { |
| 21 | A2(); |
| 22 | ~A2(); |
| 23 | }; |
| 24 | |
| 25 | struct B { |
| 26 | B(const A1& = A1(), const A2& = A2()); |
| 27 | }; |
| 28 | |
| 29 | // CHECK: define void @_Z2f1v() |
| 30 | void 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 | |
| 40 | struct 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 |
| 58 | C::C() { } |
| 59 | |
| 60 | // CHECK: define void @_Z2f3v() |
| 61 | void 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 | } |