Fix PR1335 and Transforms/Inline/2007-04-15-InlineEH.ll
[oota-llvm.git] / test / CodeGen / Generic / badCallArgLRLLVM.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | llc
2
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
13 declare int %getInt(int);
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