blob: 56384748ac05b659ca01f2b7ad81613d3e1b0f6f [file] [log] [blame]
Tanya Lattner53a66d12008-02-19 01:41:04 +00001; RUN: llvm-as < %s | llc
Tanya Lattner2393a242004-11-06 23:08:26 +00002
Vikram S. Adve0188ce42002-09-28 16:51:47 +00003; 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;
Vikram S. Adve0188ce42002-09-28 16:51:47 +000011
Tanya Lattner53a66d12008-02-19 01:41:04 +000012declare i32 @getInt(i32)
Vikram S. Adve0188ce42002-09-28 16:51:47 +000013
Tanya Lattner53a66d12008-02-19 01:41:04 +000014define i32 @main(i32 %argc, i8** %argv) {
15bb0:
Vikram S. Adve0188ce42002-09-28 16:51:47 +000016 br label %bb2
17
Tanya Lattner53a66d12008-02-19 01:41:04 +000018bb1: ; preds = %bb2
19 %reg222 = call i32 @getInt( i32 %reg218 ) ; <i32> [#uses=1]
20 %reg110 = add i32 %reg222, 1 ; <i32> [#uses=2]
21 %b = icmp sle i32 %reg110, 0 ; <i1> [#uses=1]
22 br i1 %b, label %bb2, label %bb3
Vikram S. Adve0188ce42002-09-28 16:51:47 +000023
Tanya Lattner53a66d12008-02-19 01:41:04 +000024bb2: ; preds = %bb1, %bb0
25 %reg218 = call i32 @getInt( i32 %argc ) ; <i32> [#uses=1]
26 br label %bb1
Vikram S. Adve0188ce42002-09-28 16:51:47 +000027
Tanya Lattner53a66d12008-02-19 01:41:04 +000028bb3: ; preds = %bb1
29 ret i32 %reg110
Vikram S. Adve0188ce42002-09-28 16:51:47 +000030}
31