Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -o %t %s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: grep "_ZN1CC1ERK1C" %t | count 0 |
| 3 | // RUN: grep "_ZN1SC1ERK1S" %t | count 0 |
Fariborz Jahanian | 6904cbb | 2009-08-06 01:02:49 +0000 | [diff] [blame] | 4 | |
| 5 | extern "C" int printf(...); |
| 6 | |
| 7 | |
| 8 | struct C { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 9 | C() : iC(6) {printf("C()\n"); } |
| 10 | C(const C& c) { printf("C(const C& c)\n"); } |
| 11 | int iC; |
Fariborz Jahanian | 6904cbb | 2009-08-06 01:02:49 +0000 | [diff] [blame] | 12 | }; |
| 13 | |
| 14 | C foo() { |
| 15 | return C(); |
| 16 | }; |
| 17 | |
| 18 | class X { // ... |
| 19 | public: |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 20 | X(int) {} |
| 21 | X(const X&, int i = 1, int j = 2, C c = foo()) { |
| 22 | printf("X(const X&, %d, %d, %d)\n", i, j, c.iC); |
| 23 | } |
Fariborz Jahanian | 6904cbb | 2009-08-06 01:02:49 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
Fariborz Jahanian | 343a3cf | 2009-08-14 20:11:43 +0000 | [diff] [blame] | 26 | |
| 27 | struct S { |
| 28 | S(); |
| 29 | }; |
| 30 | |
| 31 | S::S() { printf("S()\n"); } |
| 32 | |
| 33 | void Call(S) {}; |
| 34 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 35 | int main() { |
| 36 | X a(1); |
| 37 | X b(a, 2); |
| 38 | X c = b; |
| 39 | X d(a, 5, 6); |
| 40 | S s; |
| 41 | Call(s); |
Fariborz Jahanian | 6904cbb | 2009-08-06 01:02:49 +0000 | [diff] [blame] | 42 | } |