diff options
Diffstat (limited to 'test/CodeGenCXX/microsoft-abi-throw.cpp')
-rw-r--r-- | test/CodeGenCXX/microsoft-abi-throw.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/CodeGenCXX/microsoft-abi-throw.cpp b/test/CodeGenCXX/microsoft-abi-throw.cpp index 080f1a025cd8..7c2e2a8f901e 100644 --- a/test/CodeGenCXX/microsoft-abi-throw.cpp +++ b/test/CodeGenCXX/microsoft-abi-throw.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -emit-llvm -o - -triple=i386-pc-win32 -std=c++11 %s -fcxx-exceptions -fms-extensions | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - -triple=i386-pc-win32 -std=c++11 %s -fcxx-exceptions -fms-extensions -DSTD | FileCheck %s // CHECK-DAG: @"\01??_R0?AUY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUY@@\00" }, comdat // CHECK-DAG: @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUY@@@8" to i8*), i32 0, i32 -1, i32 0, i32 8, i8* bitcast (%struct.Y* (%struct.Y*, %struct.Y*, i32)* @"\01??0Y@@QAE@ABU0@@Z" to i8*) }, section ".xdata", comdat @@ -19,6 +20,8 @@ // 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 +// CHECK-DAG: @_TIU2PAPFAH = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 4, i8* null, i8* null, i8* bitcast (%eh.CatchableTypeArray.2* @_CTA2PAPFAH to i8*) }, section ".xdata", comdat +// CHECK-DAG: @_CTA2PAPFAH = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.2 { i32 2, [2 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0PAPFAH@84", %eh.CatchableType* @"_CT??_R0PAX@84"] }, section ".xdata", comdat struct N { ~N(); }; @@ -43,6 +46,12 @@ void g(const int *const *y) { throw y; } +void h(__unaligned int * __unaligned *y) { + // CHECK-LABEL: @"\01?h@@YAXPFAPFAH@Z" + // CHECK: call void @_CxxThrowException(i8* %{{.*}}, %eh.ThrowInfo* @_TIU2PAPFAH) + throw y; +} + struct Default { Default(Default &, int = 42); }; @@ -97,19 +106,25 @@ void h() { throw nullptr; } +#ifdef STD namespace std { template <typename T> void *__GetExceptionInfo(T); } +#else +template <typename T> +void *__GetExceptionInfo(T); +#endif +using namespace std; void *GetExceptionInfo_test0() { // CHECK-LABEL: @"\01?GetExceptionInfo_test0@@YAPAXXZ" // CHECK: ret i8* bitcast (%eh.ThrowInfo* @_TI1H to i8*) - return std::__GetExceptionInfo(0); + return __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); + return __GetExceptionInfo<void (*)()>(&h); } |