28 lines · cpp
1// RUN: %clang_cc1 -std=c++20 -triple=amdgcn-amd-amdhsa %s -emit-llvm -o - | FileCheck %s --implicit-check-not=DoNotEmit2 3// constexpr virtual functions can be called at runtime and go in the vtable as4// normal. But they are implicitly inline so are never the key function.5 6struct DoNotEmit {7 virtual constexpr void f();8};9constexpr void DoNotEmit::f() {}10 11// CHECK-DAG: @_ZTV1B = {{.*}} addrspace(1) constant { [3 x ptr addrspace(1)] } { {{.*}} null, {{.*}} @_ZTI1B, {{.*}} @_ZN1B1fEv12struct B {13 // CHECK-DAG: define {{.*}} @_ZN1B1fEv14 virtual constexpr void f() {}15};16B b;17 18struct CBase {19 virtual constexpr void f(); // not key function20};21 22// CHECK-DAG: @_ZTV1C = {{.*}} addrspace(1) constant {{.*}} null, {{.*}} @_ZTI1C, {{.*}} @_ZN1C1fEv23struct C : CBase {24 void f(); // key function25};26// CHECK-DAG: define {{.*}} @_ZN1C1fEv27void C::f() {}28