diff options
author | Thomas Lively <tlively@google.com> | 2024-04-25 14:55:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 14:55:12 -0700 |
commit | 956d2d89d530012885c1f88c87bf8b872c187b70 (patch) | |
tree | a24095ab6965bbfdfd04afbc02c33a3409d51fd0 /test/lld | |
parent | f44dcd4482f5bbb0fb5b567de4a9425ed949c939 (diff) | |
download | binaryen-956d2d89d530012885c1f88c87bf8b872c187b70.tar.gz binaryen-956d2d89d530012885c1f88c87bf8b872c187b70.tar.bz2 binaryen-956d2d89d530012885c1f88c87bf8b872c187b70.zip |
[Parser] Enable the new text parser by default (#6371)
The new text parser is faster and more standards compliant than the old text
parser. Enable it by default in wasm-opt and update the tests to reflect the
slightly different results it produces. Besides following the spec, the new
parser differs from the old parser in that it:
- Does not synthesize `loop` and `try` labels unnecessarily
- Synthesizes different block names in some cases
- Parses exports in a different order
- Parses `nop`s instead of empty blocks for empty control flow arms
- Does not support parsing Poppy IR
- Produces different error messages
- Cannot parse `pop` except as the first instruction inside a `catch`
Diffstat (limited to 'test/lld')
-rw-r--r-- | test/lld/standalone-wasm-with-start.wat | 7 | ||||
-rw-r--r-- | test/lld/standalone-wasm-with-start.wat.out | 4 | ||||
-rw-r--r-- | test/lld/standalone-wasm.wat | 7 | ||||
-rw-r--r-- | test/lld/standalone-wasm.wat.out | 4 | ||||
-rw-r--r-- | test/lld/standalone-wasm2.wat | 3 | ||||
-rw-r--r-- | test/lld/standalone-wasm2.wat.out | 2 | ||||
-rw-r--r-- | test/lld/standalone-wasm3.wat | 3 | ||||
-rw-r--r-- | test/lld/standalone-wasm3.wat.out | 2 |
8 files changed, 16 insertions, 16 deletions
diff --git a/test/lld/standalone-wasm-with-start.wat b/test/lld/standalone-wasm-with-start.wat index 8767c8efb..45ba29c1e 100644 --- a/test/lld/standalone-wasm-with-start.wat +++ b/test/lld/standalone-wasm-with-start.wat @@ -10,8 +10,9 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $_start (result i32) - (nop) + (i32.const 0) + ) + (func $foo (result i32) + (i32.const 0) ) - (func $foo (result i32)) ) - diff --git a/test/lld/standalone-wasm-with-start.wat.out b/test/lld/standalone-wasm-with-start.wat.out index 01a351a7f..472940690 100644 --- a/test/lld/standalone-wasm-with-start.wat.out +++ b/test/lld/standalone-wasm-with-start.wat.out @@ -11,9 +11,9 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $_start (result i32) - (nop) + (i32.const 0) ) (func $foo (result i32) - (nop) + (i32.const 0) ) ) diff --git a/test/lld/standalone-wasm.wat b/test/lld/standalone-wasm.wat index 2ccbf3f29..16c4fffd0 100644 --- a/test/lld/standalone-wasm.wat +++ b/test/lld/standalone-wasm.wat @@ -10,11 +10,12 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $__original_main (result i32) - (nop) + (i32.const 0) ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) - (func $foo (result i32)) + (func $foo (result i32) + (i32.const 0) + ) ) - diff --git a/test/lld/standalone-wasm.wat.out b/test/lld/standalone-wasm.wat.out index f5c18bc6a..867f2ad13 100644 --- a/test/lld/standalone-wasm.wat.out +++ b/test/lld/standalone-wasm.wat.out @@ -12,12 +12,12 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $__original_main (result i32) - (nop) + (i32.const 0) ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main) ) (func $foo (result i32) - (nop) + (i32.const 0) ) ) diff --git a/test/lld/standalone-wasm2.wat b/test/lld/standalone-wasm2.wat index f4c7843b6..b0abafcc2 100644 --- a/test/lld/standalone-wasm2.wat +++ b/test/lld/standalone-wasm2.wat @@ -8,10 +8,9 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $__original_main (param $0 i32) (param $1 i32) (result i32) - (nop) + (i32.const 0) ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main (local.get $0) (local.get $1)) ) ) - diff --git a/test/lld/standalone-wasm2.wat.out b/test/lld/standalone-wasm2.wat.out index 4b98b8500..1cc867e6c 100644 --- a/test/lld/standalone-wasm2.wat.out +++ b/test/lld/standalone-wasm2.wat.out @@ -9,7 +9,7 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $__original_main (param $0 i32) (param $1 i32) (result i32) - (nop) + (i32.const 0) ) (func $main (param $0 i32) (param $1 i32) (result i32) (call $__original_main diff --git a/test/lld/standalone-wasm3.wat b/test/lld/standalone-wasm3.wat index 45c0bed35..0e276d601 100644 --- a/test/lld/standalone-wasm3.wat +++ b/test/lld/standalone-wasm3.wat @@ -7,7 +7,6 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $__original_main (param $0 i32) (param $1 i32) (result i32) - (nop) + (i32.const 0) ) ) - diff --git a/test/lld/standalone-wasm3.wat.out b/test/lld/standalone-wasm3.wat.out index df88bf543..b93736881 100644 --- a/test/lld/standalone-wasm3.wat.out +++ b/test/lld/standalone-wasm3.wat.out @@ -8,6 +8,6 @@ (export "__heap_base" (global $global$1)) (export "__data_end" (global $global$2)) (func $__original_main (param $0 i32) (param $1 i32) (result i32) - (nop) + (i32.const 0) ) ) |