24 lines · cpp
1// Check that available_externally vtables do not receive aliases.2// We check this specifically under the legacy pass manager because the new pass3// manager seems to remove available_externally vtables from the IR entirely.4 5// RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -disable-llvm-passes -o - -emit-llvm | FileCheck %s6 7// The VTable for A is available_externally, meaning it can have a definition in8// IR, but is never emitted in this compilation unit. Because it won't be9// emitted here, we cannot make an alias, but we won't need to in the first10// place.11// CHECK: @_ZTV1A = available_externally unnamed_addr constant { [3 x i32] }12// CHECK-NOT: @_ZTV1A = {{.*}}alias13 14class A {15public:16 virtual void foo();17};18void A_foo(A *a);19 20void func() {21 A a;22 A_foo(&a);23}24