diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-02 15:31:49 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-02 15:31:49 -0800 |
commit | 364948c9a25be1896bdbdf02b9d708bd7972436c (patch) | |
tree | ed2a6c31c33b7913caff6301c8d9bfa95c3b6f63 | |
parent | aebbf2a99402eecf7a53786ec355c59b52090beb (diff) |
accept empty bitcode files as valid bitcode files
-rwxr-xr-x | tests/runner.py | 1 | ||||
-rw-r--r-- | tools/shared.py | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py index 4c936ed2..4a1443e1 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -5703,7 +5703,6 @@ f.close() def test_reminder(self): assert False, 'Optimize makeGet/SetValue to do 16-bit reads/writes when possible, not just 8' assert False, 'Ensure all opts including linktime apply to bindings generator. might need to adjust visibility of bindings C funcs' - assert False, 'Optimize double version of fasta benchmark' elif 'benchmark' in str(sys.argv): # Benchmarks. Run them with argument |benchmark|. To run a specific test, do diff --git a/tools/shared.py b/tools/shared.py index 2304d817..aedf054b 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -701,9 +701,14 @@ class Building: # if the file doesn't exist or doesn't have valid symbols, it isn't bitcode try: defs = Building.llvm_nm(filename, stderr=PIPE) - assert len(defs.defs) + len(defs.undefs) + len(defs.commons) > 0 + # If no symbols found, it might just be an empty bitcode file, try to dis it + if len(defs.defs) + len(defs.undefs) + len(defs.commons) == 0: + test_ll = os.path.join(EMSCRIPTEN_TEMP_DIR, 'test.ll') + Building.llvm_dis(filename, test_ll) + assert os.path.exists(test_ll) except: return False + # look for magic signature b = open(filename, 'r').read(4) if b[0] == 'B' and b[1] == 'C': |