blob: 84ea87e9a8c5a3cd4073024bf06dd6f8424815ce [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade %s | llvm-as | llc
2
3;;
4;; Test the sequence:
5;; cast -> setle 0, %cast -> br %cond
6;; This sequence should cause the cast value to be forwarded twice,
Dan Gohmanef16fc62007-09-24 15:50:11 +00007;; i.e., cast is forwarded to the setle and the setle is forwarded
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008;; to the branch.
9;; register argument of the "branch-on-register" instruction, i.e.,
10;;
11;; This produces the bogus output instruction:
12;; brlez <NULL VALUE>, .L_SumArray_bb3.
13;; This came from %bb1 of sumarrray.ll generated from sumarray.c.
14
15
16int %SumArray(int %Num) {
17 %Num = alloca int
18 br label %Top
19Top:
20 store int %Num, int * %Num
21 %reg108 = load int * %Num
22 %cast1006 = cast int %reg108 to uint
23 %cond1001 = setle uint %cast1006, 0
24 br bool %cond1001, label %bb6, label %Top
25
26bb6:
27 ret int 42
28}