brintos

brintos / llvm-project-archived public Read only

0
0
Text · 812 B · a590d5c Raw
33 lines · plain
1; RUN: opt -S -O2 < %s | FileCheck %s2 3; Feature test that verifies that all optimizations leave asynch personality4; invokes of nounwind functions alone.5; The @div function in this test can fault, even though it can't6; throw a synchronous exception.7 8define i32 @div(i32 %n, i32 %d) nounwind noinline {9entry:10  %div = sdiv i32 %n, %d11  ret i32 %div12}13 14define i32 @main() nounwind personality ptr @__C_specific_handler {15entry:16  %call = invoke i32 @div(i32 10, i32 0)17          to label %__try.cont unwind label %lpad18 19lpad:20  %0 = landingpad { ptr, i32 }21          catch ptr null22  br label %__try.cont23 24__try.cont:25  %retval.0 = phi i32 [ %call, %entry ], [ 0, %lpad ]26  ret i32 %retval.027}28 29; CHECK-LABEL: define i32 @main()30; CHECK: invoke i32 @div(i32 10, i32 0)31 32declare i32 @__C_specific_handler(...)33