Skip to content

Remove use of -Wno-almost-asm #12321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2020
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
15 changes: 7 additions & 8 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,6 @@ def test_inlinejs3(self):
if self.is_wasm():
self.skipTest('wasm requires a proper asm module')

self.emcc_args.append('-Wno-almost-asm')
src = path_from_root('tests', 'core', 'test_inlinejs3.c')
output = shared.unsuffixed(src) + '.out'

Expand Down Expand Up @@ -1971,7 +1970,7 @@ def test_minimal_runtime_memorygrowth(self):
expect_fail = True
self.do_run(src, 'OOM', assert_returncode=NON_ZERO if expect_fail else 0)
# Win with it
self.emcc_args += ['-Wno-almost-asm', '-s', 'ALLOW_MEMORY_GROWTH']
self.emcc_args += ['-s', 'ALLOW_MEMORY_GROWTH']
self.do_run(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')

def test_memorygrowth(self):
Expand All @@ -1989,7 +1988,7 @@ def test_memorygrowth(self):
fail = open('src.js').read()

# Win with it
self.emcc_args += ['-Wno-almost-asm', '-s', 'ALLOW_MEMORY_GROWTH']
self.emcc_args += ['-s', 'ALLOW_MEMORY_GROWTH']
self.do_run(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
win = open('src.js').read()

Expand Down Expand Up @@ -2025,7 +2024,7 @@ def test_memorygrowth_2(self):
fail = open('src.js').read()

# Win with it
self.emcc_args += ['-Wno-almost-asm', '-s', 'ALLOW_MEMORY_GROWTH']
self.emcc_args += ['-s', 'ALLOW_MEMORY_GROWTH']
self.do_run(src, '*pre: hello,4.955*\n*hello,4.955*\n*hello,4.955*')
win = open('src.js').read()

Expand Down Expand Up @@ -2075,7 +2074,7 @@ def test_memorygrowth_3_force_fail_reallocBuffer(self):
if self.has_changed_setting('ALLOW_MEMORY_GROWTH'):
self.skipTest('test needs to modify memory growth')

self.emcc_args += ['-Wno-almost-asm', '-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'TEST_MEMORY_GROWTH_FAILS=1']
self.emcc_args += ['-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'TEST_MEMORY_GROWTH_FAILS=1']
self.do_run_in_out_file_test('tests', 'core', 'test_memorygrowth_3.c')

@parameterized({
Expand All @@ -2086,7 +2085,7 @@ def test_memorygrowth_3_force_fail_reallocBuffer(self):
def test_aborting_new(self, args):
# test that C++ new properly errors if we fail to malloc when growth is
# enabled, with or without growth
self.emcc_args += ['-Wno-almost-asm', '-s', 'MAXIMUM_MEMORY=18MB'] + args
self.emcc_args += ['-s', 'MAXIMUM_MEMORY=18MB'] + args
self.do_run_in_out_file_test('tests', 'core', 'test_aborting_new.cpp')

@no_wasm2js('no WebAssembly.Memory()')
Expand Down Expand Up @@ -4837,7 +4836,7 @@ def test_files(self):
self.emcc_args = [x for x in self.emcc_args if x != '-g'] # ensure we test --closure 1 --memory-init-file 1 (-g would disable closure)
elif '-O3' in self.emcc_args and not self.is_wasm():
print('closure 2')
self.emcc_args += ['--closure', '2', '-Wno-almost-asm'] # Use closure 2 here for some additional coverage
self.emcc_args += ['--closure', '2'] # Use closure 2 here for some additional coverage
return self.skipTest('TODO: currently skipped because CI runs out of memory running Closure in this test!')

self.emcc_args += ['-s', 'FORCE_FILESYSTEM=1', '--pre-js', 'pre.js']
Expand Down Expand Up @@ -6974,7 +6973,7 @@ def test_webidl(self, mode, allow_memory_growth):
# being used as Box2D.* or Ammo.*, and we cannot rely on "Module" being always present (closure may remove it).
self.emcc_args += ['-s', 'EXPORTED_FUNCTIONS=["_malloc","_free"]', '--post-js', 'glue.js']
if allow_memory_growth:
self.emcc_args += ['-s', 'ALLOW_MEMORY_GROWTH', '-Wno-almost-asm']
self.emcc_args += ['-s', 'ALLOW_MEMORY_GROWTH']

def post(filename):
with open(filename, 'a') as f:
Expand Down
16 changes: 0 additions & 16 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -5906,22 +5906,6 @@ def test_no_warn_exported_jslibfunc(self):
'-s', 'EXPORTED_FUNCTIONS=["_main", "_alGetError"]'], stderr=PIPE).stderr
self.assertNotContained('function requested to be exported, but not implemented: "_alGetError"', err)

@no_wasm_backend()
def test_almost_asm_warning(self):
def run(args, expected):
print(args, expected)
err = self.run_process([EMCC, path_from_root('tests', 'hello_world.c'), '-s', 'WASM=0'] + args, stderr=PIPE).stderr
if expected:
self.assertContained('[-Walmost-asm]', err)
else:
self.assertEqual(err, '')

run(['-O1', '-s', 'ALLOW_MEMORY_GROWTH=1'], True), # default
# suppress almost-asm warning manually
run(['-O1', '-s', 'ALLOW_MEMORY_GROWTH=1', '-Wno-almost-asm'], False),
# last warning flag should "win"
run(['-O1', '-s', 'ALLOW_MEMORY_GROWTH=1', '-Wno-almost-asm', '-Walmost-asm'], True)

def test_musl_syscalls(self):
self.run_process([EMCC, path_from_root('tests', 'hello_world.c')])
src = open('a.out.js').read()
Expand Down
1 change: 1 addition & 0 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

# warning about absolute-paths is disabled by default, and not enabled by -Wall
diagnostics.add_warning('absolute-paths', enabled=False, part_of_all=False)
# unused diagnositic flags. TODO(sbc): remove at some point
diagnostics.add_warning('almost-asm')
diagnostics.add_warning('invalid-input')
# Don't show legacy settings warnings by default
Expand Down