diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-14 10:50:22 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-14 10:50:22 -0800 |
commit | 6c2ee0edcff41748ac4bd771a3fdc7be03b1e084 (patch) | |
tree | eea2fc878bb3e14868492430c00816c7e53b7dff | |
parent | d7db26f9d1973d42dc8415f228c521ff90010b8e (diff) |
return to a.out.js as default output in emcc
-rwxr-xr-x | emcc | 14 | ||||
-rw-r--r-- | tests/runner.py | 9 |
2 files changed, 7 insertions, 16 deletions
@@ -136,19 +136,13 @@ Options that are modified or new in %s include: The target file, if specified (-o <target>), defines what will be generated: - <name>.js JavaScript + <name>.js JavaScript (default) <name>.html HTML with embedded JavaScript - <name>.bc LLVM bitcode (default) + <name>.bc LLVM bitcode <name>.o LLVM bitcode -If -o <target> is *not* specified, the default is to generate -bitcode. In other words, to generate JavaScript or HTML, you must -specify so explicitly. The reason for this is that otherwise -many build systems would create a lot of JavaScript in -intermediary stages in a wasteful and inefficient manner. - The -c option (which tells gcc not to run the linker) will -also cause LLVM bitcode to be generated, as %s only generates +cause LLVM bitcode to be generated, as %s only generates JavaScript in the final linking stage of building. ''' % (this, this, this) @@ -328,7 +322,7 @@ if use_compiler: newargs += CC_ADDITIONAL_ARGS specified_target = target - target = specified_target if specified_target is not None else 'a.out.bc' # specified_target is the user-specified one, target is what we will generate + target = specified_target if specified_target is not None else 'a.out.js' # specified_target is the user-specified one, target is what we will generate target_basename = unsuffixed_basename(target) diff --git a/tests/runner.py b/tests/runner.py index d3a365c1..abb4660a 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -4899,15 +4899,12 @@ Options that are modified or new in %s include: -O0 No optimizations (default) ''' % (shortcompiler, shortcompiler), output[0], output[1]) - # emcc src.cpp ==> writes a.out.bc. we do not generate JS unless explicitly told to + # emcc src.cpp ==> writes a.out.js clear() output = Popen([compiler, path_from_root('tests', 'hello_world' + suffix)], stdout=PIPE, stderr=PIPE).communicate() assert len(output[0]) == 0, output[0] - assert os.path.exists('hello_world.bc'), output[1] - self.assertContained('hello, world!', self.run_llvm_interpreter(['hello_world.bc'])) - output = Popen([compiler, 'hello_world.bc', '-o', 'out.js'], stdout=PIPE, stderr=PIPE).communicate() # compile .bc to .js - assert os.path.exists('out.js'), '\n'.join(output) - self.assertContained('hello, world!', run_js('out.js')) + assert os.path.exists('a.out.js'), '\n'.join(output) + self.assertContained('hello, world!', run_js('a.out.js')) # 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']]: |