1 ; RUN: opt < %s -S -instcombine | FileCheck %s
3 ; Derived from gcc.c-torture/execute/frame-address.c
8 ; CHECK: ret i32 %retval
10 define i32 @func(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp {
12 %d = alloca i8, align 1
13 store i8 0, i8* %d, align 1
14 %cmp = icmp ugt i8* %d, %c
15 br i1 %cmp, label %if.else, label %if.then
17 if.then: ; preds = %entry
18 %cmp2 = icmp ule i8* %d, %f
19 %not.cmp1 = icmp uge i8* %c, %f
20 %.cmp2 = and i1 %cmp2, %not.cmp1
21 %land.ext = zext i1 %.cmp2 to i32
24 if.else: ; preds = %entry
25 %cmp5 = icmp uge i8* %d, %f
26 %not.cmp3 = icmp ule i8* %c, %f
27 %.cmp5 = and i1 %cmp5, %not.cmp3
28 %land.ext7 = zext i1 %.cmp5 to i32
31 return: ; preds = %if.else, %if.then
32 %retval.0 = phi i32 [ %land.ext, %if.then ], [ %land.ext7, %if.else ]