From 3917b754831350c4757d851005528377bfe08e3d Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Fri, 17 Jun 2016 14:43:55 -0700 Subject: [PATCH] Fix tests broken @ 0507cf1f (func_fields order) --- ml-proto/test/func.wast | 28 ++++++++++++++-------------- ml-proto/test/get_local.wast | 16 +++++++++------- ml-proto/test/set_local.wast | 16 +++++++++------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/ml-proto/test/func.wast b/ml-proto/test/func.wast index c79012bd97..33e793e0b7 100644 --- a/ml-proto/test/func.wast +++ b/ml-proto/test/func.wast @@ -45,15 +45,15 @@ ;; Typing of locals - (func "local-first-i32" (local i32 i32) (result i32) (get_local 0)) - (func "local-first-i64" (local i64 i64) (result i64) (get_local 0)) - (func "local-first-f32" (local f32 f32) (result f32) (get_local 0)) - (func "local-first-f64" (local f64 f64) (result f64) (get_local 0)) - (func "local-second-i32" (local i32 i32) (result i32) (get_local 1)) - (func "local-second-i64" (local i64 i64) (result i64) (get_local 1)) - (func "local-second-f32" (local f32 f32) (result f32) (get_local 1)) - (func "local-second-f64" (local f64 f64) (result f64) (get_local 1)) - (func "local-mixed" (local f32) (local $x i32) (local i64 i32) (local) (local f64 i32) (result f64) + (func "local-first-i32" (result i32) (local i32 i32) (get_local 0)) + (func "local-first-i64" (result i64) (local i64 i64) (get_local 0)) + (func "local-first-f32" (result f32) (local f32 f32) (get_local 0)) + (func "local-first-f64" (result f64) (local f64 f64) (get_local 0)) + (func "local-second-i32" (result i32) (local i32 i32) (get_local 1)) + (func "local-second-i64" (result i64) (local i64 i64) (get_local 1)) + (func "local-second-f32" (result f32) (local f32 f32) (get_local 1)) + (func "local-second-f64" (result f64) (local f64 f64) (get_local 1)) + (func "local-mixed" (result f64) (local f32) (local $x i32) (local i64 i32) (local) (local f64 i32) (f32.neg (get_local 0)) (i32.eqz (get_local 1)) (i64.eqz (get_local 2)) @@ -153,10 +153,10 @@ ;; Default initialization of locals - (func "init-local-i32" (local i32) (result i32) (get_local 0)) - (func "init-local-i64" (local i64) (result i64) (get_local 0)) - (func "init-local-f32" (local f32) (result f32) (get_local 0)) - (func "init-local-f64" (local f64) (result f64) (get_local 0)) + (func "init-local-i32" (result i32) (local i32) (get_local 0)) + (func "init-local-i64" (result i64) (local i64) (get_local 0)) + (func "init-local-f32" (result f32) (local f32) (get_local 0)) + (func "init-local-f64" (result f64) (local f64) (get_local 0)) ) (assert_return (invoke "local-first-i32") (i32.const 0)) @@ -280,7 +280,7 @@ ;; Invalid typing of locals (assert_invalid - (module (func $type-local-num-vs-num (local i32) (result i64) (get_local 0))) + (module (func $type-local-num-vs-num (result i64) (local i32) (get_local 0))) "type mismatch" ) (assert_invalid diff --git a/ml-proto/test/get_local.wast b/ml-proto/test/get_local.wast index e2549dd149..a31c527a28 100644 --- a/ml-proto/test/get_local.wast +++ b/ml-proto/test/get_local.wast @@ -3,17 +3,18 @@ (module ;; Typing - (func "type-local-i32" (local i32) (result i32) (get_local 0)) - (func "type-local-i64" (local i64) (result i64) (get_local 0)) - (func "type-local-f32" (local f32) (result f32) (get_local 0)) - (func "type-local-f64" (local f64) (result f64) (get_local 0)) + (func "type-local-i32" (result i32) (local i32) (get_local 0)) + (func "type-local-i64" (result i64) (local i64) (get_local 0)) + (func "type-local-f32" (result f32) (local f32) (get_local 0)) + (func "type-local-f64" (result f64) (local f64) (get_local 0)) (func "type-param-i32" (param i32) (result i32) (get_local 0)) (func "type-param-i64" (param i64) (result i64) (get_local 0)) (func "type-param-f32" (param f32) (result f32) (get_local 0)) (func "type-param-f64" (param f64) (result f64) (get_local 0)) - (func "type-mixed" (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64) (result f64) + (func "type-mixed" (param i64 f32 f64 i32 i32) (result f64) + (local f32 i64 i64 f64) (i64.eqz (get_local 0)) (f32.neg (get_local 1)) (f64.neg (get_local 2)) @@ -27,7 +28,8 @@ ;; Reading - (func "read" (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64) (result f64) + (func "read" (param i64 f32 f64 i32 i32) (result f64) + (local f32 i64 i64 f64) (set_local 5 (f32.const 5.5)) (set_local 6 (i64.const 6)) (set_local 8 (f64.const 8)) @@ -87,7 +89,7 @@ ;; Invalid typing of access to locals (assert_invalid - (module (func $type-local-num-vs-num (local i32) (result i64) (get_local 0))) + (module (func $type-local-num-vs-num (result i64) (local i32) (get_local 0))) "type mismatch" ) (assert_invalid diff --git a/ml-proto/test/set_local.wast b/ml-proto/test/set_local.wast index e93960d9ea..615eeae6ab 100644 --- a/ml-proto/test/set_local.wast +++ b/ml-proto/test/set_local.wast @@ -3,10 +3,10 @@ (module ;; Typing - (func "type-local-i32" (local i32) (result i32) (set_local 0 (i32.const 0))) - (func "type-local-i64" (local i64) (result i64) (set_local 0 (i64.const 0))) - (func "type-local-f32" (local f32) (result f32) (set_local 0 (f32.const 0))) - (func "type-local-f64" (local f64) (result f64) (set_local 0 (f64.const 0))) + (func "type-local-i32" (result i32) (local i32) (set_local 0 (i32.const 0))) + (func "type-local-i64" (result i64) (local i64) (set_local 0 (i64.const 0))) + (func "type-local-f32" (result f32) (local f32) (set_local 0 (f32.const 0))) + (func "type-local-f64" (result f64) (local f64) (set_local 0 (f64.const 0))) (func "type-param-i32" (param i32) (result i32) (set_local 0 (i32.const 10))) (func "type-param-i64" (param i64) (result i64) (set_local 0 (i64.const 11))) @@ -27,7 +27,8 @@ ;; Writing - (func "write" (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64) (result i64) + (func "write" (param i64 f32 f64 i32 i32) (result i64) + (local f32 i64 i64 f64) (set_local 1 (f32.const -0.3)) (set_local 3 (i32.const 40)) (set_local 4 (i32.const -7)) @@ -65,7 +66,8 @@ ;; Result - (func "result" (param i64 f32 f64 i32 i32) (local f32 i64 i64 f64) (result f64) + (func "result" (param i64 f32 f64 i32 i32) (result f64) + (local f32 i64 i64 f64) (f64.add (f64.convert_u/i64 (set_local 0 (i64.const 1))) (f64.add @@ -128,7 +130,7 @@ ;; Invalid typing of access to locals (assert_invalid - (module (func $type-local-num-vs-num (local i32) (result i64) (set_local 0 (i32.const 0)))) + (module (func $type-local-num-vs-num (result i64) (local i32) (set_local 0 (i32.const 0)))) "type mismatch" ) (assert_invalid