summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-04-04 05:37:48 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-04-04 05:37:48 +0000
commitf205f5324bca303a997d383d3a9b7014f79fdfdc (patch)
tree3c990207c524ec1069dec578960bd61798a3308c /clang/test/CodeGenCXX/microsoft-abi-throw.cpp
parent1d359d3b5ba69cbfe39b372bfd31447d51ac812b (diff)
downloadbcm5719-llvm-f205f5324bca303a997d383d3a9b7014f79fdfdc.tar.gz
bcm5719-llvm-f205f5324bca303a997d383d3a9b7014f79fdfdc.zip
[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void
Don't assume that all pointers are convertible to void pointer. Instead correctly respect [conv.ptr]p2; only allow pointer types with an object pointee type to be caught as pointer-to-void. llvm-svn: 234090
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-throw.cpp')
-rw-r--r--clang/test/CodeGenCXX/microsoft-abi-throw.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-throw.cpp b/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
index 080a98e0d91..080f1a025cd 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
@@ -16,6 +16,9 @@
// CHECK-DAG: @"_CT??_R0?AUVariadic@@@8??_OVariadic@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor14* @"\01??_R0?AUVariadic@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.Variadic*, %struct.Variadic*)* @"\01??_OVariadic@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat
// CHECK-DAG: @"_CT??_R0?AUTemplateWithDefault@@@8??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z1" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor25* @"\01??_R0?AUTemplateWithDefault@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* bitcast (void (%struct.TemplateWithDefault*, %struct.TemplateWithDefault*)* @"\01??$?_OH@TemplateWithDefault@@QAEXAAU0@@Z" to i8*) }, section ".xdata", comdat
// CHECK-DAG: @"_CTA2$$T" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.2 { i32 2, [2 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0$$T@84", %eh.CatchableType* @"_CT??_R0PAX@84"] }, section ".xdata", comdat
+// CHECK-DAG: @"_CT??_R0P6AXXZ@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0P6AXXZ@8" to i8*), i32 0, i32 -1, i32 0, i32 4, i8* null }, section ".xdata", comdat
+// CHECK-DAG: @_CTA1P6AXXZ = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0P6AXXZ@84"] }, section ".xdata", comdat
+// CHECK-DAG: @_TI1P6AXXZ = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.1* @_CTA1P6AXXZ to i8*) }, section ".xdata", comdat
struct N { ~N(); };
@@ -104,3 +107,9 @@ void *GetExceptionInfo_test0() {
// CHECK: ret i8* bitcast (%eh.ThrowInfo* @_TI1H to i8*)
return std::__GetExceptionInfo(0);
}
+
+void *GetExceptionInfo_test1() {
+// CHECK-LABEL: @"\01?GetExceptionInfo_test1@@YAPAXXZ"
+// CHECK: ret i8* bitcast (%eh.ThrowInfo* @_TI1P6AXXZ to i8*)
+ return std::__GetExceptionInfo<void (*)()>(&h);
+}
OpenPOWER on IntegriCloud