Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame^] | 1 | // 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 Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 6 | |
| 7 | class A { |
| 8 | public: |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame^] | 9 | virtual void foo1(); |
| 10 | virtual void foo2(); |
| 11 | A() { } |
| 12 | } *a; |
Mike Stump | 3dee6ef | 2009-07-30 00:22:38 +0000 | [diff] [blame] | 13 | |
| 14 | static_assert (sizeof (A) == (sizeof(void *)), "vtable pointer layout"); |
Mike Stump | 06758d0 | 2009-08-04 20:37:29 +0000 | [diff] [blame^] | 15 | |
| 16 | int 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 |