Tanya Lattner | 2393a24 | 2004-11-06 23:08:26 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-as -f %s -o - | llc |
| 2 | |
Vikram S. Adve | a7a1c7e | 2002-07-10 21:54:05 +0000 | [diff] [blame] | 3 | ;; |
| 4 | ;; Test the sequence: |
| 5 | ;; cast -> setle 0, %cast -> br %cond |
| 6 | ;; This sequence should cause the cast value to be forwarded twice, |
| 7 | ;; i.e., cast is forwarded to the setle and teh setle is forwarded |
| 8 | ;; 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 | |
| 16 | ;;;; ****************************************************** |
| 17 | implementation |
| 18 | ;;;; ****************************************************** |
| 19 | |
| 20 | int "SumArray"(int %Num) |
| 21 | begin |
| 22 | bb0: ;[#uses=3] |
| 23 | br label %Top |
| 24 | Top: |
| 25 | %Num = alloca int ; <int *> [#uses=2] |
| 26 | store int %Num, int * %Num |
| 27 | %reg108 = load int * %Num ; <int> [#uses=2] |
| 28 | %cast1006 = cast int %reg108 to uint ; <uint> [#uses=1] |
| 29 | %cond1001 = setle uint %cast1006, 0 ; <bool> [#uses=1] |
| 30 | br bool %cond1001, label %bb6, label %Top |
| 31 | |
| 32 | bb6: |
| 33 | ret int 42 |
| 34 | end |
| 35 | |