summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-12-09 15:27:25 -0800
committerGitHub <noreply@github.com>2019-12-09 15:27:25 -0800
commit247884e68b30dedeb01457d6c7e50d4bba5e4abc (patch)
tree0f493372db2029e895605a3d9761faa5863db8e0 /test
parent72bacfd46fb0ed4851c22344c3cc632e701ce022 (diff)
downloadbinaryen-247884e68b30dedeb01457d6c7e50d4bba5e4abc.tar.gz
binaryen-247884e68b30dedeb01457d6c7e50d4bba5e4abc.tar.bz2
binaryen-247884e68b30dedeb01457d6c7e50d4bba5e4abc.zip
Add a RoundTrip pass (#2516)
This pass writes and reads the module. This shows the effects of converting to and back from the binary format, and will be useful in testing dwarf debug support (where we'll need to see that writing and reading a module preserves debug info properly).
Diffstat (limited to 'test')
-rw-r--r--test/passes/roundtrip.txt7
-rw-r--r--test/passes/roundtrip.wast11
2 files changed, 18 insertions, 0 deletions
diff --git a/test/passes/roundtrip.txt b/test/passes/roundtrip.txt
new file mode 100644
index 000000000..ca74a299e
--- /dev/null
+++ b/test/passes/roundtrip.txt
@@ -0,0 +1,7 @@
+(module
+ (type $0 (func))
+ (export "foo" (func $0))
+ (func $0 (; 0 ;)
+ (unreachable)
+ )
+)
diff --git a/test/passes/roundtrip.wast b/test/passes/roundtrip.wast
new file mode 100644
index 000000000..f562ba779
--- /dev/null
+++ b/test/passes/roundtrip.wast
@@ -0,0 +1,11 @@
+(module
+ (func "foo"
+ ;; binaryen skips unreachable code while reading the binary format
+ (unreachable)
+ (nop)
+ (nop)
+ (nop)
+ (nop)
+ (nop)
+ )
+)