diff --git a/emcc.py b/emcc.py index 9bf2e2d5fda88..aae61e47b1655 100644 --- a/emcc.py +++ b/emcc.py @@ -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: diff --git a/test/test_other.py b/test/test_other.py index 4856563992fe2..0b734792f1c37 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -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({