1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=jump-threading,correlated-propagation %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
9 declare i32 @rust_eh_personality() unnamed_addr
11 ; Function Attrs: nounwind
12 declare void @llvm.assume(i1) #0
14 define void @patatino() personality ptr @rust_eh_personality {
15 ; CHECK-LABEL: @patatino(
17 ; CHECK-NEXT: [[T9:%.*]] = invoke ptr @foo()
18 ; CHECK-NEXT: to label [[GOOD:%.*]] unwind label [[BAD:%.*]]
20 ; CHECK-NEXT: [[T10:%.*]] = landingpad { ptr, i32 }
22 ; CHECK-NEXT: resume { ptr, i32 } [[T10]]
24 ; CHECK-NEXT: [[T11:%.*]] = icmp ne ptr [[T9]], null
25 ; CHECK-NEXT: [[T12:%.*]] = zext i1 [[T11]] to i64
26 ; CHECK-NEXT: [[COND:%.*]] = icmp eq i64 [[T12]], 1
27 ; CHECK-NEXT: br i1 [[COND]], label [[IF_TRUE:%.*]], label [[DONE:%.*]]
29 ; CHECK-NEXT: call void @llvm.assume(i1 [[T11]])
30 ; CHECK-NEXT: br label [[DONE]]
32 ; CHECK-NEXT: ret void
35 %t9 = invoke ptr @foo()
36 to label %good unwind label %bad
39 %t10 = landingpad { ptr, i32 }
41 resume { ptr, i32 } %t10
44 %t11 = icmp ne ptr %t9, null
45 %t12 = zext i1 %t11 to i64
46 %cond = icmp eq i64 %t12, 1
47 br i1 %cond, label %if_true, label %done
50 call void @llvm.assume(i1 %t11)
57 attributes #0 = { nounwind }