summaryrefslogtreecommitdiff
path: root/test/unit/test_dwarf.py
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-01-28 10:45:48 -0800
committerGitHub <noreply@github.com>2020-01-28 10:45:48 -0800
commit9384ff68eea8090578354bab35fce2e621a588c4 (patch)
tree3ba04c14502f6fdbe552ba283cfa0287728f77cb /test/unit/test_dwarf.py
parentb00f7f9b97631b214eff177b92639df6307db286 (diff)
downloadbinaryen-9384ff68eea8090578354bab35fce2e621a588c4.tar.gz
binaryen-9384ff68eea8090578354bab35fce2e621a588c4.tar.bz2
binaryen-9384ff68eea8090578354bab35fce2e621a588c4.zip
DWARF: Fix debug_abbrev section (#2630)
Each compilation unit's abbreviations must be terminated by a zero, so that we use the right abbreviations. This adds that support to the YAML layer, both adding the zeros and parsing them to look in the right abbreviation section at the right time. Also add two large testcases, zlib and cubescript, which crash without this and the last PR.
Diffstat (limited to 'test/unit/test_dwarf.py')
-rw-r--r--test/unit/test_dwarf.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/test_dwarf.py b/test/unit/test_dwarf.py
new file mode 100644
index 000000000..5078efeeb
--- /dev/null
+++ b/test/unit/test_dwarf.py
@@ -0,0 +1,16 @@
+import os
+
+from scripts.test import shared
+from . import utils
+
+
+class DWARFTest(utils.BinaryenTestCase):
+ def test_no_crash(self):
+ # run dwarf processing on some interesting large files, too big to be
+ # worth putting in passes where the text output would be massive. We
+ # just check that no assertion are hit.
+ path = self.input_path('dwarf')
+ for name in os.listdir(path):
+ args = [os.path.join(path, name)] + \
+ ['-g', '--dwarfdump', '--roundtrip', '--dwarfdump']
+ shared.run_process(shared.WASM_OPT + args, capture_output=True)