diff options
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/exceptions-seh-finally.c | 49 | ||||
-rw-r--r-- | clang/test/CodeGen/exceptions-seh-leave.c | 28 | ||||
-rw-r--r-- | clang/test/CodeGen/exceptions-seh.c | 61 |
3 files changed, 50 insertions, 88 deletions
diff --git a/clang/test/CodeGen/exceptions-seh-finally.c b/clang/test/CodeGen/exceptions-seh-finally.c index 03c04e6fe0e..f0ed2230640 100644 --- a/clang/test/CodeGen/exceptions-seh-finally.c +++ b/clang/test/CodeGen/exceptions-seh-finally.c @@ -25,12 +25,8 @@ void basic_finally(void) { // CHECK: [[lpad]] // CHECK-NEXT: %[[pad:[^ ]*]] = cleanuppad // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK: invoke void @"\01?fin$0@0@basic_finally@@"({{i8( zeroext)?}} 1, i8* %[[fp]]) -// CHECK-NEXT: to label %{{.*}} unwind label %[[end:[^ ]*]] -// CHECK: cleanupret %[[pad]] unwind to caller -// -// CHECK: [[end]] -// CHECK: cleanupendpad %[[pad]] unwind to caller +// CHECK: call void @"\01?fin$0@0@basic_finally@@"({{i8( zeroext)?}} 1, i8* %[[fp]]) +// CHECK-NEXT: cleanupret from %[[pad]] unwind to caller // CHECK: define internal void @"\01?fin$0@0@basic_finally@@"({{.*}}) // CHECK: call void @cleanup() @@ -95,12 +91,8 @@ void use_abnormal_termination(void) { // CHECK: [[lpad]] // CHECK-NEXT: %[[pad:[^ ]*]] = cleanuppad // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK: invoke void @"\01?fin$0@0@use_abnormal_termination@@"({{i8( zeroext)?}} 1, i8* %[[fp]]) -// CHECK-NEXT: to label %{{.*}} unwind label %[[end:[^ ]*]] -// CHECK: cleanupret %[[pad]] unwind to caller -// -// CHECK: [[end]] -// CHECK: cleanupendpad %[[pad]] unwind to caller +// CHECK: call void @"\01?fin$0@0@use_abnormal_termination@@"({{i8( zeroext)?}} 1, i8* %[[fp]]) +// CHECK-NEXT: cleanupret from %[[pad]] unwind to caller // CHECK: define internal void @"\01?fin$0@0@use_abnormal_termination@@"({{i8( zeroext)?}} %[[abnormal:abnormal_termination]], i8* %frame_pointer) // CHECK: %[[abnormal_zext:[^ ]*]] = zext i8 %[[abnormal]] to i32 @@ -141,12 +133,8 @@ void noreturn_finally() { // // CHECK: [[lpad]] // CHECK-NEXT: %[[pad:[^ ]*]] = cleanuppad -// CHECK: invoke void @"\01?fin$0@0@noreturn_finally@@"({{.*}}) -// CHECK-NEXT: to label %{{.*}} unwind label %[[end:[^ ]*]] -// CHECK: cleanupret %[[pad]] unwind to caller -// -// CHECK: [[end]] -// CHECK: cleanupendpad %[[pad]] unwind to caller +// CHECK: call void @"\01?fin$0@0@noreturn_finally@@"({{.*}}) +// CHECK-NEXT: cleanupret from %[[pad]] unwind to caller // CHECK: define internal void @"\01?fin$0@0@noreturn_finally@@"({{.*}}) // CHECK: call void @abort() @@ -189,12 +177,8 @@ int nested___finally___finally() { // // CHECK: [[lpad]] // CHECK-NEXT: %[[pad:[^ ]*]] = cleanuppad -// CHECK: invoke void @"\01?fin$0@0@nested___finally___finally@@"({{.*}}) -// CHECK-NEXT: to label %{{.*}} unwind label %[[end:[^ ]*]] -// CHECK: cleanupret %[[pad]] unwind to caller -// -// CHECK: [[end]] -// CHECK: cleanupendpad %[[pad]] unwind to caller +// CHECK: call void @"\01?fin$0@0@nested___finally___finally@@"({{.*}}) +// CHECK-NEXT: cleanupret from %[[pad]] unwind to caller // CHECK-LABEL: define internal void @"\01?fin$0@0@nested___finally___finally@@"({{.*}}) // CHECK: ret void @@ -231,24 +215,15 @@ int nested___finally___finally_with_eh_edge() { // CHECK: [[lpad1]] // CHECK-NEXT: %[[innerpad:[^ ]*]] = cleanuppad // CHECK: invoke void @"\01?fin$1@0@nested___finally___finally_with_eh_edge@@"({{.*}}) -// CHECK-NEXT: to label %[[innercleanupretbb:[^ ]*]] unwind label %[[innerend:[^ ]*]] +// CHECK-NEXT: label %[[innercleanupretbb:[^ ]*]] unwind label %[[lpad2:[^ ]*]] // // CHECK: [[innercleanupretbb]] -// CHECK-NEXT: cleanupret %[[innerpad]] unwind label %[[lpad2]] -// -// CHECK: [[innerend]] -// CHECK-NEXT: cleanupendpad %[[innerpad]] unwind label %[[lpad2:[^ ]*]] +// CHECK-NEXT: cleanupret from %[[innerpad]] unwind label %[[lpad2]] // // CHECK: [[lpad2]] // CHECK-NEXT: %[[outerpad:[^ ]*]] = cleanuppad -// CHECK: invoke void @"\01?fin$0@0@nested___finally___finally_with_eh_edge@@"({{.*}}) -// CHECK-NEXT: to label %[[outercleanupretbb:[^ ]*]] unwind label %[[outerend:[^ ]*]] -// -// CHECK: [[outercleanupretbb]] -// CHECK-NEXT: cleanupret %[[outerpad]] unwind to caller -// -// CHECK: [[outerend]] -// CHECK-NEXT: cleanupendpad %[[outerpad]] unwind to caller +// CHECK: call void @"\01?fin$0@0@nested___finally___finally_with_eh_edge@@"({{.*}}) +// CHECK-NEXT: cleanupret from %[[outerpad]] unwind to caller // CHECK-LABEL: define internal void @"\01?fin$0@0@nested___finally___finally_with_eh_edge@@"({{.*}}) // CHECK: ret void diff --git a/clang/test/CodeGen/exceptions-seh-leave.c b/clang/test/CodeGen/exceptions-seh-leave.c index 2895edbdfef..a0b1956d142 100644 --- a/clang/test/CodeGen/exceptions-seh-leave.c +++ b/clang/test/CodeGen/exceptions-seh-leave.c @@ -160,20 +160,17 @@ int nested___except___finally() { // CHECK-NEXT: cleanuppad // CHECK-NEXT: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() // CHECK-NEXT: invoke void @"\01?fin$0@0@nested___except___finally@@"(i8 1, i8* %[[fp]]) -// CHECK-NEXT: to label %[[g1_resume:.*]] unwind label %[[cleanupend:[^ ]*]] +// CHECK-NEXT: to label %[[g1_resume:.*]] unwind label %[[g2_lpad]] // CHECK: cleanupret {{.*}} unwind label %[[g2_lpad]] // CHECK: [[g2_lpad]] -// CHECK: catchpad [i8* null] +// CHECK: catchpad {{.*}} [i8* null] // CHECK: catchret // CHECK: br label %[[trycont]] // CHECK: [[trycont]] // CHECK-NEXT: ret i32 1 -// CHECK: [[cleanupend]] -// CHECK-NEXT: cleanupendpad {{.*}} unwind label %[[g2_lpad]] - // CHECK-LABEL: define internal void @"\01?fin$0@0@nested___except___finally@@"(i8 %abnormal_termination, i8* %frame_pointer) // CHECK: call void @g() // CHECK: unreachable @@ -203,14 +200,14 @@ int nested___except___except() { // CHECK-NEXT: to label %[[g1_cont:.*]] unwind label %[[g1_lpad:.*]] // CHECK: [[g1_lpad]] -// CHECK: catchpad [i8* null] +// CHECK: catchpad {{.*}} [i8* null] // CHECK: catchret {{.*}} to label %[[except:[^ ]*]] // CHECK: [[except]] // CHECK: invoke void @g() // CHECK-NEXT: to label %[[g2_cont:.*]] unwind label %[[g2_lpad:.*]] // CHECK: [[g2_lpad]] -// CHECK: catchpad [i8* null] +// CHECK: catchpad {{.*}} [i8* null] // CHECK: catchret // CHECK: br label %[[trycont4:[^ ]*]] @@ -280,7 +277,7 @@ int nested___finally___except() { // CHECK: [[g2_lpad]] // CHECK: cleanuppad // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK-NEXT: invoke void @"\01?fin$0@0@nested___finally___except@@"(i8 1, i8* %[[fp]]) +// CHECK-NEXT: call void @"\01?fin$0@0@nested___finally___except@@"(i8 1, i8* %[[fp]]) // CHECK: cleanupret {{.*}} unwind to caller // CHECK-LABEL: define internal void @"\01?fin$0@0@nested___finally___except@@"(i8 %abnormal_termination, i8* %frame_pointer) @@ -323,21 +320,18 @@ int nested___finally___finally() { // CHECK-NEXT: ret i32 1 // CHECK: [[g1_lpad]] -// CHECK-NEXT: %[[padtoken:[^ ]*]] = cleanuppad [] +// CHECK-NEXT: %[[padtoken:[^ ]*]] = cleanuppad within none [] // CHECK-NEXT: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() // CHECK-NEXT: invoke void @"\01?fin$1@0@nested___finally___finally@@"(i8 1, i8* %[[fp]]) -// CHECK-NEXT: to label %[[finally_cont2:.*]] unwind label %[[endcleanup:[^ ]*]] +// CHECK-NEXT: to label %[[finally_cont2:.*]] unwind label %[[g2_lpad]] // CHECK: [[finally_cont2]] -// CHECK: cleanupret %[[padtoken]] unwind label %[[g2_lpad]] - -// CHECK: [[endcleanup]] -// CHECK-NEXT: cleanupendpad %[[padtoken]] unwind label %[[g2_lpad]] +// CHECK: cleanupret from %[[padtoken]] unwind label %[[g2_lpad]] // CHECK: [[g2_lpad]] -// CHECK-NEXT: %[[padtoken:[^ ]*]] = cleanuppad [] +// CHECK-NEXT: %[[padtoken:[^ ]*]] = cleanuppad within none [] // CHECK-NEXT: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK-NEXT: invoke void @"\01?fin$0@0@nested___finally___finally@@"(i8 1, i8* %[[fp]]) -// CHECK: cleanupret %[[padtoken]] unwind to caller +// CHECK-NEXT: call void @"\01?fin$0@0@nested___finally___finally@@"(i8 1, i8* %[[fp]]) +// CHECK: cleanupret from %[[padtoken]] unwind to caller // CHECK-LABEL: define internal void @"\01?fin$0@0@nested___finally___finally@@"(i8 %abnormal_termination, i8* %frame_pointer) // CHECK: ret void diff --git a/clang/test/CodeGen/exceptions-seh.c b/clang/test/CodeGen/exceptions-seh.c index 1a50ed0deae..0829117fbe3 100644 --- a/clang/test/CodeGen/exceptions-seh.c +++ b/clang/test/CodeGen/exceptions-seh.c @@ -34,12 +34,9 @@ int safe_div(int numerator, int denominator, int *res) { // CHECK: to label %{{.*}} unwind label %[[catchpad:[^ ]*]] // // CHECK: [[catchpad]] -// X64: %[[padtoken:[^ ]*]] = catchpad [i8* null] -// X86: %[[padtoken:[^ ]*]] = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@safe_div@@" to i8*)] -// CHECK-NEXT: to label %[[exceptret:[^ ]*]] unwind label -// -// CHECK: [[exceptret]] -// CHECK: catchret %[[padtoken]] to label %[[except:[^ ]*]] +// X64: %[[padtoken:[^ ]*]] = catchpad within %{{[^ ]*}} [i8* null] +// X86: %[[padtoken:[^ ]*]] = catchpad within %{{[^ ]*}} [i8* bitcast (i32 ()* @"\01?filt$0@0@safe_div@@" to i8*)] +// CHECK-NEXT: catchret from %[[padtoken]] to label %[[except:[^ ]*]] // // CHECK: [[except]] // CHECK: store i32 -42, i32* %[[success:[^ ]*]] @@ -85,7 +82,7 @@ int filter_expr_capture(void) { // CHECK: store i32 42, i32* %[[r]] // CHECK: invoke void @j() #[[NOINLINE]] // -// CHECK: catchpad [i8* bitcast (i32 ({{.*}})* @"\01?filt$0@0@filter_expr_capture@@" to i8*)] +// CHECK: catchpad within %{{[^ ]*}} [i8* bitcast (i32 ({{.*}})* @"\01?filt$0@0@filter_expr_capture@@" to i8*)] // CHECK: store i32 13, i32* %[[r]] // // CHECK: %[[rv:[^ ]*]] = load i32, i32* %[[r]] @@ -121,37 +118,37 @@ int nested_try(void) { // X86-SAME: personality i8* bitcast (i32 (...)* @_except_handler3 to i8*) // CHECK: store i32 42, i32* %[[r:[^ ,]*]] // CHECK: invoke void @j() #[[NOINLINE]] -// CHECK: to label %[[cont:[^ ]*]] unwind label %[[cpad_inner:[^ ]*]] -// -// CHECK: [[cpad_inner]] -// CHECK: catchpad [i8* bitcast (i32 ({{.*}})* @"\01?filt$1@0@nested_try@@" to i8*)] -// CHECK-NEXT: to label %[[exceptret_inner:[^ ]*]] unwind label %[[cpad_outer:[^ ]*]] +// CHECK: to label %[[cont:[^ ]*]] unwind label %[[cswitch_inner:[^ ]*]] // -// CHECK: [[exceptret_inner]] -// CHECK: catchret {{.*}} to label %[[except_inner:[^ ]*]] +// CHECK: [[cswitch_inner]] +// CHECK: %[[cs_inner:[^ ]*]] = catchswitch within none [label %[[cpad_inner:[^ ]*]]] unwind label %[[cswitch_outer:[^ ]*]] // -// CHECK: [[except_inner]] -// CHECK: store i32 123, i32* %[[r]] -// CHECK: br label %[[inner_try_cont:[^ ]*]] -// -// CHECK: [[inner_try_cont]] -// CHECK: br label %[[outer_try_cont:[^ ]*]] +// CHECK: [[cswitch_outer]] +// CHECK: %[[cs_outer:[^ ]*]] = catchswitch within none [label %[[cpad_outer:[^ ]*]]] unwind to caller // // CHECK: [[cpad_outer]] -// CHECK: catchpad [i8* bitcast (i32 ({{.*}})* @"\01?filt$0@0@nested_try@@" to i8*)] -// CHECK-NEXT: to label %[[exceptret_outer:[^ ]*]] unwind label -// -// CHECK: [[exceptret_outer]] -// CHECK: catchret {{.*}} to label %[[except_outer:[^ ]*]] +// CHECK: catchpad within %{{[^ ]*}} [i8* bitcast (i32 ({{.*}})* @"\01?filt$0@0@nested_try@@" to i8*)] +// CHECK-NEXT: catchret {{.*}} to label %[[except_outer:[^ ]*]] // // CHECK: [[except_outer]] // CHECK: store i32 456, i32* %[[r]] -// CHECK: br label %[[outer_try_cont]] +// CHECK: br label %[[outer_try_cont:[^ ]*]] // // CHECK: [[outer_try_cont]] // CHECK: %[[r_load:[^ ]*]] = load i32, i32* %[[r]] // CHECK: ret i32 %[[r_load]] // +// CHECK: [[cpad_inner]] +// CHECK: catchpad within %[[cs_inner]] [i8* bitcast (i32 ({{.*}})* @"\01?filt$1@0@nested_try@@" to i8*)] +// CHECK-NEXT: catchret {{.*}} to label %[[except_inner:[^ ]*]] +// +// CHECK: [[except_inner]] +// CHECK: store i32 123, i32* %[[r]] +// CHECK: br label %[[inner_try_cont:[^ ]*]] +// +// CHECK: [[inner_try_cont]] +// CHECK: br label %[[outer_try_cont]] +// // CHECK: [[cont]] // CHECK: store i32 0, i32* %[[r]] // CHECK: br label %[[inner_try_cont]] @@ -193,14 +190,10 @@ int basic_finally(int g) { // CHECK: ret i32 // // CHECK: [[cleanuppad]] -// CHECK: %[[padtoken:[^ ]*]] = cleanuppad [] +// CHECK: %[[padtoken:[^ ]*]] = cleanuppad within none [] // CHECK: %[[fp:[^ ]*]] = call i8* @llvm.localaddress() -// CHECK: invoke void @"\01?fin$0@0@basic_finally@@"({{i8( zeroext)?}} 1, i8* %[[fp]]) -// CHECK: to label %[[cleanupcont:[^ ]*]] unwind label %[[cleanupend:[^ ]*]] -// CHECK: [[cleanupcont]] -// CHECK: cleanupret %[[padtoken]] unwind to caller -// CHECK: [[cleanupend]] -// CHECK: cleanupendpad %[[padtoken]] unwind to caller +// CHECK: call void @"\01?fin$0@0@basic_finally@@"({{i8( zeroext)?}} 1, i8* %[[fp]]) +// CHECK: cleanupret from %[[padtoken]] unwind to caller // CHECK: define internal void @"\01?fin$0@0@basic_finally@@"({{i8( zeroext)?}} %abnormal_termination, i8* %frame_pointer) // CHECK: call i8* @llvm.localrecover(i8* bitcast (i32 (i32)* @basic_finally to i8*), i8* %frame_pointer, i32 0) @@ -278,7 +271,7 @@ int exception_code_in_except(void) { // CHECK: %[[code_slot:[^ ]*]] = alloca i32 // CHECK: invoke void @try_body(i32 0, i32 0, i32* null) // CHECK: %[[pad:[^ ]*]] = catchpad -// CHECK: catchret %[[pad]] +// CHECK: catchret from %[[pad]] // X64: %[[code:[^ ]*]] = call i32 @llvm.eh.exceptioncode(token %[[pad]]) // X64: store i32 %[[code]], i32* %[[code_slot]] // CHECK: %[[ret1:[^ ]*]] = load i32, i32* %[[code_slot]] |