1 // RUN: %clang_cc1 -std=c++1z -I%S %s -triple x86_64-linux-gnu -emit-llvm -o - -fcxx-exceptions | FileCheck %s
2 
3 #include "typeinfo"
4 
5 struct A {};
6 
7 // CHECK-DAG: @_ZTIFvvE = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__function_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZTSFvvE, i32 0, i32 0) }, comdat
8 // CHECK-DAG: @_ZTIPDoFvvE = linkonce_odr constant { i8*, i8*, i32, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv119__pointer_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_ZTSPDoFvvE, i32 0, i32 0), i32 64, i8* bitcast ({ i8*, i8* }* @_ZTIFvvE to i8*) }, comdat
9 auto &ti_noexcept_ptr = typeid(void (A::*)() noexcept);
10 // CHECK-DAG: @_ZTIM1ADoFvvE = linkonce_odr constant { i8*, i8*, i32, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv129__pointer_to_member_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @_ZTSM1ADoFvvE, i32 0, i32 0), i32 64, i8* bitcast ({ i8*, i8* }* @_ZTIFvvE to i8*), i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*) }, comdat
11 auto &ti_noexcept_memptr = typeid(void (A::*)() noexcept);
12 
13 // CHECK-LABEL: define void @_Z1fv(
f()14 __attribute__((noreturn)) void f() noexcept {
15   // CHECK: call void @__cxa_throw({{.*}}@_ZTIPDoFvvE
16   throw f;
17 }
18 
19 // CHECK-LABEL: define void @_Z1gM1ADoFvvE(
g(void (A::* p)()noexcept)20 void g(__attribute__((noreturn)) void (A::*p)() noexcept) {
21   // CHECK: call void @__cxa_throw({{.*}}@_ZTIM1ADoFvvE
22   throw p;
23 }
24