f7cf7e890a5472947f5846213d13a54c69cbd79c
[oota-llvm.git] / test / Transforms / InstCombine / 2006-12-15-Range-Test.ll
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'icmp' | wc -l | grep 1
2 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'icmp ugt' | wc -l | grep 1
3 ; ModuleID = 'bugpoint-tooptimize.bc'
4 target datalayout = "e-p:32:32"
5 target endian = little
6 target pointersize = 32
7 target triple = "i686-pc-linux-gnu"
8 %r = external global [17 x int]         ; <[17 x int]*> [#uses=1]
9
10 implementation   ; Functions:
11
12 bool %print_pgm_cond_true(int %tmp12.reload, int* %tmp16.out) {
13 newFuncRoot:
14         br label %cond_true
15
16 bb27.exitStub:          ; preds = %cond_true
17         store int %tmp16, int* %tmp16.out
18         ret bool true
19
20 cond_next23.exitStub:           ; preds = %cond_true
21         store int %tmp16, int* %tmp16.out
22         ret bool false
23
24 cond_true:              ; preds = %newFuncRoot
25         %tmp15 = getelementptr [17 x int]* %r, int 0, int %tmp12.reload         ; <int*> [#uses=1]
26         %tmp16 = load int* %tmp15               ; <int> [#uses=4]
27         %tmp18 = icmp slt int %tmp16, -31               ; <bool> [#uses=1]
28         %tmp21 = icmp sgt int %tmp16, 31                ; <bool> [#uses=1]
29         %bothcond = or bool %tmp18, %tmp21              ; <bool> [#uses=1]
30         br bool %bothcond, label %bb27.exitStub, label %cond_next23.exitStub
31 }
32