diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-27 11:40:14 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-27 12:47:33 -0800 |
commit | d57fad6e2f987a4f8991865cdfc43456c0257e4b (patch) | |
tree | 502b0cb683ee3ef6dc9f1233940d4dc565c868fd /tests/test_other.py | |
parent | 8dfb363acf5cbb9cf835b49f742d633283423808 (diff) |
support -Os and -Oz as arguments to emcc
Diffstat (limited to 'tests/test_other.py')
-rw-r--r-- | tests/test_other.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index f5a4ebc9..81e8f05c 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2428,3 +2428,20 @@ int main(int argc, char **argv) { assert ('_ZN5WasteILi2EED1Ev' in src) == exit, 'destructors should not appear if no exit' assert ('atexit(' in src) == exit, 'atexit should not appear or be called' + def test_os_oz(self): + if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode') + try: + os.environ['EMCC_DEBUG'] = '1' + for args, expect in [ + (['-O1'], 'LLVM opts: -O1'), + (['-O2'], 'LLVM opts: -O3'), + (['-Os'], 'LLVM opts: -Os'), + (['-Oz'], 'LLVM opts: -Oz'), + (['-O3'], 'LLVM opts: -O3'), + ]: + print args, expect + output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp')] + args, stdout=PIPE, stderr=PIPE).communicate() + self.assertContained(expect, err) + finally: + del os.environ['EMCC_DEBUG'] + |