diff options
Diffstat (limited to 'test/lit/passes/dae-gc-refine-params.wast')
-rw-r--r-- | test/lit/passes/dae-gc-refine-params.wast | 56 |
1 files changed, 43 insertions, 13 deletions
diff --git a/test/lit/passes/dae-gc-refine-params.wast b/test/lit/passes/dae-gc-refine-params.wast index e7059b0e0..767c2d716 100644 --- a/test/lit/passes/dae-gc-refine-params.wast +++ b/test/lit/passes/dae-gc-refine-params.wast @@ -27,34 +27,36 @@ ;; CHECK: (func $call-various-params-no ;; CHECK-NEXT: (call $various-params-no - ;; CHECK-NEXT: (ref.null ${}) - ;; CHECK-NEXT: (ref.null ${i32}) + ;; CHECK-NEXT: (call $get_{}) + ;; CHECK-NEXT: (call $get_{i32}) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $various-params-no - ;; CHECK-NEXT: (ref.null ${i32}) - ;; CHECK-NEXT: (ref.null ${f64}) + ;; CHECK-NEXT: (call $get_{i32}) + ;; CHECK-NEXT: (call $get_{f64}) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; NOMNL: (func $call-various-params-no (type $none_=>_none) ;; NOMNL-NEXT: (call $various-params-no - ;; NOMNL-NEXT: (ref.null ${}) - ;; NOMNL-NEXT: (ref.null ${i32}) + ;; NOMNL-NEXT: (call $get_{}) + ;; NOMNL-NEXT: (call $get_{i32}) ;; NOMNL-NEXT: ) ;; NOMNL-NEXT: (call $various-params-no - ;; NOMNL-NEXT: (ref.null ${i32}) - ;; NOMNL-NEXT: (ref.null ${f64}) + ;; NOMNL-NEXT: (call $get_{i32}) + ;; NOMNL-NEXT: (call $get_{f64}) ;; NOMNL-NEXT: ) ;; NOMNL-NEXT: ) (func $call-various-params-no ;; The first argument gets {} and {i32}; the second {i32} and {f64}; none of - ;; those pairs can be optimized. + ;; those pairs can be optimized. Note that we do not pass in all nulls, as + ;; all nulls are identical and we could do other optimization work due to + ;; that. (call $various-params-no - (ref.null ${}) - (ref.null ${i32}) + (call $get_{}) + (call $get_{i32}) ) (call $various-params-no - (ref.null ${i32}) - (ref.null ${f64}) + (call $get_{i32}) + (call $get_{f64}) ) ) ;; This function is called in ways that do not allow us to alter the types of @@ -81,6 +83,34 @@ (drop (local.get $y)) ) + ;; CHECK: (func $get_{} (result (ref null ${})) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; NOMNL: (func $get_{} (type $none_=>_ref?|${}|) (result (ref null ${})) + ;; NOMNL-NEXT: (unreachable) + ;; NOMNL-NEXT: ) + (func $get_{} (result (ref null ${})) + (unreachable) + ) + ;; CHECK: (func $get_{i32} (result (ref null ${i32})) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; NOMNL: (func $get_{i32} (type $none_=>_ref?|${i32}|) (result (ref null ${i32})) + ;; NOMNL-NEXT: (unreachable) + ;; NOMNL-NEXT: ) + (func $get_{i32} (result (ref null ${i32})) + (unreachable) + ) + ;; CHECK: (func $get_{f64} (result (ref null ${f64})) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; NOMNL: (func $get_{f64} (type $none_=>_ref?|${f64}|) (result (ref null ${f64})) + ;; NOMNL-NEXT: (unreachable) + ;; NOMNL-NEXT: ) + (func $get_{f64} (result (ref null ${f64})) + (unreachable) + ) + ;; CHECK: (func $call-various-params-yes ;; CHECK-NEXT: (call $various-params-yes ;; CHECK-NEXT: (call $get_null_{i32}) |