mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-09 19:01:05 +00:00
Add test for empty loops (#169)
This commit is contained in:
committed by
GitHub
parent
6ff274f0b8
commit
2f88f49ef6
@@ -964,4 +964,30 @@ mod tests {
|
||||
(get_global 0)))
|
||||
"#
|
||||
}
|
||||
|
||||
test_gas_counter_injection! {
|
||||
name = empty_loop;
|
||||
input = r#"
|
||||
(module
|
||||
(func
|
||||
(loop
|
||||
(br 0)
|
||||
)
|
||||
unreachable
|
||||
)
|
||||
)
|
||||
"#;
|
||||
expected = r#"
|
||||
(module
|
||||
(func
|
||||
(call 0 (i32.const 2))
|
||||
(loop
|
||||
(call 0 (i32.const 1))
|
||||
(br 0)
|
||||
)
|
||||
unreachable
|
||||
)
|
||||
)
|
||||
"#
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user