From 4197c06ab756cdc7c3c1cd79c219fb8a9002a342 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 22 Aug 2016 13:39:08 -0700 Subject: fix the interp/ tests, move the spec tests out Mostly just requires proper implementation of drop/tee_local in wasm-binary-reader-interpreter.c and wasm-interpreter.c. --- test/interp/nested-if.txt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test/interp/nested-if.txt') diff --git a/test/interp/nested-if.txt b/test/interp/nested-if.txt index f0baac5b..261b03ee 100644 --- a/test/interp/nested-if.txt +++ b/test/interp/nested-if.txt @@ -1,13 +1,9 @@ ;;; TOOL: run-interp -;; This tests two paths branching to the same location, with different value -;; stack heights. - -;; The (i32.const 2) value needs to be discarded because the false branch of the -;; outer if does not return a value. However, in a bottom-up parser, this is not -;; known until the inner if expression is reduced. So the previously generated -;; code for the true branch of the outer if must be fixed-up later, when the -;; outer if expression is reduced. +;; This used to test an odd case where a nested if would return a void, so the +;; true branch of the outer if would have to be dropped its instructions had +;; already been generated. Now that drops are explicit, this case is +;; straightforward. (module (export "f" $f) @@ -15,7 +11,7 @@ (block $exit (if ;; outer if (i32.const 1) - (i32.const 2) + (drop (i32.const 2)) (if ;; inner if (i32.const 3) (br $exit)))) -- cgit v1.2.3