| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. |
| ;; RUN: wasm-opt %s.wasm -S -o - | filecheck %s |
| |
| ;; Test that we emit deduplicated names even in the corner case that one item |
| ;; is in the names section and the other is not, and the latter's temp name |
| ;; coincides with the name the name section gives for the first. Specifically, |
| ;; the input wasm looks like this: |
| ;; |
| ;; (module |
| ;; (global $global$1 i32 (i32.const 1)) ;; In names section. |
| ;; (global $........ i32 (i32.const 0)) ;; *Not* in names section. |
| ;; ) |
| ;; |
| ;; We give them temp names $global$0, $global$1 to begin with, then apply the |
| ;; names section which turns the first's name into $global$1 - identical to the |
| ;; second. We must then deduplicate the second name to avoid a collision. (Note |
| ;; that we leave the name from the names section as it is, and only adjust the |
| ;; temp name.) |
| |
| |
| ;; CHECK: (global $global$1 i32 (i32.const 1)) |
| |
| ;; CHECK: (global $global$1_1 i32 (i32.const 0)) |