diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-03 12:12:22 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-03 12:12:22 -0700 |
commit | 363ce16a8980f08b9c81fea4d51d3356cbad21a9 (patch) | |
tree | 6215772acf371be91fba40826cb5cfb1c161a64c /tests | |
parent | 20cd14971fd5aeb5c731ef0e17b586c5a46b27f9 (diff) |
ignore and warn on -Os
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 37a8d597..02e0428e 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7178,6 +7178,14 @@ f.close() # TODO: test normal project linking, static and dynamic: get_library should not need to be told what to link! # TODO: deprecate llvm optimizations, dlmalloc, etc. in emscripten.py. + def test_Os(self): + for opt in ['s', '0']: + output = Popen(['python', EMCC, path_from_root('tests', 'hello_world.c'), '-O' + opt], stdout=PIPE, stderr=PIPE).communicate() + assert len(output[0]) == 0, output[0] + assert ('emcc: warning: -Os is ignored (use -O0, -O1, -O2)' in output[1]) == (opt == 's'), 'warn on -Os when necessary' + assert os.path.exists('a.out.js'), '\n'.join(output) + self.assertContained('hello, world!', run_js('a.out.js')) + def test_catch_undef(self): open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r''' #include <vector> |