• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // REQUIRES: x86-registered-target,x86-64-registered-target
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
3 // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
4 // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
5 // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
6 
7 extern "C" int printf(...);
8 
9 
10 struct C {
CC11   C() : iC(6) {}
12   int iC;
13 };
14 
foo()15 int foo() {
16   return 6;
17 };
18 
19 class X { // ...
20 public:
X(int)21   X(int) {}
X(const X &,int i=1,int j=2,int k=foo ())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   }
25 };
26 
main()27 int main() {
28   X a(1);
29   X b(a, 2);
30   X c = b;
31   X d(a, 5, 6);
32 }
33 
34 // CHECK-LP64: callq __ZN1XC1ERKS_iii
35 // CHECK-LP64: callq __ZN1XC1ERKS_iii
36 // CHECK-LP64: callq __ZN1XC1ERKS_iii
37 
38 // CHECK-LP32: calll L__ZN1XC1ERKS_iii
39 // CHECK-LP32: calll L__ZN1XC1ERKS_iii
40 // CHECK-LP32: calll L__ZN1XC1ERKS_iii
41