diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-04 18:14:18 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-04 18:14:18 -0800 |
commit | 91cebac30bd969b32484044ad65f3064d4375047 (patch) | |
tree | 2b5540c2c81d154be0ca82a5fa8d35958dee142b | |
parent | 20d84c111a3c80f3348c0c7c9e8a01fc59e3bcfc (diff) |
fix bug with not creating proper bitcode output with proper file name when emcc is given -o js
-rwxr-xr-x | emcc | 5 | ||||
-rw-r--r-- | tests/runner.py | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -360,7 +360,10 @@ try: assert has_source_inputs, 'Must have source code inputs to use -c' target = target_basename + '.o' - final_suffix = target.split('.')[-1] + if '.' in target: + final_suffix = target.split('.')[-1] + else: + final_suffix = '' # Apply optimization level settings shared.Settings.apply_opt_level(opt_level, noisy=True) diff --git a/tests/runner.py b/tests/runner.py index 45077ca0..52d619eb 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -5149,7 +5149,8 @@ Options that are modified or new in %s include: assert output[1].split('2 errors generated.')[1].replace('\n', '') == 'emcc: compiler frontend failed to generate LLVM bitcode, halting' # emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file - for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc']]: + # regression check: -o js should create "js", with bitcode content + for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc'], ['-o', 'js']]: target = args[1] if len(args) == 2 else 'hello_world.o' clear() output = Popen([compiler, path_from_root('tests', 'hello_world' + suffix)] + args, stdout=PIPE, stderr=PIPE).communicate() |