diff options
Diffstat (limited to 'test/lit/tail-call.wast')
-rw-r--r-- | test/lit/tail-call.wast | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/test/lit/tail-call.wast b/test/lit/tail-call.wast index 92dfdbb4e..f65ecf165 100644 --- a/test/lit/tail-call.wast +++ b/test/lit/tail-call.wast @@ -3,22 +3,28 @@ ;; Check that tail calls are parsed, validated, and printed correctly ;; RUN: foreach %s %t wasm-opt -all -S -o - | filecheck %s -;; TODO: --nominal as well +;; RUN: foreach %s %t wasm-opt -all -S --nominal -o - | filecheck %s --check-prefix NOMNL (module ;; CHECK: (type $void (func)) + ;; NOMNL: (type $void (func)) (type $void (func)) ;; CHECK: (table $t 1 1 funcref) + ;; NOMNL: (table $t 1 1 funcref) (table $t 1 1 funcref) ;; CHECK: (elem $e (i32.const 0) $foo) + ;; NOMNL: (elem $e (i32.const 0) $foo) (elem $e (i32.const 0) $foo) ;; CHECK: (func $foo ;; CHECK-NEXT: (return_call $bar) ;; CHECK-NEXT: ) + ;; NOMNL: (func $foo + ;; NOMNL-NEXT: (return_call $bar) + ;; NOMNL-NEXT: ) (func $foo (return_call $bar) ) @@ -28,6 +34,11 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; NOMNL: (func $bar + ;; NOMNL-NEXT: (return_call_indirect $t (type $void) + ;; NOMNL-NEXT: (i32.const 0) + ;; NOMNL-NEXT: ) + ;; NOMNL-NEXT: ) (func $bar (return_call_indirect (type $void) (i32.const 0)) ) @@ -36,26 +47,35 @@ ;; Check GC types and subtyping (module ;; CHECK: (type $return-B (func (result (ref $B)))) + ;; NOMNL: (type $return-B (func (result (ref $B)))) (type $return-B (func (result (ref $B)))) ;; CHECK: (type $return-A (func (result (ref null $A)))) + ;; NOMNL: (type $return-A (func (result (ref null $A)))) (type $return-A (func (result (ref null $A)))) ;; CHECK: (type $A (struct (field i32))) + ;; NOMNL: (type $A (struct (field i32))) (type $A (struct i32)) ;; CHECK: (type $B (struct (field i32) (field i32))) - (type $B (struct i32 i32) (supertype $A)) + ;; NOMNL: (type $B (struct (field i32) (field i32)) (extends $A)) + (type $B (struct i32 i32) (extends $A)) ;; CHECK: (table $t 1 1 funcref) + ;; NOMNL: (table $t 1 1 funcref) (table $t 1 1 funcref) ;; CHECK: (elem $e (i32.const 0) $callee) + ;; NOMNL: (elem $e (i32.const 0) $callee) (elem $e (i32.const 0) $callee) ;; CHECK: (func $caller (result (ref null $A)) ;; CHECK-NEXT: (return_call $callee) ;; CHECK-NEXT: ) + ;; NOMNL: (func $caller (result (ref null $A)) + ;; NOMNL-NEXT: (return_call $callee) + ;; NOMNL-NEXT: ) (func $caller (type $return-A) (return_call $callee) ) @@ -65,6 +85,11 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; NOMNL: (func $caller-indirect (result (ref $B)) + ;; NOMNL-NEXT: (return_call_indirect $t (type $return-B) + ;; NOMNL-NEXT: (i32.const 0) + ;; NOMNL-NEXT: ) + ;; NOMNL-NEXT: ) (func $caller-indirect (type $return-B) (return_call_indirect $t (type $return-B) (i32.const 0)) ) @@ -72,6 +97,9 @@ ;; CHECK: (func $callee (result (ref $B)) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) + ;; NOMNL: (func $callee (result (ref $B)) + ;; NOMNL-NEXT: (unreachable) + ;; NOMNL-NEXT: ) (func $callee (type $return-B) (unreachable) ) |