Files
wasmtime/filetests/licm/multiple-blocks.cton
Aleksey Kuznetsov 8b484b1c77 Binary function names (#91)
* 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
2017-06-10 10:30:37 -07:00

47 lines
932 B
Plaintext

test licm
function %multiple_blocks(i32) -> i32 {
ebb0(v0: i32):
jump ebb1(v0)
ebb1(v10: i32):
v11 = iconst.i32 1
v12 = iconst.i32 2
v13 = iadd v11, v12
brz v10, ebb2(v10)
v15 = isub v10, v11
brz v15, ebb3(v15)
v14 = isub v10, v11
jump ebb1(v14)
ebb2(v20: i32):
return v20
ebb3(v30: i32):
v31 = iadd v11, v13
jump ebb1(v30)
}
; sameln:function %multiple_blocks(i32) -> i32 {
; nextln: ebb0(v0: i32):
; nextln: v2 = iconst.i32 1
; nextln: v3 = iconst.i32 2
; nextln: v4 = iadd v2, v3
; nextln: v9 = iadd v2, v4
; nextln: jump ebb1(v0)
; nextln:
; nextln: ebb1(v1: i32):
; nextln: brz v1, ebb2(v1)
; nextln: v5 = isub v1, v2
; nextln: brz v5, ebb3(v5)
; nextln: v6 = isub v1, v2
; nextln: jump ebb1(v6)
; nextln:
; nextln: ebb2(v7: i32):
; nextln: return v7
; nextln:
; nextln: ebb3(v8: i32):
; nextln: jump ebb1(v8)
; nextln: }