• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -S -instcombine | FileCheck %s
2
3; Derived from gcc.c-torture/execute/frame-address.c
4
5; CHECK-LABEL:     @func(
6; CHECK:     return:
7; CHECK-NOT: ret i32 0
8; CHECK:     ret i32 %retval
9
10define i32 @func(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp {
11entry:
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
16
17if.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
22  br label %return
23
24if.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
29  br label %return
30
31return:                                           ; preds = %if.else, %if.then
32  %retval.0 = phi i32 [ %land.ext, %if.then ], [ %land.ext7, %if.else ]
33  ret i32 %retval.0
34}
35
36