1 ; RUN: opt -S -prune-eh < %s | FileCheck %s
2 ; RUN: opt -S -passes='function-attrs,function(simplify-cfg)' < %s | FileCheck %s
4 ; Don't remove invokes of nounwind functions if the personality handles async
5 ; exceptions. The @div function in this test can fault, even though it can't
6 ; throw a synchronous exception.
8 define i32 @div(i32 %n, i32 %d) nounwind {
10 %div = sdiv i32 %n, %d
14 define i32 @main() nounwind personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
16 %call = invoke i32 @div(i32 10, i32 0)
17 to label %__try.cont unwind label %lpad
20 %0 = landingpad { i8*, i32 }
25 %retval.0 = phi i32 [ %call, %entry ], [ 0, %lpad ]
29 ; CHECK-LABEL: define i32 @main()
30 ; CHECK: invoke i32 @div(i32 10, i32 0)
32 declare i32 @__C_specific_handler(...)