* Function names should start with % * Create FunctionName from string * Implement displaying of FunctionName as %nnnn with fallback to #xxxx * Run rustfmt and fix FunctionName::with_string in parser * Implement FunctionName::new as a generic function * Binary function names should start with # * Implement NameRepr for function name * Fix examples in docs to reflect that function names start with % * Rebase and fix filecheck tests
32 lines
613 B
Plaintext
32 lines
613 B
Plaintext
test licm
|
|
|
|
function %simple_loop(i32) -> i32 {
|
|
|
|
ebb1(v0: i32):
|
|
v1 = iconst.i32 1
|
|
v2 = iconst.i32 2
|
|
v3 = iadd v1, v2
|
|
brz v0, ebb2(v0)
|
|
v4 = isub v0, v1
|
|
jump ebb1(v4)
|
|
|
|
ebb2(v5: i32):
|
|
return v5
|
|
|
|
}
|
|
; sameln: function %simple_loop(i32) -> i32 {
|
|
; nextln: ebb2(v6: i32):
|
|
; nextln: v1 = iconst.i32 1
|
|
; nextln: v2 = iconst.i32 2
|
|
; nextln: v3 = iadd v1, v2
|
|
; nextln: jump ebb0(v6)
|
|
; nextln:
|
|
; nextln: ebb0(v0: i32):
|
|
; nextln: brz v0, ebb1(v0)
|
|
; nextln: v4 = isub v0, v1
|
|
; nextln: jump ebb0(v4)
|
|
; nextln:
|
|
; nextln: ebb1(v5: i32):
|
|
; nextln: return v5
|
|
; nextln: }
|