1*71568a9eSLeonard Chan // The VTable is not in a comdat but the inline methods are. 2*71568a9eSLeonard Chan // This doesn’t affect the vtable or the stubs we emit. 3*71568a9eSLeonard Chan 4*71568a9eSLeonard Chan // RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fexperimental-relative-c++-abi-vtables | FileCheck %s 5*71568a9eSLeonard Chan 6*71568a9eSLeonard Chan // CHECK: $_ZN1A3fooEv.stub = comdat any 7*71568a9eSLeonard Chan // CHECK: $_ZN1A3barEv.stub = comdat any 8*71568a9eSLeonard Chan // CHECK: $_ZTI1A.rtti_proxy = comdat any 9*71568a9eSLeonard Chan 10*71568a9eSLeonard Chan // The vtable has a key function (A::foo()) so it does not have a comdat 11*71568a9eSLeonard Chan // CHECK: @_ZTV1A.local = private unnamed_addr constant { [4 x i32] } { [4 x i32] [i32 0, i32 trunc (i64 sub (i64 ptrtoint ({ i8*, i8* }** @_ZTI1A.rtti_proxy to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.A*)* @_ZN1A3fooEv.stub to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (void (%class.A*)* @_ZN1A3barEv.stub to i64), i64 ptrtoint (i32* getelementptr inbounds ({ [4 x i32] }, { [4 x i32] }* @_ZTV1A.local, i32 0, i32 0, i32 2) to i64)) to i32)] }, align 4 12*71568a9eSLeonard Chan // CHECK: @_ZTV1A = unnamed_addr alias { [4 x i32] }, { [4 x i32] }* @_ZTV1A.local 13*71568a9eSLeonard Chan 14*71568a9eSLeonard Chan // We do not declare the stub with linkonce_odr so it can be emitted as .globl. 15*71568a9eSLeonard Chan // CHECK: define hidden void @_ZN1A3barEv.stub(%class.A* {{.*}}%0) unnamed_addr #{{[0-9]+}} comdat 16*71568a9eSLeonard Chan 17*71568a9eSLeonard Chan class A { 18*71568a9eSLeonard Chan public: 19*71568a9eSLeonard Chan virtual void foo(); // Key func 20*71568a9eSLeonard Chan inline virtual void bar() {} 21*71568a9eSLeonard Chan }; 22*71568a9eSLeonard Chan 23*71568a9eSLeonard Chan void A::foo() {} 24