blob: ec0b8da69b3de8349f91e2189901b3f60e32efcf [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// 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
6extern "C" int printf(...);
7
8
9struct C {
10 C() : iC(6) {}
11 int iC;
12};
13
14int foo() {
15 return 6;
16};
17
18class X { // ...
19public:
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
26int 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