xref: /aosp_15_r20/external/clang/test/CodeGenCXX/microsoft-abi-eh-terminate.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc -mconstructor-aliases -fexceptions -fcxx-exceptions -fms-compatibility-version=18.00 | FileCheck -check-prefix=MSVC2013 -check-prefix=CHECK %s
2*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc -mconstructor-aliases -fexceptions -fcxx-exceptions -fms-compatibility-version=19.00 | FileCheck -check-prefix=MSVC2015 -check-prefix=CHECK %s
3*67e74705SXin Li 
4*67e74705SXin Li void may_throw();
never_throws()5*67e74705SXin Li void never_throws() noexcept(true) {
6*67e74705SXin Li   may_throw();
7*67e74705SXin Li }
8*67e74705SXin Li 
9*67e74705SXin Li // CHECK-LABEL: define void @"\01?never_throws@@YAXXZ"()
10*67e74705SXin Li // CHECK-SAME:          personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
11*67e74705SXin Li // CHECK:      invoke void @"\01?may_throw@@YAXXZ"()
12*67e74705SXin Li // CHECK:      %[[cp:.*]] = cleanuppad within none []
13*67e74705SXin Li // MSVC2013:      call void @"\01?terminate@@YAXXZ"()
14*67e74705SXin Li // MSVC2015:      call void @__std_terminate()
15*67e74705SXin Li // CHECK-SAME:  [ "funclet"(token %[[cp]]) ]
16*67e74705SXin Li // CHECK-NEXT: unreachable
17