diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-18 13:59:49 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-18 13:59:49 -0800 |
commit | e36ed341d217b86cdee5c483ce65e9a1208e794c (patch) | |
tree | aace522b34ba1e76cf0c67d0f8311400a2218791 | |
parent | e7c773654dcf02af4ac8d80f9ea29683b911b668 (diff) |
add test for dead code elimination, on libcxx
-rw-r--r-- | tests/runner.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 3cd0e2b9..20a3ea29 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -6019,6 +6019,7 @@ elif 'sanity' in str(sys.argv): # Building a file that *does* need dlmalloc *should* trigger cache generation, but only the first time for filename, libname, otherlibname in [('hello_malloc.cpp', 'dlmalloc', 'libcxx'), ('hello_libcxx.cpp', 'libcxx', 'dlmalloc')]: for i in range(3): + try_delete(os.path.join(EMSCRIPTEN_TEMP_DIR, 'emcc-0-bc.bc')) # we might need to check this file later output = self.do([EMCC, path_from_root('tests', filename)]) assert INCLUDING_MESSAGE.replace('X', libname) in output assert INCLUDING_MESSAGE.replace('X', otherlibname) not in output @@ -6026,6 +6027,9 @@ elif 'sanity' in str(sys.argv): self.assertContained('hello, world!', run_js('a.out.js')) assert os.path.exists(EMCC_CACHE) assert os.path.exists(os.path.join(EMCC_CACHE, libname + '.bc')) + if libname == 'libcxx': + assert os.stat(os.path.join(EMCC_CACHE, libname + '.bc')).st_size > 4000000, 'libc++ is big' + assert os.stat(os.path.join(EMSCRIPTEN_TEMP_DIR, 'emcc-0-bc.bc')).st_size < 2000000, 'Dead code elimination must remove most of libc++' finally: if emcc_debug: os.environ['EMCC_DEBUG'] = emcc_debug |