1 // RUN: %clang_cc1 %s -triple i686-pc-win32 -fms-extensions -fexceptions -fcxx-exceptions -emit-llvm -o - -std=c++11 | FileCheck %s
15 // CHECK-LABEL: define dso_local void @"?test_catch@@YAXXZ"(
16 // CHECK: invoke noundef i32 @"?f@@YAHH@Z"(i32 noundef 1)
17 // CHECK: to label %[[NORMAL:.*]] unwind label %[[CATCHSWITCH:.*]]
19 // CHECK: [[CATCHSWITCH]]
20 // CHECK: %[[CATCHSWITCHPAD:.*]] = catchswitch within none [label %[[CATCH_INT:.*]], label %[[CATCH_DOUBLE:.*]]] unwind to caller
22 // CHECK: [[CATCH_INT]]
23 // CHECK: %[[CATCHPAD_INT:.*]] = catchpad within %[[CATCHSWITCHPAD]] [ptr @"??_R0H@8", i32 0, ptr null]
24 // CHECK: call noundef i32 @"?f@@YAHH@Z"(i32 noundef 2)
25 // CHECK: catchret from %[[CATCHPAD_INT]] to label %[[LEAVE_INT_CATCH:.*]]
27 // CHECK: [[LEAVE_INT_CATCH]]
28 // CHECK: br label %[[LEAVE_FUNC:.*]]
30 // CHECK: [[LEAVE_FUNC]]
33 // CHECK: [[CATCH_DOUBLE]]
34 // CHECK: %[[CATCHPAD_DOUBLE:.*]] = catchpad within %[[CATCHSWITCHPAD]] [ptr @"??_R0N@8", i32 0, ptr null]
35 // CHECK: call noundef i32 @"?f@@YAHH@Z"(i32 noundef 3)
36 // CHECK: catchret from %[[CATCHPAD_DOUBLE]] to label %[[LEAVE_DOUBLE_CATCH:.*]]
38 // CHECK: [[LEAVE_DOUBLE_CATCH]]
39 // CHECK: br label %[[LEAVE_FUNC]]
42 // CHECK: br label %[[LEAVE_FUNC]]
53 // CHECK-LABEL: define dso_local {{.*}} @"?test_cleanup@@YAXXZ"(
54 // CHECK: invoke noundef i32 @"?f@@YAHH@Z"(i32 noundef 1)
55 // CHECK: to label %[[LEAVE_FUNC:.*]] unwind label %[[CLEANUP:.*]]
57 // CHECK: [[LEAVE_FUNC]]
58 // CHECK: call x86_thiscallcc void @"??1Cleanup@@QAE@XZ"(
62 // CHECK: %[[CLEANUPPAD:.*]] = cleanuppad within none []
63 // CHECK: call x86_thiscallcc void @"??1Cleanup@@QAE@XZ"(
64 // CHECK: cleanupret from %[[CLEANUPPAD]] unwind to caller
67 // CHECK-LABEL: define {{.*}} void @"??1Cleanup@@QAE@XZ"(
68 // CHECK: invoke noundef i32 @"?f@@YAHH@Z"(i32 noundef -1)
69 // CHECK: to label %[[LEAVE_FUNC:.*]] unwind label %[[TERMINATE:.*]]
71 // CHECK: [[LEAVE_FUNC]]
74 // CHECK: [[TERMINATE]]
75 // CHECK: %[[CLEANUPPAD:.*]] = cleanuppad within none []
76 // CHECK-NEXT: call void @"?terminate@@YAXXZ"() {{.*}} [ "funclet"(token %[[CLEANUPPAD]]) ]