summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-08 09:58:17 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-08 09:58:17 -0800
commit3c0cf0b29b8cb468469844e7d1bb38e311b6692d (patch)
tree90157555d20d066044e5b39cff4006843e5b559d
parentf4958962bce2035f9de1ca409672607e68e4b5a3 (diff)
downloadbinaryen-3c0cf0b29b8cb468469844e7d1bb38e311b6692d.tar.gz
binaryen-3c0cf0b29b8cb468469844e7d1bb38e311b6692d.tar.bz2
binaryen-3c0cf0b29b8cb468469844e7d1bb38e311b6692d.zip
simplify print output in passes tests
-rwxr-xr-xauto_update_tests.py2
-rwxr-xr-xcheck.py2
-rw-r--r--test/passes/lower-if-else.txt21
-rw-r--r--test/passes/merge-blocks.txt85
-rw-r--r--test/passes/remove-imports.txt11
-rw-r--r--test/passes/remove-unused-brs.txt160
-rw-r--r--test/passes/remove-unused-names.txt8
7 files changed, 2 insertions, 287 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 6909dede5..597bb5901 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -63,7 +63,7 @@ for t in sorted(os.listdir(os.path.join('test', 'passes'))):
if t.endswith('.wast'):
print '..', t
passname = os.path.basename(t).replace('.wast', '')
- cmd = [os.path.join('bin', 'binaryen-shell'), '-print-before', '-print-after', '-' + passname, os.path.join('test', 'passes', t)]
+ cmd = [os.path.join('bin', 'binaryen-shell'), '-print-after', '-' + passname, os.path.join('test', 'passes', t)]
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
open(os.path.join('test', 'passes', passname + '.txt'), 'w').write(actual)
diff --git a/check.py b/check.py
index 64a6914ff..b56c6dec1 100755
--- a/check.py
+++ b/check.py
@@ -137,7 +137,7 @@ for t in sorted(os.listdir(os.path.join('test', 'passes'))):
if t.endswith('.wast'):
print '..', t
passname = os.path.basename(t).replace('.wast', '')
- cmd = [os.path.join('bin', 'binaryen-shell'), '-print-before', '-print-after', '-' + passname, os.path.join('test', 'passes', t)]
+ cmd = [os.path.join('bin', 'binaryen-shell'), '-print-after', '-' + passname, os.path.join('test', 'passes', t)]
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
fail_if_not_identical(actual, open(os.path.join('test', 'passes', passname + '.txt')).read())
diff --git a/test/passes/lower-if-else.txt b/test/passes/lower-if-else.txt
index 6e7ce9e66..393a21e68 100644
--- a/test/passes/lower-if-else.txt
+++ b/test/passes/lower-if-else.txt
@@ -6,27 +6,6 @@
(i32.const 0)
(i32.const 1)
)
- (if_else
- (i32.const 0)
- (i32.const 1)
- (i32.const 2)
- )
- (if_else
- (i32.const 4)
- (i32.const 5)
- (i32.const 6)
- )
- )
- )
-)
-(module
- (memory 16777216 16777216)
- (func $ifs
- (block $block0
- (if
- (i32.const 0)
- (i32.const 1)
- )
(block $L0
(if
(i32.const 0)
diff --git a/test/passes/merge-blocks.txt b/test/passes/merge-blocks.txt
index 876fe7b2f..bb8814eee 100644
--- a/test/passes/merge-blocks.txt
+++ b/test/passes/merge-blocks.txt
@@ -83,88 +83,3 @@
)
)
)
-(module
- (memory 16777216 16777216)
- (func $b0-yes (param $i1 i32)
- (block $topmost
- (block $block0
- (i32.const 10)
- )
- )
- )
- (func $b1-yes (param $i1 i32)
- (block $topmost
- (block $block0
- (block $block1
- (i32.const 10)
- )
- )
- )
- )
- (func $b2-yes (param $i1 i32)
- (block $topmost
- (i32.const 5)
- (block $block0
- (i32.const 10)
- )
- (i32.const 15)
- )
- )
- (func $b3-yes (param $i1 i32)
- (block $topmost
- (i32.const 3)
- (block $block0
- (i32.const 6)
- (block $block1
- (i32.const 10)
- )
- (i32.const 15)
- )
- (i32.const 20)
- )
- )
- (func $b4 (param $i1 i32)
- (block $topmost
- (block $inner
- (i32.const 10)
- (br $inner)
- )
- )
- )
- (func $b5 (param $i1 i32)
- (block $topmost
- (block $middle
- (block $inner
- (i32.const 10)
- (br $inner)
- )
- (br $middle)
- )
- )
- )
- (func $b6 (param $i1 i32)
- (block $topmost
- (i32.const 5)
- (block $inner
- (i32.const 10)
- (br $inner)
- )
- (i32.const 15)
- )
- )
- (func $b7 (param $i1 i32)
- (block $topmost
- (i32.const 3)
- (block $middle
- (i32.const 6)
- (block $inner
- (i32.const 10)
- (br $inner)
- )
- (i32.const 15)
- (br $middle)
- )
- (i32.const 20)
- )
- )
-)
diff --git a/test/passes/remove-imports.txt b/test/passes/remove-imports.txt
index 88245a043..964486c92 100644
--- a/test/passes/remove-imports.txt
+++ b/test/passes/remove-imports.txt
@@ -1,16 +1,5 @@
(module
(memory 1024 1024)
- (import $waka "somewhere" "waka")
- (import $waka-ret "somewhere" "waka-ret" (result i32))
- (import $waka-ret-d "somewhere" "waka-ret-d" (result f64))
- (func $nada
- (call_import $waka)
- (call_import $waka-ret)
- (call_import $waka-ret-d)
- )
-)
-(module
- (memory 1024 1024)
(func $nada
(nop)
(i32.const 0)
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt
index 8e03d583e..5f65d04d6 100644
--- a/test/passes/remove-unused-brs.txt
+++ b/test/passes/remove-unused-brs.txt
@@ -2,166 +2,6 @@
(memory 16777216 16777216)
(func $b0-yes (param $i1 i32)
(block $topmost
- (br $topmost)
- )
- )
- (func $b1 (param $i1 i32)
- (block $topmost
- (br $topmost
- (i32.const 0)
- )
- )
- )
- (func $b2 (param $i1 i32)
- (block $topmost
- (block $inner
- (br $topmost)
- )
- )
- )
- (func $b3-yes (param $i1 i32)
- (block $topmost
- (block $inner
- (br $inner)
- )
- )
- )
- (func $b4 (param $i1 i32)
- (block $topmost
- (block $inner
- (br $topmost
- (i32.const 0)
- )
- )
- )
- )
- (func $b5 (param $i1 i32)
- (block $topmost
- (block $inner
- (br $inner
- (i32.const 0)
- )
- )
- )
- )
- (func $b6 (param $i1 i32)
- (block $topmost
- (br_if
- (i32.const 1)
- $topmost
- )
- )
- )
- (func $b7 (param $i1 i32)
- (block $topmost
- (br_if
- (i32.const 1)
- $topmost
- (i32.const 0)
- )
- )
- )
- (func $b8 (param $i1 i32)
- (block $topmost
- (block $inner
- (br_if
- (i32.const 1)
- $topmost
- )
- )
- )
- )
- (func $b9 (param $i1 i32)
- (block $topmost
- (block $inner
- (br_if
- (i32.const 1)
- $inner
- )
- )
- )
- )
- (func $b10 (param $i1 i32)
- (block $topmost
- (block $inner
- (br_if
- (i32.const 1)
- $topmost
- (i32.const 0)
- )
- )
- )
- )
- (func $b11 (param $i1 i32)
- (block $topmost
- (block $inner
- (br_if
- (i32.const 1)
- $inner
- (i32.const 0)
- )
- )
- )
- )
- (func $b12-yes (result i32)
- (block $topmost
- (if_else
- (i32.const 1)
- (block $block0
- (i32.const 12)
- (br $topmost
- (i32.const 1)
- )
- )
- (block $block1
- (i32.const 27)
- (br $topmost
- (i32.const 2)
- )
- )
- )
- )
- )
- (func $b13 (result i32)
- (block $topmost
- (if_else
- (i32.const 1)
- (block $block0
- (i32.const 12)
- (br_if
- (i32.const 1)
- $topmost
- (i32.const 1)
- )
- )
- (block $block1
- (i32.const 27)
- (br $topmost
- (i32.const 2)
- )
- )
- )
- (i32.const 3)
- )
- )
- (func $b14 (result i32)
- (block $topmost
- (if_else
- (i32.const 1)
- (block $block0
- (i32.const 12)
- )
- (block $block1
- (i32.const 27)
- )
- )
- )
- )
-)
-(module
- (memory 16777216 16777216)
- (func $b0-yes (param $i1 i32)
- (block $topmost
)
)
(func $b1 (param $i1 i32)
diff --git a/test/passes/remove-unused-names.txt b/test/passes/remove-unused-names.txt
index f62b3b32f..045a3288c 100644
--- a/test/passes/remove-unused-names.txt
+++ b/test/passes/remove-unused-names.txt
@@ -1,14 +1,6 @@
(module
(memory 16777216 16777216)
(func $b0 (param $i1 i32) (result i32)
- (block $topmost
- (i32.const 0)
- )
- )
-)
-(module
- (memory 16777216 16777216)
- (func $b0 (param $i1 i32) (result i32)
(i32.const 0)
)
)