mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-29 07:31:54 +00:00
Test recursive calls
This commit is contained in:
parent
71b8b933bf
commit
056ac258cd
@ -229,6 +229,28 @@ fn module_limits_validity() {
|
|||||||
assert!(validate_module(&m).is_err());
|
assert!(validate_module(&m).is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn funcs() {
|
||||||
|
// recursive function calls is legal.
|
||||||
|
let m = module()
|
||||||
|
.function()
|
||||||
|
.signature().return_type().i32().build()
|
||||||
|
.body().with_opcodes(Opcodes::new(vec![
|
||||||
|
Opcode::Call(1),
|
||||||
|
Opcode::End,
|
||||||
|
])).build()
|
||||||
|
.build()
|
||||||
|
.function()
|
||||||
|
.signature().return_type().i32().build()
|
||||||
|
.body().with_opcodes(Opcodes::new(vec![
|
||||||
|
Opcode::Call(0),
|
||||||
|
Opcode::End,
|
||||||
|
])).build()
|
||||||
|
.build()
|
||||||
|
.build();
|
||||||
|
assert!(validate_module(&m).is_ok());
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: pepyakin
|
// TODO: pepyakin
|
||||||
// #[test]
|
// #[test]
|
||||||
// fn if_else_with_return_type_validation() {
|
// fn if_else_with_return_type_validation() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user