diff options
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'] + |