[RISCV] Add shrinkwrap test cases showing gaps in current impl
[llvm-project.git] / clang / test / CodeGenCXX / vtable-constexpr.cpp
blobac0cbc66bc9328e2db4518a5e470a7f0b5c23212
1 // RUN: %clang_cc1 -std=c++20 %s -emit-llvm -o - -triple %itanium_abi_triple | FileCheck %s --implicit-check-not=DoNotEmit
3 // constexpr virtual functions can be called at runtime and go in the vtable as
4 // normal. But they are implicitly inline so are never the key function.
6 struct DoNotEmit {
7 virtual constexpr void f();
8 };
9 constexpr void DoNotEmit::f() {}
11 // CHECK-DAG: @_ZTV1B = {{.*}} constant { [3 x ptr] } { {{.*}} null, {{.*}} @_ZTI1B, {{.*}} @_ZN1B1fEv
12 struct B {
13 // CHECK-DAG: define {{.*}} @_ZN1B1fEv
14 virtual constexpr void f() {}
16 B b;
18 struct CBase {
19 virtual constexpr void f(); // not key function
22 // CHECK-DAG: @_ZTV1C = {{.*}} constant {{.*}} null, {{.*}} @_ZTI1C, {{.*}} @_ZN1C1fEv
23 struct C : CBase {
24 void f(); // key function
26 // CHECK-DAG: define {{.*}} @_ZN1C1fEv
27 void C::f() {}