Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 2 | // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 4 | // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 5 | |
| 6 | extern "C" int printf(...); |
| 7 | |
| 8 | |
| 9 | struct C { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 10 | C() : iC(6) {} |
| 11 | int iC; |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 12 | }; |
| 13 | |
| 14 | int foo() { |
| 15 | return 6; |
| 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, int k = foo()) { |
| 22 | printf("X(const X&, %d, %d, %d)\n", i, j, k); |
| 23 | } |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 26 | int main() { |
| 27 | X a(1); |
| 28 | X b(a, 2); |
| 29 | X c = b; |
| 30 | X d(a, 5, 6); |
Fariborz Jahanian | b2c352e | 2009-08-05 17:03:54 +0000 | [diff] [blame] | 31 | } |
Fariborz Jahanian | aed2b3e | 2009-08-05 21:52:02 +0000 | [diff] [blame] | 32 | |
Sean Callanan | 3b29901 | 2009-12-18 00:04:09 +0000 | [diff] [blame] | 33 | // CHECK-LP64: callq __ZN1XC1ERKS_iii |
| 34 | // CHECK-LP64: callq __ZN1XC1ERKS_iii |
| 35 | // CHECK-LP64: callq __ZN1XC1ERKS_iii |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 36 | |
Anders Carlsson | d99edc4 | 2009-09-26 03:55:37 +0000 | [diff] [blame] | 37 | // CHECK-LP32: call L__ZN1XC1ERKS_iii |
| 38 | // CHECK-LP32: call L__ZN1XC1ERKS_iii |
| 39 | // CHECK-LP32: call L__ZN1XC1ERKS_iii |