Reid Spencer | 0db64ca | 2006-12-19 02:07:11 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | llc |
Tanya Lattner | 2393a24 | 2004-11-06 23:08:26 +0000 | [diff] [blame] | 2 | |
Vikram S. Adve | 0188ce4 | 2002-09-28 16:51:47 +0000 | [diff] [blame] | 3 | ; This caused a problem because the argument of a call was defined by |
| 4 | ; the return value of another call that appears later in the code. |
| 5 | ; When processing the first call, the second call has not yet been processed |
| 6 | ; so no LiveRange has been created for its return value. |
| 7 | ; |
| 8 | ; llc dies in UltraSparcRegInfo::suggestRegs4CallArgs() with: |
| 9 | ; ERROR: In call instr, no LR for arg: 0x1009e0740 |
| 10 | ; |
| 11 | implementation ; Functions: |
| 12 | |
Dan Gohman | 318f0de | 2007-07-16 13:37:30 +0000 | [diff] [blame] | 13 | declare int %getInt(int) |
Vikram S. Adve | 0188ce4 | 2002-09-28 16:51:47 +0000 | [diff] [blame] | 14 | |
| 15 | int %main(int %argc, sbyte** %argv) { |
| 16 | bb0: ;[#uses=0] |
| 17 | br label %bb2 |
| 18 | |
| 19 | bb1: |
| 20 | %reg222 = call int (int)* %getInt(int %reg218) ;; ARG #1 HAS NO LR |
| 21 | %reg110 = add int %reg222, 1 |
| 22 | %b = setle int %reg110, 0 |
| 23 | br bool %b, label %bb2, label %bb3 |
| 24 | |
| 25 | bb2: |
| 26 | %reg218 = call int (int)* %getInt(int %argc) ;; THIS CALL NOT YET SEEN |
| 27 | br label %bb1 |
| 28 | |
| 29 | bb3: |
| 30 | ret int %reg110 |
| 31 | } |
| 32 | |