Files
clang-p2996/clang/test/CodeGenCXX/OmitRTTIComponentABI/vtable-layout.cpp
Leonard Chan f45f1c3585 Reland "[clang] Add experimental option to omit the RTTI component from the vtable when -fno-rtti is used"
This reverts commit 070493ddbd (and
relands the original change). This removes a test run that makes an
assumption of RTTI being on by default for a given target.
2023-09-14 18:28:37 +00:00

20 lines
520 B
C++

/// Ensure -fdump-vtable-layout omits the rtti component when passed -fexperimental-omit-vtable-rtti.
// RUN: %clang_cc1 %s -triple=aarch64-unknown-linux-gnu -fno-rtti -fexperimental-omit-vtable-rtti -emit-llvm-only -fdump-vtable-layouts | FileCheck %s
// CHECK: Vtable for 'A' (2 entries).
// CHECK-NEXT: 0 | offset_to_top (0)
// CHECK-NEXT: -- (A, 0) vtable address --
// CHECK-NEXT: 1 | void A::foo()
class A {
public:
virtual void foo();
};
void A::foo() {}
void A_foo(A *a) {
a->foo();
}