Shih-wei Liao | f8fd82b | 2010-02-10 11:10:31 -0800 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -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_cc1 -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 | |
| 6 | extern "C" int printf(...); |
| 7 | |
| 8 | |
| 9 | struct C { |
| 10 | C() : iC(6) {} |
| 11 | int iC; |
| 12 | }; |
| 13 | |
| 14 | int foo() { |
| 15 | return 6; |
| 16 | }; |
| 17 | |
| 18 | class X { // ... |
| 19 | public: |
| 20 | X(int) {} |
| 21 | X(const X&, int i = 1, int j = 2, int k = foo()) { |
| 22 | printf("X(const X&, %d, %d, %d)\n", i, j, k); |
| 23 | } |
| 24 | }; |
| 25 | |
| 26 | int main() { |
| 27 | X a(1); |
| 28 | X b(a, 2); |
| 29 | X c = b; |
| 30 | X d(a, 5, 6); |
| 31 | } |
| 32 | |
| 33 | // CHECK-LP64: callq __ZN1XC1ERKS_iii |
| 34 | // CHECK-LP64: callq __ZN1XC1ERKS_iii |
| 35 | // CHECK-LP64: callq __ZN1XC1ERKS_iii |
| 36 | |
| 37 | // CHECK-LP32: call L__ZN1XC1ERKS_iii |
| 38 | // CHECK-LP32: call L__ZN1XC1ERKS_iii |
| 39 | // CHECK-LP32: call L__ZN1XC1ERKS_iii |