1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -ipsccp -instcombine -S | FileCheck %s
4 define internal i32 @foo(i1 %C) {
6 ; CHECK-NEXT: br i1 [[C:%.*]], label [[T:%.*]], label [[F:%.*]]
8 ; CHECK-NEXT: ret i32 undef
10 ; CHECK-NEXT: ret i32 undef
12 br i1 %C, label %T, label %F
21 define i1 @caller(i1 %C) {
22 ; CHECK-LABEL: @caller(
23 ; CHECK-NEXT: [[X:%.*]] = call i32 @foo(i1 [[C:%.*]])
24 ; CHECK-NEXT: ret i1 true
26 %X = call i32 @foo( i1 %C ) ; <i32> [#uses=1]
27 %Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
31 define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
32 ; CHECK-LABEL: @invokecaller(
33 ; CHECK-NEXT: [[X:%.*]] = invoke i32 @foo(i1 [[C:%.*]])
34 ; CHECK-NEXT: to label [[OK:%.*]] unwind label [[FAIL:%.*]]
36 ; CHECK-NEXT: ret i1 true
38 ; CHECK-NEXT: [[EXN:%.*]] = landingpad { i8*, i32 }
40 ; CHECK-NEXT: ret i1 false
42 %X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; <i32> [#uses=1]
44 %Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
47 %exn = landingpad {i8*, i32}
52 declare i32 @__gxx_personality_v0(...)