This adds a "colocated" flag to function and symbolic global variables which indicates that they are defined along with the current function, so they can use PC-relative addressing. This also changes the function decl syntax; the name now always precedes the signature, and the "function" keyword is no longer included.
20 lines
404 B
Plaintext
20 lines
404 B
Plaintext
test regalloc
|
|
isa riscv enable_e
|
|
|
|
; regex: V=v\d+
|
|
|
|
; Check that we can handle a function return value that got spilled.
|
|
function %spill_return() -> i32 {
|
|
fn0 = %foo() -> i32 system_v
|
|
|
|
ebb0:
|
|
v0 = call fn0()
|
|
; check: $(reg=$V) = call fn0
|
|
; check: v0 = spill $reg
|
|
v2 = call fn0()
|
|
; check: v2 = call fn0
|
|
return v0
|
|
; check: $(reload=$V) = fill v0
|
|
; check: return $reload
|
|
}
|