@@ -463,8 +463,8 @@ def test_dumpmachine(self):
463
463
'c': [EMCC, '.c'],
464
464
'cxx': [EMXX, '.cpp']})
465
465
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']]:
468
468
print('args:', args)
469
469
target = args[1] if len(args) == 2 else 'hello_world.o'
470
470
self.clear()
@@ -475,9 +475,6 @@ def test_emcc_2(self, compiler, suffix):
475
475
# we also expect to have the '__original_main' wrapper and __main_void alias.
476
476
# TODO(sbc): Should be 4 once https://reviews.llvm.org/D75277 lands
477
477
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'
481
478
self.run_process([compiler, target, '-o', target + '.js'])
482
479
self.assertContained('hello, world!', self.run_js(target + '.js'))
483
480
@@ -4600,9 +4597,8 @@ def test_bad_triple(self):
4600
4597
# native building on CI may not always work well
4601
4598
create_file('minimal.c', 'int main() { return 0; }')
4602
4599
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)
4606
4602
4607
4603
def test_valid_abspath(self):
4608
4604
# Test whether abspath warning appears
@@ -12623,18 +12619,10 @@ def test_no_main_with_PROXY_TO_PTHREAD(self):
12623
12619
self.assertContained('crt1_proxy_main.o: undefined symbol: main', err)
12624
12620
12625
12621
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)
12638
12626
12639
12627
def test_split_dwarf_implicit_compile(self):
12640
12628
# Verify that the dwo file is generated in the current working directory, even when implicitly
0 commit comments