diff options
Diffstat (limited to 'test/lit/passes/inlining_all-features.wast')
-rw-r--r-- | test/lit/passes/inlining_all-features.wast | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/lit/passes/inlining_all-features.wast b/test/lit/passes/inlining_all-features.wast index f48d72409..b3089baeb 100644 --- a/test/lit/passes/inlining_all-features.wast +++ b/test/lit/passes/inlining_all-features.wast @@ -1,7 +1,7 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; NOTE: This test was ported using port_test.py and could be cleaned up. ;; RUN: foreach %s %t wasm-opt --inlining --all-features -S -o - | filecheck %s +;; RUN: foreach %s %t wasm-opt --inlining --all-features --nominal -S -o - | filecheck %s (module ;; CHECK: (type $none_=>_none (func)) @@ -12,12 +12,14 @@ ;; CHECK: (export "ref_func_test" (func $ref_func_test)) (export "ref_func_test" (func $ref_func_test)) + ;; $foo should not be removed after being inlined, because there is 'ref.func' ;; instruction that refers to it ;; CHECK: (func $foo ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $foo) + ;; CHECK: (func $ref_func_test (result funcref) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block $__inlined_func$foo @@ -31,6 +33,7 @@ (ref.func $foo) ) ) + (module ;; a function reference in a global's init should be noticed, and prevent us ;; from removing an inlined function @@ -38,12 +41,14 @@ ;; CHECK: (global $global$0 (mut funcref) (ref.func $0)) (global $global$0 (mut funcref) (ref.func $0)) + ;; CHECK: (func $0 (result i32) ;; CHECK-NEXT: (i32.const 1337) ;; CHECK-NEXT: ) (func $0 (result i32) (i32.const 1337) ) + ;; CHECK: (func $1 (result i32) ;; CHECK-NEXT: (block $__inlined_func$0 (result i32) ;; CHECK-NEXT: (i32.const 1337) @@ -53,6 +58,7 @@ (call $0) ) ) + (module ;; a function reference in the start should be noticed, and prevent us ;; from removing an inlined function @@ -60,12 +66,14 @@ ;; CHECK: (start $0) (start $0) + ;; CHECK: (func $0 ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $0 (nop) ) + ;; CHECK: (func $1 ;; CHECK-NEXT: (block $__inlined_func$0 ;; CHECK-NEXT: (nop) @@ -75,12 +83,15 @@ (call $0) ) ) + ;; inline a return_call_ref (module ;; CHECK: (type $none_=>_none (func)) (type $none_=>_none (func)) + ;; CHECK: (export "func_36_invoker" (func $1)) (export "func_36_invoker" (func $1)) + (func $0 (return_call_ref (ref.null $none_=>_none) @@ -101,6 +112,7 @@ (call $0) ) ) + ;; handle non-nullable parameter types (which turn into local types after ;; inlining) (module @@ -128,6 +140,7 @@ ) ) ) + ;; never inline an rtt parameter, as those cannot be handled as locals (module ;; CHECK: (type $struct (struct )) |