diff options
author | Alon Zakai <azakai@google.com> | 2021-07-12 17:15:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 17:15:50 -0700 |
commit | 58ce30422a24f44dcac6f5d1b6950d900582f0f2 (patch) | |
tree | b3f75d30ada94bed39a2f73d80665df4502551cb /test | |
parent | e8137784824bb2578b8ecbe2f76e09e20a1e5442 (diff) | |
download | binaryen-58ce30422a24f44dcac6f5d1b6950d900582f0f2.tar.gz binaryen-58ce30422a24f44dcac6f5d1b6950d900582f0f2.tar.bz2 binaryen-58ce30422a24f44dcac6f5d1b6950d900582f0f2.zip |
Improve NameTypes to keep reasonable names (#3977)
We only set a name now if there was no name, or the existing name
was really really long.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/name-types.wast | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/lit/passes/name-types.wast b/test/lit/passes/name-types.wast index 03b775f20..197a55226 100644 --- a/test/lit/passes/name-types.wast +++ b/test/lit/passes/name-types.wast @@ -1,12 +1,24 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. ;; RUN: wasm-opt %s -all --name-types -S -o - | filecheck %s (module + ;; An obnoxious name that will be renamed. (type $obnoxious-super-long-type-name_____________________________1 (struct)) - ;; CHECK: (func $foo (param $x (ref $type$1)) + + ;; A reasonable name that will be kept. + ;; CHECK: (type $type$0 (func (param (ref $type$1) (ref $reasonable-name)))) + + ;; CHECK: (type $type$1 (struct )) + + ;; CHECK: (type $reasonable-name (struct (field i32))) + (type $reasonable-name (struct (field i32))) + + ;; CHECK: (func $foo (param $x (ref $type$1)) (param $y (ref $reasonable-name)) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $foo + ;; Use the types to keep them alive. (param $x (ref $obnoxious-super-long-type-name_____________________________1)) + (param $y (ref $reasonable-name)) ) ) |