1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
4 declare void @may_unwind()
6 declare i32 @__gxx_personality_v0(...)
8 define i1 @test_invoke_in_block_with_assume(i32 %x) personality ptr @__gxx_personality_v0 {
9 ; CHECK-LABEL: @test_invoke_in_block_with_assume(
11 ; CHECK-NEXT: call void @may_unwind()
12 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i32 [[X:%.*]], 10
13 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
14 ; CHECK-NEXT: invoke void @may_unwind()
15 ; CHECK-NEXT: to label [[CONT:%.*]] unwind label [[LPAD:%.*]]
17 ; CHECK-NEXT: [[C_2:%.*]] = icmp ult i32 [[X]], 9
18 ; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_2]]
19 ; CHECK-NEXT: ret i1 [[RES_1]]
21 ; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 }
22 ; CHECK-NEXT: filter [0 x ptr] zeroinitializer
23 ; CHECK-NEXT: [[C_3:%.*]] = icmp ult i32 [[X]], 9
24 ; CHECK-NEXT: [[RES_2:%.*]] = xor i1 true, [[C_3]]
25 ; CHECK-NEXT: ret i1 [[RES_2]]
28 call void @may_unwind()
29 %c.1 = icmp ult i32 %x, 10
30 call void @llvm.assume(i1 %c.1)
31 invoke void @may_unwind()
32 to label %cont unwind label %lpad
35 %t.1 = icmp ult i32 %x, 10
36 %c.2 = icmp ult i32 %x, 9
37 %res.1 = xor i1 %t.1, %c.2
41 %lp = landingpad { ptr, i32 }
42 filter [0 x ptr] zeroinitializer
43 %t.2 = icmp ult i32 %x, 10
44 %c.3 = icmp ult i32 %x, 9
45 %res.2 = xor i1 %t.2, %c.3
49 declare void @llvm.assume(i1)