summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/rtti-qualfn.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-12-01 03:32:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-12-01 03:32:42 +0000
commita7d9378761f90b1848660b2158dcff192dab2bef (patch)
tree6af2cbee4f0d694128b5bb028419e96da78541e6 /clang/test/CodeGenCXX/rtti-qualfn.cpp
parentb17d6fa5b399ac1c499796fcbf8d88263f67cf9c (diff)
downloadbcm5719-llvm-a7d9378761f90b1848660b2158dcff192dab2bef.tar.gz
bcm5719-llvm-a7d9378761f90b1848660b2158dcff192dab2bef.zip
P0012R1: add Itanium ABI support for throwing non-noexcept function pointers and catching as noexcept.
llvm-svn: 288305
Diffstat (limited to 'clang/test/CodeGenCXX/rtti-qualfn.cpp')
-rw-r--r--clang/test/CodeGenCXX/rtti-qualfn.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/rtti-qualfn.cpp b/clang/test/CodeGenCXX/rtti-qualfn.cpp
new file mode 100644
index 00000000000..329cd50547a
--- /dev/null
+++ b/clang/test/CodeGenCXX/rtti-qualfn.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -std=c++1z -I%S %s -triple x86_64-linux-gnu -emit-llvm -o - -fcxx-exceptions | FileCheck %s
+
+#include "typeinfo"
+
+struct A {};
+
+// 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
+// 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
+auto &ti_noexcept_ptr = typeid(void (A::*)() noexcept);
+// 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
+auto &ti_noexcept_memptr = typeid(void (A::*)() noexcept);
+
+// CHECK-LABEL: define void @_Z1fv(
+__attribute__((noreturn)) void f() noexcept {
+ // CHECK: call void @__cxa_throw({{.*}}@_ZTIPDoFvvE
+ throw f;
+}
+
+// CHECK-LABEL: define void @_Z1gM1ADoFvvE(
+void g(__attribute__((noreturn)) void (A::*p)() noexcept) {
+ // CHECK: call void @__cxa_throw({{.*}}@_ZTIM1ADoFvvE
+ throw p;
+}
OpenPOWER on IntegriCloud