blob: fdca3f4a15b1d7eea33334d9d5a4b7f0dd68fa66 [file] [log] [blame]
Mike Stump06758d02009-08-04 20:37:29 +00001// RUN: clang-cc -triple x86_64-apple-darwin -frtti=0 -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 -frtti=0 -std=c++0x -S %s -o %t-32.s &&
4// RUN: FileCheck -check-prefix LP32 -input-file=%t-32.s %s &&
5// RUN: true
Mike Stump3dee6ef2009-07-30 00:22:38 +00006
7class A {
8public:
Mike Stump06758d02009-08-04 20:37:29 +00009 virtual void foo1();
10 virtual void foo2();
11 A() { }
12} *a;
Mike Stump3dee6ef2009-07-30 00:22:38 +000013
14static_assert (sizeof (A) == (sizeof(void *)), "vtable pointer layout");
Mike Stump06758d02009-08-04 20:37:29 +000015
16int main() {
17 A a;
18}
19
20// CHECK-LP64: __ZTV1A:
21// CHECK-LP64: .space 8
22// CHECK-LP64: .space 8
23// CHECK-LP64: .quad __ZN1A4foo1Ev
24// CHECK-LP64: .quad __ZN1A4foo2Ev
25
26// CHECK-LP32: __ZTV1A:
27// CHECK-LP32: .space 4
28// CHECK-LP32: .space 4
29// CHECK-LP32: .long __ZN1A4foo1Ev
30// CHECK-LP32: .long __ZN1A4foo2Ev