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 { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 11 | C() : iC(6) {} |
| 12 | int iC; |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 13 | }; |
| 14 | |
| 15 | int foo() { |
| 16 | return 6; |
| 17 | }; |
| 18 | |
| 19 | class X { // ... |
| 20 | public: |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 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 | } |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 25 | }; |
| 26 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 27 | int main() { |
| 28 | X a(1); |
| 29 | X b(a, 2); |
| 30 | X c = b; |
| 31 | X d(a, 5, 6); |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 32 | } |
Fariborz Jahanian | aed2b3e | 2009-08-05 21:52:02 +0000 | [diff] [blame] | 33 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 34 | // CHECK-LP64: call __ZN1XC1ERK1Xiii |
| 35 | // CHECK-LP64: call __ZN1XC1ERK1Xiii |
| 36 | // CHECK-LP64: call __ZN1XC1ERK1Xiii |
| 37 | |
| 38 | // CHECK-LP32: call L__ZN1XC1ERK1Xiii |
| 39 | // CHECK-LP32: call L__ZN1XC1ERK1Xiii |
| 40 | // CHECK-LP32: call L__ZN1XC1ERK1Xiii |