diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/simplify-globals-gc.wast | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lit/passes/simplify-globals-gc.wast b/test/lit/passes/simplify-globals-gc.wast index 76ce984e7..97063a1a1 100644 --- a/test/lit/passes/simplify-globals-gc.wast +++ b/test/lit/passes/simplify-globals-gc.wast @@ -31,3 +31,27 @@ ) ) +(module + ;; CHECK: (type $struct (struct )) + (type $struct (struct )) + + ;; CHECK: (type $1 (func (result anyref))) + + ;; CHECK: (global $a (ref $struct) (struct.new_default $struct)) + (global $a (ref $struct) (struct.new_default $struct)) + ;; CHECK: (global $b (ref $struct) (global.get $a)) + (global $b (ref $struct) (global.get $a)) + ;; CHECK: (global $c (ref null $struct) (global.get $a)) + (global $c (ref null $struct) (global.get $a)) + + ;; CHECK: (func $get-c (type $1) (result anyref) + ;; CHECK-NEXT: (global.get $c) + ;; CHECK-NEXT: ) + (func $get-c (result anyref) + ;; $c has a less-refined type than the other two. We do not switch this to + ;; get from either $a or $b because of that, but we could if we also + ;; refinalized TODO + (global.get $c) + ) +) + |