Files
clang-p2996/clang/test/CodeGenCXX/RelativeVTablesABI/vtable-hidden-when-in-comdat.cpp
Nikita Popov 532dc62b90 [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
2022-04-07 12:09:47 +02:00

20 lines
670 B
C++

// Check that a vtable is made hidden instead of private if the original vtable
// is not dso_local. The vtable will need to be hidden and not private so it can
// be used as acomdat key signature.
// RUN: %clang_cc1 -no-opaque-pointers %s -triple=aarch64-unknown-fuchsia -S -o - -emit-llvm | FileCheck %s
// CHECK: @_ZTV1B.local = linkonce_odr hidden unnamed_addr constant
// CHECK: @_ZTV1B = linkonce_odr unnamed_addr alias { [3 x i32] }, { [3 x i32] }* @_ZTV1B.local
// The VTable will be in a comdat here since it has no key function.
class B {
public:
inline virtual void func() {}
};
// This is here just to manifest the vtable for B.
void func() {
B b;
}