@@ -463,8 +463,8 @@ def test_dumpmachine(self):
463463 'c': [EMCC, '.c'],
464464 'cxx': [EMXX, '.cpp']})
465465 def test_emcc_2(self, compiler, suffix):
466- # emcc src.cpp -c and emcc -c src.cpp -o src.[o|bc |so] ==> should always give an object file
467- for args in [[], ['-o', 'src.o'], ['-o', 'src.bc '], ['-o', 'src.so']]:
466+ # emcc src.cpp -c and emcc -c src.cpp -o src.[o|foo |so] ==> should always give an object file
467+ for args in [[], ['-o', 'src.o'], ['-o', 'src.foo '], ['-o', 'src.so']]:
468468 print('args:', args)
469469 target = args[1] if len(args) == 2 else 'hello_world.o'
470470 self.clear()
@@ -475,9 +475,6 @@ def test_emcc_2(self, compiler, suffix):
475475 # we also expect to have the '__original_main' wrapper and __main_void alias.
476476 # TODO(sbc): Should be 4 once https://reviews.llvm.org/D75277 lands
477477 self.assertIn(len(syms['defs']), (2, 3))
478- if target == 'js': # make sure emcc can recognize the target as a bitcode file
479- shutil.move(target, target + '.bc')
480- target += '.bc'
481478 self.run_process([compiler, target, '-o', target + '.js'])
482479 self.assertContained('hello, world!', self.run_js(target + '.js'))
483480
@@ -4600,9 +4597,8 @@ def test_bad_triple(self):
46004597 # native building on CI may not always work well
46014598 create_file('minimal.c', 'int main() { return 0; }')
46024599 self.run_process([CLANG_CC, 'minimal.c', '-target', 'x86_64-linux', '-c', '-emit-llvm', '-o', 'a.bc'] + clang_native.get_clang_native_args(), env=clang_native.get_clang_native_env())
4603- # wasm backend will hard fail where as fastcomp only warns
4604- err = self.expect_fail([EMCC, 'a.bc'])
4605- self.assertContained('machine type must be wasm32', err)
4600+ err = self.expect_fail([EMCC, '-Werror', 'a.bc'])
4601+ self.assertContained('error: overriding the module target triple with wasm32-unknown-emscripten [-Werror,-Woverride-module]', err)
46064602
46074603 def test_valid_abspath(self):
46084604 # Test whether abspath warning appears
@@ -12623,18 +12619,10 @@ def test_no_main_with_PROXY_TO_PTHREAD(self):
1262312619 self.assertContained('crt1_proxy_main.o: undefined symbol: main', err)
1262412620
1262512621 def test_archive_bad_extension(self):
12626- # Regression test for https://github.com/emscripten-core/emscripten/issues/14012
12627- # where llvm_nm_multiple would be confused by archives names like object files.
12628- create_file('main.c', '''
12629- #include <sys/socket.h>
12630- int main() {
12631- return (int)(long)&accept;
12632- }
12633- ''')
12634-
12635- self.run_process([EMCC, '-c', 'main.c'])
12636- self.run_process([EMAR, 'crs', 'libtest.bc', 'main.o'])
12637- self.run_process([EMCC, 'libtest.bc', 'libtest.bc'])
12622+ self.run_process([EMCC, '-c', test_file('hello_world.c')])
12623+ self.run_process([EMAR, 'crs', 'libtest.bc', 'hello_world.o'])
12624+ err = self.expect_fail([EMCC, 'libtest.bc'])
12625+ self.assertContained('libtest.bc:1:2: error: expected integer', err)
1263812626
1263912627 def test_split_dwarf_implicit_compile(self):
1264012628 # Verify that the dwo file is generated in the current working directory, even when implicitly
0 commit comments