30 lines · cpp
1// RUN: %clang_cc1 -fexceptions -fcxx-exceptions %s -triple=x86_64-pc-linux-gnu -funwind-tables=2 -emit-llvm -o - -O1 -disable-llvm-passes | FileCheck %s2 3// When generating the thunk for secondary, do not push terminate scopes for4// either the varargs or non-varargs case. Related to PR44987.5 6struct A {7 virtual void primary_key();8};9struct B {10 virtual void secondary();11 virtual void secondary_vararg(int, ...);12};13class C : A, B {14 virtual void primary_key();15 void secondary() noexcept;16 void secondary_vararg(int, ...) noexcept;17};18void C::primary_key() {}19 20// CHECK-LABEL: define available_externally void @_ZThn8_N1C9secondaryEv(ptr noundef %this) {{.*}} #221// CHECK-NOT: invoke22// CHECK: tail call void @_ZN1C9secondaryEv(ptr {{[^,]*}} %{{.*}})23// CHECK-NOT: invoke24// CHECK: ret void25 26// CHECK-LABEL: define available_externally void @_ZThn8_N1C16secondary_varargEiz(ptr noundef %this, i32 noundef %0, ...) {{.*}} #227// CHECK-NOT: invoke28// CHECK: musttail call void (ptr, i32, ...) @_ZN1C16secondary_varargEiz(ptr {{[^,]*}} %{{.*}}, i32 noundef %{{.*}}, ...) #329// CHECK-NEXT: ret void30