diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/inlining-optimizing_optimize-level=3.wast | 32 | ||||
-rw-r--r-- | test/lit/passes/optimize-instructions-atomics.wast | 10 | ||||
-rw-r--r-- | test/lit/passes/optimize-instructions-default.wast (renamed from test/lit/passes/optimize-instructions-sign-ext.wast) | 2 | ||||
-rw-r--r-- | test/lit/passes/optimize-instructions-mvp.wast (renamed from test/lit/passes/optimize-instructions.wast) | 2 | ||||
-rw-r--r-- | test/passes/dwarf_with_exceptions.bin.txt | 4 | ||||
-rw-r--r-- | test/passes/fuzz_metrics_noprint.bin.txt | 50 | ||||
-rw-r--r-- | test/passes/optimize-instructions_fuzz-exec.txt | 8 | ||||
-rw-r--r-- | test/passes/roundtrip_typenames_features.txt | 2 | ||||
-rw-r--r-- | test/unit/utils.py | 12 |
9 files changed, 48 insertions, 74 deletions
diff --git a/test/lit/passes/inlining-optimizing_optimize-level=3.wast b/test/lit/passes/inlining-optimizing_optimize-level=3.wast index cd9629009..cd51a3121 100644 --- a/test/lit/passes/inlining-optimizing_optimize-level=3.wast +++ b/test/lit/passes/inlining-optimizing_optimize-level=3.wast @@ -4264,12 +4264,8 @@ ;; CHECK-NEXT: (block $switch-case0 ;; CHECK-NEXT: (block $switch-case ;; CHECK-NEXT: (br_table $switch-case0 $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-default $switch-case $switch-default - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 24) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4440,12 +4436,8 @@ ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.tee $9 - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 24) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -32) @@ -4490,12 +4482,8 @@ ;; CHECK-NEXT: (i32.shl ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 24) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) @@ -4694,12 +4682,8 @@ ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.tee $6 ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 24) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/optimize-instructions-atomics.wast b/test/lit/passes/optimize-instructions-atomics.wast index 979afde68..29037186d 100644 --- a/test/lit/passes/optimize-instructions-atomics.wast +++ b/test/lit/passes/optimize-instructions-atomics.wast @@ -7,14 +7,10 @@ ;; CHECK: (func $x ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.atomic.load8_u - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (i32.atomic.load8_u + ;; CHECK-NEXT: (i32.const 100) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/optimize-instructions-sign-ext.wast b/test/lit/passes/optimize-instructions-default.wast index 207703904..ab40b4dd5 100644 --- a/test/lit/passes/optimize-instructions-sign-ext.wast +++ b/test/lit/passes/optimize-instructions-default.wast @@ -1,5 +1,5 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s --optimize-instructions --enable-sign-ext -S -o - | filecheck %s +;; RUN: wasm-opt %s --optimize-instructions -S -o - | filecheck %s (module ;; CHECK: (func $duplicate-elimination (param $x i32) diff --git a/test/lit/passes/optimize-instructions.wast b/test/lit/passes/optimize-instructions-mvp.wast index 06f9f16c0..8a86e259f 100644 --- a/test/lit/passes/optimize-instructions.wast +++ b/test/lit/passes/optimize-instructions-mvp.wast @@ -1,5 +1,5 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. -;; RUN: wasm-opt %s --optimize-instructions -S -o - | filecheck %s +;; RUN: wasm-opt %s --optimize-instructions --mvp-features -S -o - | filecheck %s (module (memory 0) diff --git a/test/passes/dwarf_with_exceptions.bin.txt b/test/passes/dwarf_with_exceptions.bin.txt index 3878ba54e..d207962e9 100644 --- a/test/passes/dwarf_with_exceptions.bin.txt +++ b/test/passes/dwarf_with_exceptions.bin.txt @@ -119,7 +119,7 @@ ;; custom section ".debug_line", size 109 ;; custom section ".debug_str", size 178 ;; custom section "producers", size 134 - ;; features section: exception-handling + ;; features section: mutable-globals, sign-ext, exception-handling ) DWARF debug info ================ @@ -540,5 +540,5 @@ file_names[ 1]: ;; custom section ".debug_line", size 162 ;; custom section ".debug_str", size 178 ;; custom section "producers", size 134 - ;; features section: exception-handling + ;; features section: mutable-globals, sign-ext, exception-handling ) diff --git a/test/passes/fuzz_metrics_noprint.bin.txt b/test/passes/fuzz_metrics_noprint.bin.txt index 2df80ff72..cf94c2f3d 100644 --- a/test/passes/fuzz_metrics_noprint.bin.txt +++ b/test/passes/fuzz_metrics_noprint.bin.txt @@ -1,33 +1,33 @@ total - [exports] : 39 - [funcs] : 50 + [exports] : 15 + [funcs] : 21 [globals] : 7 [imports] : 4 [memories] : 1 [memory-data] : 4 - [table-data] : 17 + [table-data] : 7 [tables] : 1 [tags] : 0 - [total] : 3442 - [vars] : 108 - Binary : 299 - Block : 495 - Break : 110 - Call : 193 - CallIndirect : 29 - Const : 650 - Drop : 48 - GlobalGet : 295 - GlobalSet : 131 - If : 183 - Load : 79 - LocalGet : 199 - LocalSet : 153 - Loop : 71 - Nop : 45 - RefFunc : 17 - Return : 155 - Select : 25 - Store : 29 - Unary : 235 + [total] : 2012 + [vars] : 60 + Binary : 195 + Block : 269 + Break : 80 + Call : 67 + CallIndirect : 14 + Const : 373 + Drop : 12 + GlobalGet : 164 + GlobalSet : 65 + If : 110 + Load : 47 + LocalGet : 176 + LocalSet : 116 + Loop : 39 + Nop : 24 + RefFunc : 7 + Return : 74 + Select : 18 + Store : 26 + Unary : 135 Unreachable : 1 diff --git a/test/passes/optimize-instructions_fuzz-exec.txt b/test/passes/optimize-instructions_fuzz-exec.txt index 53f5b848e..a774744d1 100644 --- a/test/passes/optimize-instructions_fuzz-exec.txt +++ b/test/passes/optimize-instructions_fuzz-exec.txt @@ -262,12 +262,8 @@ (call $log (i32.shr_s (i32.shl - (i32.shr_s - (i32.shl - (local.get $0) - (i32.const 24) - ) - (i32.const 24) + (i32.extend8_s + (local.get $0) ) (i32.const 30) ) diff --git a/test/passes/roundtrip_typenames_features.txt b/test/passes/roundtrip_typenames_features.txt index 852dea7f9..2def3c2c1 100644 --- a/test/passes/roundtrip_typenames_features.txt +++ b/test/passes/roundtrip_typenames_features.txt @@ -5,5 +5,5 @@ (func $0 (param $0 (ref null $NamedStruct)) (nop) ) - ;; features section: reference-types, gc + ;; features section: mutable-globals, sign-ext, reference-types, gc ) diff --git a/test/unit/utils.py b/test/unit/utils.py index b0391afad..6fe2d4fe0 100644 --- a/test/unit/utils.py +++ b/test/unit/utils.py @@ -10,12 +10,11 @@ class BinaryenTestCase(unittest.TestCase): filename) def roundtrip(self, filename, opts=[], debug=True): + opts = ['--mvp-features'] + opts if debug: - opts = opts + ['-g'] + opts.append('-g') path = self.input_path(filename) - p = shared.run_process(shared.WASM_OPT + ['-o', 'a.wasm', path] + - opts) - self.assertEqual(p.returncode, 0) + shared.run_process(shared.WASM_OPT + ['-o', 'a.wasm', path] + opts) with open(path, 'rb') as f: with open('a.wasm', 'rb') as g: self.assertEqual(g.read(), f.read()) @@ -24,15 +23,14 @@ class BinaryenTestCase(unittest.TestCase): path = self.input_path(filename) p = shared.run_process(shared.WASM_OPT + ['--print', '-o', os.devnull, path], - check=False, capture_output=True) - self.assertEqual(p.returncode, 0) + capture_output=True) self.assertEqual(p.stderr, '') return p.stdout def check_features(self, filename, features, opts=[]): path = self.input_path(filename) cmd = shared.WASM_OPT + \ - ['--print-features', '-o', os.devnull, path] + opts + ['--mvp-features', '--print-features', '-o', os.devnull, path] + opts p = shared.run_process(cmd, check=False, capture_output=True) self.assertEqual(p.returncode, 0) self.assertEqual(p.stderr, '') |