summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/type-checker.c18
-rw-r--r--src/type-checker.h3
-rw-r--r--test/spec/block.txt64
-rw-r--r--test/spec/br.txt23
-rw-r--r--test/spec/br_if.txt11
-rw-r--r--test/spec/br_table.txt28
-rw-r--r--test/spec/conversions.txt2
-rw-r--r--test/spec/float_exprs.txt2
-rw-r--r--test/spec/if.txt108
-rw-r--r--test/spec/loop.txt17
-rw-r--r--test/spec/select.txt2
-rw-r--r--test/spec/unreachable.txt2
-rw-r--r--test/spec/unreached-invalid.txt52
m---------third_party/testsuite0
14 files changed, 248 insertions, 84 deletions
diff --git a/src/type-checker.c b/src/type-checker.c
index 134669a2..e8935a27 100644
--- a/src/type-checker.c
+++ b/src/type-checker.c
@@ -332,6 +332,7 @@ WabtResult wabt_typechecker_on_br_if(WabtTypeChecker* tc, size_t depth) {
}
WabtResult wabt_typechecker_begin_br_table(WabtTypeChecker* tc) {
+ tc->br_table_sig = WABT_TYPE_ANY;
return pop_and_check_1_type(tc, WABT_TYPE_I32, "br_table");
}
@@ -340,6 +341,13 @@ WabtResult wabt_typechecker_on_br_table_target(WabtTypeChecker* tc,
WabtResult result = WABT_OK;
WabtTypeCheckerLabel* label;
CHECK_RESULT(wabt_typechecker_get_label(tc, depth, &label));
+ assert(label->sig.size <= 1);
+ WabtType label_sig =
+ label->sig.size == 0 ? WABT_TYPE_VOID : label->sig.data[0];
+ COMBINE_RESULT(result,
+ check_type(tc, tc->br_table_sig, label_sig, "br_table"));
+ tc->br_table_sig = label_sig;
+
if (label->label_type != WABT_LABEL_TYPE_LOOP)
COMBINE_RESULT(result, check_signature(tc, &label->sig, "br_table"));
return result;
@@ -421,6 +429,7 @@ static WabtResult on_end(WabtTypeChecker* tc,
}
WabtResult wabt_typechecker_on_end(WabtTypeChecker* tc) {
+ WabtResult result = WABT_OK;
static const char* s_label_type_name[] = {"function", "block", "loop", "if",
"if false branch"};
WABT_STATIC_ASSERT(WABT_ARRAY_SIZE(s_label_type_name) ==
@@ -428,8 +437,15 @@ WabtResult wabt_typechecker_on_end(WabtTypeChecker* tc) {
WabtTypeCheckerLabel* label;
CHECK_RESULT(top_label(tc, &label));
assert(label->label_type < WABT_NUM_LABEL_TYPES);
+ if (label->label_type == WABT_LABEL_TYPE_IF) {
+ if (label->sig.size != 0) {
+ print_error(tc, "if without else cannot have type signature.");
+ result = WABT_ERROR;
+ }
+ }
const char* desc = s_label_type_name[label->label_type];
- return on_end(tc, label, desc, desc);
+ COMBINE_RESULT(result, on_end(tc, label, desc, desc));
+ return result;
}
WabtResult wabt_typechecker_on_grow_memory(WabtTypeChecker* tc) {
diff --git a/src/type-checker.h b/src/type-checker.h
index 978fc728..5e9f6629 100644
--- a/src/type-checker.h
+++ b/src/type-checker.h
@@ -42,6 +42,9 @@ typedef struct WabtTypeChecker {
WabtTypeCheckerErrorHandler* error_handler;
WabtTypeVector type_stack;
WabtTypeCheckerLabelVector label_stack;
+/* TODO(binji): will need to be complete signature when signatures with
+ * multiple types are allowed. */
+ WabtType br_table_sig;
} WabtTypeChecker;
WABT_EXTERN_C_BEGIN
diff --git a/test/spec/block.txt b/test/spec/block.txt
index 80a34a59..0d080b63 100644
--- a/test/spec/block.txt
+++ b/test/spec/block.txt
@@ -17,49 +17,55 @@ out/third_party/testsuite/block.wast:150: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x0000001c: on_end_expr callback failed
out/third_party/testsuite/block.wast:156: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x0000001d: end_function_body callback failed
+ error: type stack size too small at block. got 0, expected at least 1
+ error: @0x0000001b: on_end_expr callback failed
out/third_party/testsuite/block.wast:162: assert_invalid passed:
- error: type stack at end of block is 1, expected 0
+ error: type stack size too small at block. got 0, expected at least 1
+ error: @0x0000001c: on_end_expr callback failed
+out/third_party/testsuite/block.wast:168: assert_invalid passed:
+ error: type mismatch in block, expected i32 but got f32.
error: @0x00000020: on_end_expr callback failed
-out/third_party/testsuite/block.wast:169: assert_invalid passed:
+out/third_party/testsuite/block.wast:174: assert_invalid passed:
+ error: type mismatch in implicit return, expected i32 but got i64.
+ error: @0x00000020: end_function_body callback failed
+out/third_party/testsuite/block.wast:181: assert_invalid passed:
error: type stack size too small at br. got 0, expected at least 1
error: @0x0000001c: on_br_expr callback failed
-out/third_party/testsuite/block.wast:175: assert_invalid passed:
+out/third_party/testsuite/block.wast:187: assert_invalid passed:
error: type stack size too small at br. got 0, expected at least 1
error: @0x0000001c: on_br_expr callback failed
-out/third_party/testsuite/block.wast:182: assert_invalid passed:
- error: type stack at end of block is 1, expected 0
- error: @0x00000020: on_end_expr callback failed
-out/third_party/testsuite/block.wast:188: assert_invalid passed:
- error: type stack at end of block is 1, expected 0
- error: @0x00000021: on_end_expr callback failed
out/third_party/testsuite/block.wast:194: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x00000023: end_function_body callback failed
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001d: on_br_expr callback failed
out/third_party/testsuite/block.wast:200: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x00000024: end_function_body callback failed
-out/third_party/testsuite/block.wast:207: assert_invalid passed:
+ error: type mismatch in br, expected i32 but got i64.
+ error: @0x0000001e: on_br_expr callback failed
+out/third_party/testsuite/block.wast:206: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001d: on_br_expr callback failed
+out/third_party/testsuite/block.wast:212: assert_invalid passed:
+ error: type mismatch in br, expected i32 but got i64.
+ error: @0x0000001e: on_br_expr callback failed
+out/third_party/testsuite/block.wast:219: assert_invalid passed:
error: type stack at end of function is 1, expected 0
error: @0x00000024: end_function_body callback failed
-out/third_party/testsuite/block.wast:213: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x00000025: end_function_body callback failed
-out/third_party/testsuite/block.wast:220: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x00000026: end_function_body callback failed
-out/third_party/testsuite/block.wast:226: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x00000027: end_function_body callback failed
-out/third_party/testsuite/block.wast:233: assert_invalid passed:
+out/third_party/testsuite/block.wast:225: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001e: on_br_expr callback failed
+out/third_party/testsuite/block.wast:232: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001f: on_br_expr callback failed
+out/third_party/testsuite/block.wast:238: assert_invalid passed:
+ error: type mismatch in br, expected i32 but got i64.
+ error: @0x00000020: on_br_expr callback failed
+out/third_party/testsuite/block.wast:245: assert_invalid passed:
error: type stack size too small at i32.ctz. got 0, expected at least 1
error: @0x0000001e: on_unary_expr callback failed
-out/third_party/testsuite/block.wast:240: assert_invalid passed:
+out/third_party/testsuite/block.wast:251: assert_invalid passed:
error: type stack size too small at i64.ctz. got 0, expected at least 1
error: @0x0000001f: on_unary_expr callback failed
-out/third_party/testsuite/block.wast:246: assert_invalid passed:
+out/third_party/testsuite/block.wast:257: assert_invalid passed:
error: type stack size too small at i64.ctz. got 0, expected at least 1
error: @0x00000020: on_unary_expr callback failed
-34/34 tests passed.
+36/36 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/br.txt b/test/spec/br.txt
index acf2ce52..0ccb3c3e 100644
--- a/test/spec/br.txt
+++ b/test/spec/br.txt
@@ -2,22 +2,25 @@
;;; STDIN_FILE: third_party/testsuite/br.wast
(;; STDOUT ;;;
out/third_party/testsuite/br.wast:372: assert_invalid passed:
- error: type stack at end of block is 1, expected 0
- error: @0x0000001f: on_end_expr callback failed
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001c: on_br_expr callback failed
out/third_party/testsuite/br.wast:379: assert_invalid passed:
- error: type stack at end of block is 1, expected 0
- error: @0x00000020: on_end_expr callback failed
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001d: on_br_expr callback failed
out/third_party/testsuite/br.wast:385: assert_invalid passed:
- error: type stack at end of block is 1, expected 0
- error: @0x00000021: on_end_expr callback failed
-out/third_party/testsuite/br.wast:392: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x00000020: on_br_expr callback failed
+out/third_party/testsuite/br.wast:391: assert_invalid passed:
+ error: type mismatch in br, expected i32 but got i64.
+ error: @0x0000001e: on_br_expr callback failed
+out/third_party/testsuite/br.wast:398: assert_invalid passed:
error: invalid depth: 1 (max 0)
error: @0x00000019: on_br_expr callback failed
-out/third_party/testsuite/br.wast:396: assert_invalid passed:
+out/third_party/testsuite/br.wast:402: assert_invalid passed:
error: invalid depth: 5 (max 2)
error: @0x0000001d: on_br_expr callback failed
-out/third_party/testsuite/br.wast:400: assert_invalid passed:
+out/third_party/testsuite/br.wast:406: assert_invalid passed:
error: invalid depth: 268435457 (max 0)
error: @0x0000001d: on_br_expr callback failed
-67/67 tests passed.
+68/68 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/br_if.txt b/test/spec/br_if.txt
index ee715d67..643b5ff4 100644
--- a/test/spec/br_if.txt
+++ b/test/spec/br_if.txt
@@ -59,16 +59,19 @@ out/third_party/testsuite/br_if.wast:267: assert_invalid passed:
error: type stack size too small at br_if. got 0, expected at least 1
error: @0x0000001f: on_br_if_expr callback failed
out/third_party/testsuite/br_if.wast:273: assert_invalid passed:
+ error: type stack size too small at br_if. got 0, expected at least 1
+ error: @0x00000022: on_br_if_expr callback failed
+out/third_party/testsuite/br_if.wast:279: assert_invalid passed:
error: type mismatch in br_if, expected i32 but got i64.
error: @0x00000020: on_br_if_expr callback failed
-out/third_party/testsuite/br_if.wast:280: assert_invalid passed:
+out/third_party/testsuite/br_if.wast:286: assert_invalid passed:
error: invalid depth: 1 (max 0)
error: @0x0000001b: on_br_if_expr callback failed
-out/third_party/testsuite/br_if.wast:284: assert_invalid passed:
+out/third_party/testsuite/br_if.wast:290: assert_invalid passed:
error: invalid depth: 5 (max 2)
error: @0x0000001f: on_br_if_expr callback failed
-out/third_party/testsuite/br_if.wast:288: assert_invalid passed:
+out/third_party/testsuite/br_if.wast:294: assert_invalid passed:
error: invalid depth: 268435457 (max 0)
error: @0x0000001f: on_br_if_expr callback failed
-57/57 tests passed.
+58/58 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/br_table.txt b/test/spec/br_table.txt
index 0f6c0e15..5912a006 100644
--- a/test/spec/br_table.txt
+++ b/test/spec/br_table.txt
@@ -10,35 +10,41 @@ out/third_party/testsuite/br_table.wast:1393: assert_invalid passed:
out/third_party/testsuite/br_table.wast:1399: assert_invalid passed:
error: type mismatch in br_table, expected i32 but got i64.
error: @0x00000023: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1406: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1405: assert_invalid passed:
+ error: type mismatch in br_table, expected void but got f32.
+ error: @0x00000026: on_br_table_expr callback failed
+out/third_party/testsuite/br_table.wast:1417: assert_invalid passed:
error: type stack size too small at br_table. got 0, expected at least 1
error: @0x0000001f: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1412: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1423: assert_invalid passed:
error: type mismatch in br_table, expected i32 but got i64.
error: @0x0000001e: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1418: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1429: assert_invalid passed:
error: type stack size too small at br_table. got 0, expected at least 1
error: @0x00000021: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1424: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1435: assert_invalid passed:
+ error: type stack size too small at br_table. got 0, expected at least 1
+ error: @0x00000023: on_br_table_expr callback failed
+out/third_party/testsuite/br_table.wast:1441: assert_invalid passed:
error: type mismatch in br_table, expected i32 but got i64.
error: @0x00000022: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1431: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1448: assert_invalid passed:
error: invalid depth: 2 (max 1)
error: @0x0000001f: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1437: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1454: assert_invalid passed:
error: invalid depth: 5 (max 2)
error: @0x00000021: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1443: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1460: assert_invalid passed:
error: invalid depth: 268435457 (max 1)
error: @0x00000024: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1450: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1467: assert_invalid passed:
error: invalid depth: 2 (max 1)
error: @0x0000001f: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1456: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1473: assert_invalid passed:
error: invalid depth: 5 (max 2)
error: @0x00000021: on_br_table_expr callback failed
-out/third_party/testsuite/br_table.wast:1462: assert_invalid passed:
+out/third_party/testsuite/br_table.wast:1479: assert_invalid passed:
error: invalid depth: 268435457 (max 1)
error: @0x00000024: on_br_table_expr callback failed
-156/156 tests passed.
+158/158 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/conversions.txt b/test/spec/conversions.txt
index c05b078c..6138d05f 100644
--- a/test/spec/conversions.txt
+++ b/test/spec/conversions.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/conversions.wast
(;; STDOUT ;;;
-359/359 tests passed.
+371/371 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/float_exprs.txt b/test/spec/float_exprs.txt
index bdf0262f..3d19912d 100644
--- a/test/spec/float_exprs.txt
+++ b/test/spec/float_exprs.txt
@@ -11,5 +11,5 @@ init(i32:8, f64:15.2) =>
init(i32:16, f64:15.3) =>
init(i32:24, f64:15.4) =>
run(i32:32, f64:3) =>
-704/704 tests passed.
+724/724 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/if.txt b/test/spec/if.txt
new file mode 100644
index 00000000..c4d49c40
--- /dev/null
+++ b/test/spec/if.txt
@@ -0,0 +1,108 @@
+;;; TOOL: run-interp-spec
+;;; STDIN_FILE: third_party/testsuite/if.wast
+(;; STDOUT ;;;
+out/third_party/testsuite/if.wast:183: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:187: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:191: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:195: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:200: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:204: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:208: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:212: assert_invalid passed:
+ error: type stack size too small at implicit return. got 0, expected at least 1
+ error: @0x0000001e: end_function_body callback failed
+out/third_party/testsuite/if.wast:217: assert_invalid passed:
+ error: type stack at end of if is 1, expected 0
+ error: @0x0000001e: on_end_expr callback failed
+out/third_party/testsuite/if.wast:223: assert_invalid passed:
+ error: type stack at end of if is 1, expected 0
+ error: @0x0000001e: on_end_expr callback failed
+out/third_party/testsuite/if.wast:229: assert_invalid passed:
+ error: type stack at end of if false branch is 1, expected 0
+ error: @0x0000001f: on_end_expr callback failed
+out/third_party/testsuite/if.wast:235: assert_invalid passed:
+ error: type stack at end of if true branch is 1, expected 0
+ error: @0x0000001e: on_else_expr callback failed
+out/third_party/testsuite/if.wast:242: assert_invalid passed:
+ error: type stack size too small at if true branch. got 0, expected at least 1
+ error: @0x0000001d: on_else_expr callback failed
+out/third_party/testsuite/if.wast:248: assert_invalid passed:
+ error: if without else cannot have type signature.
+ error: @0x0000001f: on_end_expr callback failed
+out/third_party/testsuite/if.wast:254: assert_invalid passed:
+ error: if without else cannot have type signature.
+ error: type stack size too small at if. got 0, expected at least 1
+ error: @0x0000001d: on_end_expr callback failed
+out/third_party/testsuite/if.wast:260: assert_invalid passed:
+ error: if without else cannot have type signature.
+ error: @0x0000001f: on_end_expr callback failed
+out/third_party/testsuite/if.wast:267: assert_invalid passed:
+ error: type stack size too small at if true branch. got 0, expected at least 1
+ error: @0x0000001e: on_else_expr callback failed
+out/third_party/testsuite/if.wast:273: assert_invalid passed:
+ error: type stack size too small at if false branch. got 0, expected at least 1
+ error: @0x00000021: on_end_expr callback failed
+out/third_party/testsuite/if.wast:279: assert_invalid passed:
+ error: type stack size too small at if true branch. got 0, expected at least 1
+ error: @0x0000001e: on_else_expr callback failed
+out/third_party/testsuite/if.wast:286: assert_invalid passed:
+ error: type mismatch in if true branch, expected i32 but got i64.
+ error: @0x0000001f: on_else_expr callback failed
+out/third_party/testsuite/if.wast:292: assert_invalid passed:
+ error: type mismatch in if false branch, expected i32 but got i64.
+ error: @0x00000022: on_end_expr callback failed
+out/third_party/testsuite/if.wast:298: assert_invalid passed:
+ error: type mismatch in if true branch, expected i32 but got i64.
+ error: @0x0000001f: on_else_expr callback failed
+out/third_party/testsuite/if.wast:304: assert_invalid passed:
+ error: type mismatch in if true branch, expected i32 but got i64.
+ error: @0x0000001f: on_else_expr callback failed
+out/third_party/testsuite/if.wast:311: assert_invalid passed:
+ error: type mismatch in implicit return, expected i32 but got i64.
+ error: @0x00000025: end_function_body callback failed
+out/third_party/testsuite/if.wast:321: assert_invalid passed:
+ error: type mismatch in implicit return, expected i32 but got i64.
+ error: @0x00000025: end_function_body callback failed
+out/third_party/testsuite/if.wast:331: assert_invalid passed:
+ error: type mismatch in implicit return, expected i32 but got i64.
+ error: @0x00000027: end_function_body callback failed
+out/third_party/testsuite/if.wast:342: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001e: on_br_expr callback failed
+out/third_party/testsuite/if.wast:348: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x00000021: on_br_expr callback failed
+out/third_party/testsuite/if.wast:354: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001e: on_br_expr callback failed
+out/third_party/testsuite/if.wast:360: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x00000021: on_br_expr callback failed
+out/third_party/testsuite/if.wast:366: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x0000001f: on_br_expr callback failed
+out/third_party/testsuite/if.wast:372: assert_invalid passed:
+ error: type stack size too small at br. got 0, expected at least 1
+ error: @0x00000022: on_br_expr callback failed
+out/third_party/testsuite/if.wast:379: assert_invalid passed:
+ error: type mismatch in br, expected i32 but got i64.
+ error: @0x00000020: on_br_expr callback failed
+out/third_party/testsuite/if.wast:385: assert_invalid passed:
+ error: type mismatch in br, expected i32 but got i64.
+ error: @0x00000023: on_br_expr callback failed
+72/72 tests passed.
+;;; STDOUT ;;)
diff --git a/test/spec/loop.txt b/test/spec/loop.txt
index 8a87a638..d754e73d 100644
--- a/test/spec/loop.txt
+++ b/test/spec/loop.txt
@@ -14,10 +14,19 @@ out/third_party/testsuite/loop.wast:238: assert_invalid passed:
error: type stack size too small at implicit return. got 0, expected at least 1
error: @0x0000001c: end_function_body callback failed
out/third_party/testsuite/loop.wast:243: assert_invalid passed:
- error: type stack size too small at implicit return. got 0, expected at least 1
- error: @0x0000001d: end_function_body callback failed
-out/third_party/testsuite/loop.wast:249: assert_invalid passed:
error: type stack at end of loop is 1, expected 0
+ error: @0x0000001c: on_end_expr callback failed
+out/third_party/testsuite/loop.wast:249: assert_invalid passed:
+ error: type stack size too small at loop. got 0, expected at least 1
+ error: @0x0000001b: on_end_expr callback failed
+out/third_party/testsuite/loop.wast:255: assert_invalid passed:
+ error: type stack size too small at loop. got 0, expected at least 1
+ error: @0x0000001c: on_end_expr callback failed
+out/third_party/testsuite/loop.wast:261: assert_invalid passed:
+ error: type mismatch in loop, expected i32 but got f32.
error: @0x00000020: on_end_expr callback failed
-48/48 tests passed.
+out/third_party/testsuite/loop.wast:267: assert_invalid passed:
+ error: type mismatch in implicit return, expected i32 but got i64.
+ error: @0x00000020: end_function_body callback failed
+51/51 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/select.txt b/test/spec/select.txt
index c8cf2fcb..487baecc 100644
--- a/test/spec/select.txt
+++ b/test/spec/select.txt
@@ -1,7 +1,7 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/select.wast
(;; STDOUT ;;;
-out/third_party/testsuite/select.wast:55: assert_invalid passed:
+out/third_party/testsuite/select.wast:65: assert_invalid passed:
error: type stack size too small at select. got 0, expected at least 2
error: @0x0000001c: on_select_expr callback failed
29/29 tests passed.
diff --git a/test/spec/unreachable.txt b/test/spec/unreachable.txt
index f5852dee..5267001c 100644
--- a/test/spec/unreachable.txt
+++ b/test/spec/unreachable.txt
@@ -1,5 +1,5 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/unreachable.wast
(;; STDOUT ;;;
-57/57 tests passed.
+59/59 tests passed.
;;; STDOUT ;;)
diff --git a/test/spec/unreached-invalid.txt b/test/spec/unreached-invalid.txt
index 99cf6a73..a31d6df2 100644
--- a/test/spec/unreached-invalid.txt
+++ b/test/spec/unreached-invalid.txt
@@ -213,6 +213,7 @@ out/third_party/testsuite/unreached-invalid.wast:403: assert_invalid passed:
error: type stack at end of if is 1, expected 0
error: @0x0000001e: on_end_expr callback failed
out/third_party/testsuite/unreached-invalid.wast:409: assert_invalid passed:
+ error: if without else cannot have type signature.
error: type mismatch in if, expected i32 but got f32.
error: @0x00000022: on_end_expr callback failed
out/third_party/testsuite/unreached-invalid.wast:415: assert_invalid passed:
@@ -239,65 +240,74 @@ out/third_party/testsuite/unreached-invalid.wast:454: assert_invalid passed:
out/third_party/testsuite/unreached-invalid.wast:460: assert_invalid passed:
error: type mismatch in br_table, expected i32 but got f32.
error: @0x00000022: on_br_table_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:467: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:466: assert_invalid passed:
+ error: type mismatch in br_table, expected i32 but got f32.
+ error: @0x00000025: on_br_table_expr callback failed
+out/third_party/testsuite/unreached-invalid.wast:472: assert_invalid passed:
+ error: type mismatch in br_table, expected void but got f32.
+ error: @0x00000023: on_br_table_expr callback failed
+out/third_party/testsuite/unreached-invalid.wast:484: assert_invalid passed:
+ error: type mismatch in br_table, expected f64 but got f32.
+ error: @0x00000023: on_br_table_expr callback failed
+out/third_party/testsuite/unreached-invalid.wast:499: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000020: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:473: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:505: assert_invalid passed:
error: type stack size too small at implicit return. got 0, expected at least 1
error: @0x00000020: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:479: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:511: assert_invalid passed:
error: type mismatch in implicit return, expected i32 but got i64.
error: @0x00000022: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:485: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:517: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000023: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:492: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:524: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000021: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:498: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:530: assert_invalid passed:
error: type stack size too small at block. got 0, expected at least 1
error: @0x00000022: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:504: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:536: assert_invalid passed:
error: type mismatch in block, expected i32 but got i64.
error: @0x00000024: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:511: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:543: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000023: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:517: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:549: assert_invalid passed:
error: type stack size too small at block. got 0, expected at least 1
error: @0x00000025: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:523: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:555: assert_invalid passed:
error: type mismatch in block, expected i32 but got i64.
error: @0x00000027: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:529: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:561: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000024: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:536: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:568: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000020: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:542: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:574: assert_invalid passed:
error: type stack size too small at implicit return. got 0, expected at least 1
error: @0x00000022: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:548: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:580: assert_invalid passed:
error: type mismatch in implicit return, expected i32 but got i64.
error: @0x00000024: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:554: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:586: assert_invalid passed:
error: type stack at end of block is 1, expected 0
error: @0x00000025: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:562: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:594: assert_invalid passed:
error: type stack at end of loop is 1, expected 0
error: @0x00000020: on_end_expr callback failed
-out/third_party/testsuite/unreached-invalid.wast:568: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:600: assert_invalid passed:
error: type stack size too small at implicit return. got 0, expected at least 1
error: @0x00000020: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:574: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:606: assert_invalid passed:
error: type mismatch in implicit return, expected i32 but got i64.
error: @0x00000022: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:581: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:613: assert_invalid passed:
error: type stack size too small at implicit return. got 0, expected at least 1
error: @0x0000001f: end_function_body callback failed
-out/third_party/testsuite/unreached-invalid.wast:587: assert_invalid passed:
+out/third_party/testsuite/unreached-invalid.wast:619: assert_invalid passed:
error: type stack size too small at implicit return. got 0, expected at least 1
error: @0x00000020: end_function_body callback failed
-97/97 tests passed.
+100/100 tests passed.
;;; STDOUT ;;)
diff --git a/third_party/testsuite b/third_party/testsuite
-Subproject eefbe96cf19dae516668ae24b8f470effda6f60
+Subproject c07a160d35ccc69cace1bfb30b63d657a35b3d1