2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -O0 -S %s -o %t-64.s
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
|
2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++0x -O0 -S %s -o %t-32.s
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s
|
2009-08-18 03:04:50 +08:00
|
|
|
|
|
|
|
extern "C" int printf(...);
|
|
|
|
|
2009-08-21 07:33:31 +08:00
|
|
|
int count = 1;
|
|
|
|
|
2009-08-18 03:04:50 +08:00
|
|
|
struct S {
|
2009-08-21 07:33:31 +08:00
|
|
|
S() : iS(count++), fS(1.23) {};
|
2009-08-18 03:04:50 +08:00
|
|
|
~S(){printf("S::~S(%d, %f)\n", iS, fS); };
|
|
|
|
int iS;
|
|
|
|
float fS;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Q {
|
2009-08-21 07:33:31 +08:00
|
|
|
Q() : iQ(count++), dQ(2.34) {};
|
2009-08-18 03:04:50 +08:00
|
|
|
~Q(){printf("Q::~Q(%d, %f)\n", iQ, dQ); };
|
|
|
|
int iQ;
|
|
|
|
double dQ;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct P {
|
2009-08-21 07:33:31 +08:00
|
|
|
P() : fP(3.45) , iP(count++) {};
|
2009-08-18 03:04:50 +08:00
|
|
|
~P(){printf("P::~P(%d, %f)\n", iP, fP); };
|
|
|
|
float fP;
|
|
|
|
int iP;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct M : Q, P {
|
|
|
|
S s;
|
|
|
|
|
|
|
|
Q q;
|
|
|
|
|
|
|
|
P p;
|
|
|
|
|
2009-08-21 07:33:31 +08:00
|
|
|
P p_arr[3];
|
|
|
|
|
|
|
|
Q q_arr[2][3];
|
|
|
|
|
2009-08-18 03:04:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
M gm;
|
|
|
|
|
|
|
|
int main() {M m1;}
|
|
|
|
|
2009-09-09 23:08:12 +08:00
|
|
|
// CHECK-LP64: .globl __ZN1MD1Ev
|
|
|
|
// CHECK-LP64-NEXT: .weak_definition __ZN1MD1Ev
|
|
|
|
// CHECK-LP64-NEXT: __ZN1MD1Ev:
|
2010-01-08 08:50:11 +08:00
|
|
|
// CHECK-LP64: callq __ZN1MC1Ev
|
|
|
|
// CHECK-LP64: callq __ZN1MD1Ev
|
2009-09-09 23:08:12 +08:00
|
|
|
|
|
|
|
// CHECK-LP32: .globl __ZN1MD1Ev
|
|
|
|
// CHECK-LP32-NEXT: .weak_definition __ZN1MD1Ev
|
|
|
|
// CHECK-LP32-NEXT:__ZN1MD1Ev:
|
2010-01-08 08:50:11 +08:00
|
|
|
// CHECK-LP32: call L__ZN1MC1Ev
|
|
|
|
// CHECK-LP32: call L__ZN1MD1Ev
|