diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-12 09:19:28 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-12 09:19:28 -0500 |
commit | 54e70e4b391d87482024efcf0829e967e46da866 (patch) | |
tree | 9c90bec91a7b597f2384aec7ba06a673c67ca0ee | |
parent | a6be5ae3d999d514359fdd4a2f5284555ade54a0 (diff) | |
download | binaryen-54e70e4b391d87482024efcf0829e967e46da866.tar.gz binaryen-54e70e4b391d87482024efcf0829e967e46da866.tar.bz2 binaryen-54e70e4b391d87482024efcf0829e967e46da866.zip |
add call.s
-rwxr-xr-x | auto_update_tests.py | 7 | ||||
-rwxr-xr-x | check.py | 7 | ||||
-rw-r--r-- | test/dot_s/call.wast | 111 |
3 files changed, 121 insertions, 4 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py index c423db6ab..c47d52f21 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -32,10 +32,13 @@ for t in sorted(os.listdir('test')): open(t, 'w').write(actual) -for s in ['minimal.s', 'basics.s']: +for s in ['minimal.s', 'basics.s', 'call.s']: print '..', s wasm = s.replace('.s', '.wast') - actual, err = subprocess.Popen([os.path.join('bin', 's2wasm'), os.path.join('test', 'dot_s', s)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + full = os.path.join('test', 'dot_s', s) + if not os.path.exists(full): + full = os.path.join('test', 'experimental', 'prototype-wasmate', 'test', s) + actual, err = subprocess.Popen([os.path.join('bin', 's2wasm'), full], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() assert err == '', 'bad err:' + err expected_file = os.path.join('test', 'dot_s', wasm) open(expected_file, 'w').write(actual) @@ -214,10 +214,13 @@ for t in spec_tests: print '\n[ checking .s testcases... ]\n' -for s in ['minimal.s', 'basics.s']: +for s in ['minimal.s', 'basics.s', 'call.s']: print '..', s wasm = s.replace('.s', '.wast') - actual, err = subprocess.Popen([os.path.join('bin', 's2wasm'), os.path.join('test', 'dot_s', s)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + full = os.path.join('test', 'dot_s', s) + if not os.path.exists(full): + full = os.path.join('test', 'experimental', 'prototype-wasmate', 'test', s) + actual, err = subprocess.Popen([os.path.join('bin', 's2wasm'), full], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() assert err == '', 'bad err:' + err # verify output diff --git a/test/dot_s/call.wast b/test/dot_s/call.wast new file mode 100644 index 000000000..0e1ed43cb --- /dev/null +++ b/test/dot_s/call.wast @@ -0,0 +1,111 @@ +(module + (memory 0 4294967295) + (func $call_i32_nullary (result i32) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call $i32_nullary) + ) + ) + ) + ) + (func $call_i64_nullary (result i64) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call $i64_nullary) + ) + ) + ) + ) + (func $call_float_nullary (result f32) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call $float_nullary) + ) + ) + ) + ) + (func $call_double_nullary (result f64) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call $double_nullary) + ) + ) + ) + ) + (func $call_void_nullary + (block $fake_return_waka123 + (block + (call $void_nullary) + (br $fake_return_waka123) + ) + ) + ) + (func $call_i32_unary (param $$0 i32) (result i32) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call $i32_unary + (get_local $$0) + ) + ) + ) + ) + ) + (func $call_i32_binary (param $$0 i32) (param $$1 i32) (result i32) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call $i32_binary + (get_local $$1) + (get_local $$0) + ) + ) + ) + ) + ) + (func $call_indirect_void (param $$0 i32) + (block $fake_return_waka123 + (block + (call_import $$0) + (br $fake_return_waka123) + ) + ) + ) + (func $call_indirect_i32 (param $$0 i32) (result i32) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (call_import $$0) + ) + ) + ) + ) + (func $tail_call_void_nullary + (block $fake_return_waka123 + (block + (call $void_nullary) + (br $fake_return_waka123) + ) + ) + ) + (func $fastcc_tail_call_void_nullary + (block $fake_return_waka123 + (block + (call $void_nullary) + (br $fake_return_waka123) + ) + ) + ) + (func $coldcc_tail_call_void_nullary + (block $fake_return_waka123 + (block + (call $void_nullary) + (br $fake_return_waka123) + ) + ) + ) +) |