1 ; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
3 ; Don't remove invokes of nounwind functions if the personality handles async
4 ; exceptions. The @div function in this test can fault, even though it can't
5 ; throw a synchronous exception.
7 define i32 @div(i32 %n, i32 %d) nounwind {
13 define i32 @main() nounwind personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
15 %call = invoke i32 @div(i32 10, i32 0)
16 to label %__try.cont unwind label %lpad
19 %0 = landingpad { i8*, i32 }
24 %retval.0 = phi i32 [ %call, %entry ], [ 0, %lpad ]
28 ; CHECK-LABEL: define i32 @main()
29 ; CHECK: invoke i32 @div(i32 10, i32 0)
31 declare i32 @__C_specific_handler(...)