Fariborz Jahanian | b5bc3d6 | 2009-08-05 19:24:33 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s && |
| 2 | // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s && |
| 3 | // RUN: clang-cc -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s && |
| 4 | // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s && |
| 5 | // RUN: true |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 6 | |
| 7 | extern "C" int printf(...); |
| 8 | |
| 9 | |
| 10 | struct C { |
| 11 | C() : iC(6) {} |
| 12 | int iC; |
| 13 | }; |
| 14 | |
| 15 | int foo() { |
| 16 | return 6; |
| 17 | }; |
| 18 | |
| 19 | class X { // ... |
| 20 | public: |
| 21 | X(int) {} |
| 22 | X(const X&, int i = 1, int j = 2, int k = foo()) { |
| 23 | printf("X(const X&, %d, %d, %d)\n", i, j, k); |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | int main() |
| 28 | { |
| 29 | X a(1); |
| 30 | X b(a, 2); |
| 31 | X c = b; |
| 32 | X d(a, 5, 6); |
| 33 | } |
Fariborz Jahanian | b5bc3d6 | 2009-08-05 19:24:33 +0000 | [diff] [blame] | 34 | // CHECK-LP64: call __ZN1XC1ERK1Xiii |
| 35 | // CHECK-LP64: call __ZN1XC1ERK1Xiii |
| 36 | // CHECK-LP64: call __ZN1XC1ERK1Xiii |
Fariborz Jahanian | aed2b3e | 2009-08-05 21:52:02 +0000 | [diff] [blame] | 37 | |
Fariborz Jahanian | b5bc3d6 | 2009-08-05 19:24:33 +0000 | [diff] [blame] | 38 | // CHECK-LP32: call L__ZN1XC1ERK1Xiii |
| 39 | // CHECK-LP32: call L__ZN1XC1ERK1Xiii |
| 40 | // CHECK-LP32: call L__ZN1XC1ERK1Xiii |