|
| 1 | +;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. |
| 2 | +;; RUN: wasm-opt %s -S -o - | filecheck %s --check-prefix=NRML |
| 3 | +;; RUN: env BINARYEN_PRINT_FULL=1 wasm-opt %s -S -o - | filecheck %s --check-prefix=FULL |
| 4 | + |
| 5 | +;; |
| 6 | +;; Compare normal text output with debug info to full mode. |
| 7 | +;; |
| 8 | +;; Full mode does not skip repeated debug info in some cases, see below. It also |
| 9 | +;; annotates the type of each node. |
| 10 | +;; |
| 11 | + |
| 12 | +(module |
| 13 | + ;; NRML: (func $a |
| 14 | + ;; NRML-NEXT: ;;@ src.cpp:1:2 |
| 15 | + ;; NRML-NEXT: (block $block |
| 16 | + ;; NRML-NEXT: (drop |
| 17 | + ;; NRML-NEXT: (i32.const 0) |
| 18 | + ;; NRML-NEXT: ) |
| 19 | + ;; NRML-NEXT: ;;@ src.cpp:3:4 |
| 20 | + ;; NRML-NEXT: (drop |
| 21 | + ;; NRML-NEXT: (i32.const 1) |
| 22 | + ;; NRML-NEXT: ) |
| 23 | + ;; NRML-NEXT: ;;@ src.cpp:3:4 |
| 24 | + ;; NRML-NEXT: (drop |
| 25 | + ;; NRML-NEXT: (i32.const 2) |
| 26 | + ;; NRML-NEXT: ) |
| 27 | + ;; NRML-NEXT: ) |
| 28 | + ;; NRML-NEXT: ;;@ src.cpp:1:2 |
| 29 | + ;; NRML-NEXT: ) |
| 30 | + ;; FULL: (func $a |
| 31 | + ;; FULL-NEXT: [none] ;;@ src.cpp:1:2 |
| 32 | + ;; FULL-NEXT: [none](block $block |
| 33 | + ;; FULL-NEXT: [none] ;;@ src.cpp:1:2 |
| 34 | + ;; FULL-NEXT: (drop |
| 35 | + ;; FULL-NEXT: [i32] ;;@ src.cpp:1:2 |
| 36 | + ;; FULL-NEXT: (i32.const 0) |
| 37 | + ;; FULL-NEXT: ) |
| 38 | + ;; FULL-NEXT: [none] ;;@ src.cpp:3:4 |
| 39 | + ;; FULL-NEXT: (drop |
| 40 | + ;; FULL-NEXT: [i32] ;;@ src.cpp:3:4 |
| 41 | + ;; FULL-NEXT: (i32.const 1) |
| 42 | + ;; FULL-NEXT: ) |
| 43 | + ;; FULL-NEXT: [none] ;;@ src.cpp:3:4 |
| 44 | + ;; FULL-NEXT: (drop |
| 45 | + ;; FULL-NEXT: [i32] ;;@ src.cpp:3:4 |
| 46 | + ;; FULL-NEXT: (i32.const 2) |
| 47 | + ;; FULL-NEXT: ) |
| 48 | + ;; FULL-NEXT: ) ;; end block block |
| 49 | + ;; FULL-NEXT: ;;@ src.cpp:1:2 |
| 50 | + ;; FULL-NEXT: ) |
| 51 | + (func $a |
| 52 | + ;;@ src.cpp:1:2 |
| 53 | + (block $block |
| 54 | + (drop (i32.const 0)) ;; this child has the same location as the parent |
| 55 | + ;; block, and only in full mode will we print such |
| 56 | + ;; repeating info, including on the const child of |
| 57 | + ;; the drop |
| 58 | + ;;@ src.cpp:3:4 |
| 59 | + (drop (i32.const 1)) |
| 60 | + (drop (i32.const 2)) ;; this child has the same location as the sibling |
| 61 | + ;; before it, but we print it in normal mode as well |
| 62 | + ;; as full mode (as that seems less confusing). in |
| 63 | + ;; full mode, however, we also annotate the location |
| 64 | + ;; of the const node children of the drops. |
| 65 | + ) |
| 66 | + ) |
| 67 | +) |
0 commit comments