blob: 7e6a7cd8f71ab4d97ee7da9c2a02d7c9c27ba42a [file] [log] [blame]
Fariborz Jahanianb5bc3d62009-08-05 19:24:33 +00001// 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 Jahanianb2c352e2009-08-05 17:03:54 +00006
7extern "C" int printf(...);
8
9
10struct C {
Mike Stump1eb44332009-09-09 15:08:12 +000011 C() : iC(6) {}
12 int iC;
Fariborz Jahanianb2c352e2009-08-05 17:03:54 +000013};
14
15int foo() {
16 return 6;
17};
18
19class X { // ...
20public:
Mike Stump1eb44332009-09-09 15:08:12 +000021 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 Jahanianb2c352e2009-08-05 17:03:54 +000025};
26
Mike Stump1eb44332009-09-09 15:08:12 +000027int main() {
28 X a(1);
29 X b(a, 2);
30 X c = b;
31 X d(a, 5, 6);
Fariborz Jahanianb2c352e2009-08-05 17:03:54 +000032}
Fariborz Jahanianaed2b3e2009-08-05 21:52:02 +000033
Anders Carlssond99edc42009-09-26 03:55:37 +000034// CHECK-LP64: call __ZN1XC1ERKS_iii
35// CHECK-LP64: call __ZN1XC1ERKS_iii
36// CHECK-LP64: call __ZN1XC1ERKS_iii
Mike Stump1eb44332009-09-09 15:08:12 +000037
Anders Carlssond99edc42009-09-26 03:55:37 +000038// CHECK-LP32: call L__ZN1XC1ERKS_iii
39// CHECK-LP32: call L__ZN1XC1ERKS_iii
40// CHECK-LP32: call L__ZN1XC1ERKS_iii