Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ def get_clang_command_asm():
return compiler + compile.get_target_flags()

if state.mode == Mode.COMPILE_ONLY:
if options.output_file and get_file_suffix(options.output_file) == '.bc' and not options.lto and '-emit-llvm' not in state.orig_args:
diagnostics.warning('emcc', '.bc output file suffix used without -flto or -emit-llvm. Consider using .o extension since emcc will output an object file, not a bitcode file')
if all(get_file_suffix(i) in ASSEMBLY_EXTENSIONS for i in options.input_files):
cmd = get_clang_command_asm() + newargs
else:
Expand Down
10 changes: 7 additions & 3 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,16 @@ def test_emcc_2(self, compiler, suffix):
self.run_process([compiler, target, '-o', target + '.js'])
self.assertContained('Hello, world!', self.run_js(target + '.js'))

def test_bc_output_warning(self):
err = self.run_process([EMCC, '-c', test_file('hello_world.c'), '-o', 'out.bc'], stderr=PIPE).stderr
self.assertContained('emcc: warning: .bc output file suffix used without -flto or -emit-llvm', err)
def test_bc_output_suffix(self):
# Emscripten doe not use the output name when compiling to decide on the type
# of output. For example, specifying an output filename that ends in `.bc` does
# *not* imply the output is actually bitcode.
self.run_process([EMCC, '-c', test_file('hello_world.c'), '-o', 'out.bc'])
self.assertTrue(building.is_wasm('out.bc'))

def test_bc_as_archive(self):
self.run_process([EMCC, '-c', test_file('hello_world.c'), '-flto', '-o', 'out.a'])
self.assertTrue(is_bitcode('out.a'))
self.run_process([EMCC, 'out.a'])

@parameterized({
Expand Down
Loading