| 1 |
// The VTable is not in a comdat but the inline methods are. |
| 2 |
// This doesn’t affect the vtable or the stubs we emit. |
| 3 |
|
| 4 |
// RUN: %clang_cc1 %s -triple=aarch64 -O1 -o - -emit-llvm -fexperimental-relative-c++-abi-vtables -fhalf-no-semantic-interposition | FileCheck %s |
| 5 |
// RUN: %clang_cc1 %s -triple=x86_64 -O1 -o - -emit-llvm -fexperimental-relative-c++-abi-vtables -fhalf-no-semantic-interposition | FileCheck %s |
| 6 |
|
| 7 |
// CHECK: $_ZTI1A.rtti_proxy = comdat any |
| 8 |
|
| 9 |
// The vtable has a key function (A::foo()) so it does not have a comdat |
| 10 |
// CHECK: @_ZTV1A.local = internal unnamed_addr constant { [4 x i32] } { [4 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint (ptr @_ZTI1A.rtti_proxy to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1A3fooEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr dso_local_equivalent @_ZN1A3barEv to i64), i64 ptrtoint (ptr getelementptr inbounds ({ [4 x i32] }, ptr @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4 |
| 11 |
// CHECK: @_ZTV1A ={{.*}} unnamed_addr alias { [4 x i32] }, ptr @_ZTV1A.local |
| 12 |
|
| 13 |
class A { |
| 14 |
public: |
| 15 |
virtual void foo(); // Key func |
| 16 |
inline virtual void bar() {} |
| 17 |
}; |
| 18 |
|
| 19 |
void A::foo() {} |