@@ -46,7 +46,7 @@ def decorated(self, *args, **kwargs):
46
46
self .require_simd ()
47
47
if self .get_setting ('MEMORY64' ) == 2 :
48
48
self .skipTest ('https://github.com/WebAssembly/binaryen/issues/4638' )
49
- if not self .is_wasm ():
49
+ if self .is_wasm2js ():
50
50
self .skipTest ('wasm2js only supports MVP for now' )
51
51
if '-O3' in self .emcc_args :
52
52
self .skipTest ('SIMD tests are too slow with -O3 in the new LLVM pass manager, https://github.com/emscripten-core/emscripten/issues/13427' )
@@ -62,7 +62,7 @@ def decorated(self):
62
62
if self .get_setting ('MEMORY64' ) == 2 :
63
63
self .skipTest ('https://github.com/WebAssembly/binaryen/issues/4638' )
64
64
# We don't actually run any tests yet, so don't require any engines.
65
- if not self .is_wasm ():
65
+ if self .is_wasm2js ():
66
66
self .skipTest ('wasm2js only supports MVP for now' )
67
67
self .emcc_args .append ('-mrelaxed-simd' )
68
68
f (self )
@@ -71,7 +71,7 @@ def decorated(self):
71
71
72
72
def needs_non_trapping_float_to_int (f ):
73
73
def decorated (self ):
74
- if not self .is_wasm ():
74
+ if self .is_wasm2js ():
75
75
self .skipTest ('wasm2js only supports MVP for now' )
76
76
f (self )
77
77
return decorated
@@ -102,7 +102,7 @@ def with_both_eh_sjlj(f):
102
102
def metafunc (self , is_native ):
103
103
if is_native :
104
104
# Wasm EH is currently supported only in wasm backend and V8
105
- if not self .is_wasm ():
105
+ if self .is_wasm2js ():
106
106
self .skipTest ('wasm2js does not support wasm EH/SjLj' )
107
107
self .require_wasm_eh ()
108
108
# FIXME Temporarily disabled. Enable this later when the bug is fixed.
@@ -902,7 +902,7 @@ def test_longjmp_with_and_without_exceptions(self):
902
902
# Wasm SjLj with and without Wasm EH support
903
903
self .clear_setting ('DISABLE_EXCEPTION_CATCHING' )
904
904
self .set_setting ('SUPPORT_LONGJMP' , 'wasm' )
905
- if not self .is_wasm ():
905
+ if self .is_wasm2js ():
906
906
self .skipTest ('wasm2js does not support wasm EH/SjLj' )
907
907
self .require_wasm_eh ()
908
908
# FIXME Temporarily disabled. Enable this later when the bug is fixed.
@@ -1037,7 +1037,7 @@ def test_exceptions_with_and_without_longjmp(self):
1037
1037
self .do_run_in_out_file_test ('core/test_exceptions.cpp' , out_suffix = '_caught' )
1038
1038
# Wasm EH with and without Wasm SjLj support
1039
1039
self .clear_setting ('DISABLE_EXCEPTION_CATCHING' )
1040
- if not self .is_wasm ():
1040
+ if self .is_wasm2js ():
1041
1041
self .skipTest ('wasm2js does not support wasm EH/SjLj' )
1042
1042
self .require_wasm_eh ()
1043
1043
# FIXME Temporarily disabled. Enable this later when the bug is fixed.
@@ -2028,7 +2028,7 @@ def test_memorygrowth(self):
2028
2028
self .do_runf (src , '*pre: hello,4.955*\n *hello,4.955*\n *hello,4.955*' )
2029
2029
win = read_file ('test_memorygrowth.js' )
2030
2030
2031
- if '-O2' in self .emcc_args and not self .is_wasm ():
2031
+ if '-O2' in self .emcc_args and self .is_wasm2js ():
2032
2032
# Make sure ALLOW_MEMORY_GROWTH generates different code (should be less optimized)
2033
2033
code_start = '// EMSCRIPTEN_START_FUNCS'
2034
2034
self .assertContained (code_start , fail )
@@ -2061,7 +2061,7 @@ def test_memorygrowth_2(self):
2061
2061
self .do_runf (src , '*pre: hello,4.955*\n *hello,4.955*\n *hello,4.955*' )
2062
2062
win = read_file ('test_memorygrowth_2.js' )
2063
2063
2064
- if '-O2' in self .emcc_args and not self .is_wasm ():
2064
+ if '-O2' in self .emcc_args and self .is_wasm2js ():
2065
2065
# Make sure ALLOW_MEMORY_GROWTH generates different code (should be less optimized)
2066
2066
assert len (fail ) < len (win ), 'failing code - without memory growth on - is more optimized, and smaller' + str ([len (fail ), len (win )])
2067
2067
@@ -2080,7 +2080,7 @@ def test_memorygrowth_3(self):
2080
2080
def test_memorygrowth_MAXIMUM_MEMORY (self ):
2081
2081
if self .has_changed_setting ('ALLOW_MEMORY_GROWTH' ):
2082
2082
self .skipTest ('test needs to modify memory growth' )
2083
- if not self .is_wasm ():
2083
+ if self .is_wasm2js ():
2084
2084
self .skipTest ('wasm memory specific test' )
2085
2085
2086
2086
# check that memory growth does not exceed the wasm mem max limit
@@ -2092,7 +2092,7 @@ def test_memorygrowth_MAXIMUM_MEMORY(self):
2092
2092
def test_memorygrowth_linear_step (self ):
2093
2093
if self .has_changed_setting ('ALLOW_MEMORY_GROWTH' ):
2094
2094
self .skipTest ('test needs to modify memory growth' )
2095
- if not self .is_wasm ():
2095
+ if self .is_wasm2js ():
2096
2096
self .skipTest ('wasm memory specific test' )
2097
2097
2098
2098
# check that memory growth does not exceed the wasm mem max limit and is exactly or one step below the wasm mem max
@@ -2105,7 +2105,7 @@ def test_memorygrowth_linear_step(self):
2105
2105
def test_memorygrowth_geometric_step (self ):
2106
2106
if self .has_changed_setting ('ALLOW_MEMORY_GROWTH' ):
2107
2107
self .skipTest ('test needs to modify memory growth' )
2108
- if not self .is_wasm ():
2108
+ if self .is_wasm2js ():
2109
2109
self .skipTest ('wasm memory specific test' )
2110
2110
2111
2111
self .emcc_args += ['-sALLOW_MEMORY_GROWTH' , '-sMEMORY_GROWTH_GEOMETRIC_STEP=8.5' , '-sMEMORY_GROWTH_GEOMETRIC_CAP=32MB' ]
@@ -4030,8 +4030,6 @@ def test_dylink_no_export(self):
4030
4030
4031
4031
@needs_dylink
4032
4032
def test_dylink_memory_growth (self ):
4033
- if not self .is_wasm ():
4034
- self .skipTest ('wasm only' )
4035
4033
self .set_setting ('ALLOW_MEMORY_GROWTH' )
4036
4034
self .do_basic_dylink_test ()
4037
4035
@@ -4884,7 +4882,7 @@ def test_dylink_hyper_dupe(self):
4884
4882
''' ,
4885
4883
expected = ['sidef: 10, sideg: 20.\n bsidef: 536.\n only_in_second_0: 10, 20, 1337\n only_in_third_1: 36, 49, 500, 1221\n only_in_third_0: 36, 49, 500\n only_in_second_1: 10, 20, 1337, 2112\n ' ],
4886
4884
# in wasm, we can't flip as the side would have an EM_ASM, which we don't support yet TODO
4887
- need_reverse = not self .is_wasm ())
4885
+ need_reverse = self .is_wasm2js ())
4888
4886
4889
4887
print ('check warnings' )
4890
4888
full = self .run_js ('src.js' )
@@ -4927,7 +4925,7 @@ def test_dylink_load_compiled_side_module(self):
4927
4925
''' ,
4928
4926
expected = ['sidef: 10' ],
4929
4927
# in wasm, we can't flip as the side would have an EM_ASM, which we don't support yet TODO
4930
- need_reverse = not self .is_wasm ())
4928
+ need_reverse = self .is_wasm2js ())
4931
4929
4932
4930
@needs_dylink
4933
4931
def test_dylink_dso_needed (self ):
@@ -5363,7 +5361,7 @@ def test_langinfo(self):
5363
5361
5364
5362
def test_files (self ):
5365
5363
# Use closure here, to test we don't break FS stuff
5366
- if '-O3' in self .emcc_args and not self .is_wasm ():
5364
+ if '-O3' in self .emcc_args and self .is_wasm2js ():
5367
5365
print ('closure 2' )
5368
5366
self .emcc_args += ['--closure' , '2' ] # Use closure 2 here for some additional coverage
5369
5367
# Sadly --closure=2 is not yet free of closure warnings
@@ -6204,7 +6202,7 @@ def test_iostream_and_determinism(self):
6204
6202
shutil .copy2 ('src.js' , 'src.js.previous' )
6205
6203
6206
6204
# Same but for the wasm file.
6207
- if self .is_wasm () and not self . get_setting ( 'WASM2JS' ) :
6205
+ if self .is_wasm ():
6208
6206
if os .path .exists ('src.wasm.previous' ):
6209
6207
self .assertBinaryEqual ('src.wasm' , 'src.wasm.previous' )
6210
6208
shutil .copy2 ('src.wasm' , 'src.wasm.previous' )
@@ -7730,7 +7728,7 @@ def test_source_map(self, args):
7730
7728
self .emcc (os .path .abspath ('src.cpp' ),
7731
7729
self .get_emcc_args (),
7732
7730
out_filename )
7733
- map_referent = out_filename if not self .is_wasm () else wasm_filename
7731
+ map_referent = out_filename if self .is_wasm2js () else wasm_filename
7734
7732
# after removing the @line and @sourceMappingURL comments, the build
7735
7733
# result should be identical to the non-source-mapped debug version.
7736
7734
# this is worth checking because the parser AST swaps strings for token
@@ -7908,7 +7906,7 @@ def test_modularize_closure_pre(self):
7908
7906
# test that the combination of modularize + closure + pre-js works. in that mode,
7909
7907
# closure should not minify the Module object in a way that the pre-js cannot use it.
7910
7908
create_file ('post.js' , 'var TheModule = Module();\n ' )
7911
- if not self .is_wasm ():
7909
+ if self .is_wasm2js ():
7912
7910
# TODO(sbc): Fix closure warnings with MODULARIZE + WASM=0
7913
7911
self .ldflags .append ('-Wno-error=closure' )
7914
7912
@@ -8396,7 +8394,7 @@ def verify_broken(args):
8396
8394
@no_sanitize ('no wasm2js support yet in sanitizers' )
8397
8395
@requires_wasm2js
8398
8396
def test_wasm2js (self ):
8399
- if not self .is_wasm ():
8397
+ if self .is_wasm2js ():
8400
8398
self .skipTest ('redundant to test wasm2js in wasm2js* mode' )
8401
8399
self .set_setting ('WASM' , 0 )
8402
8400
self .do_core_test ('test_hello_world.c' )
@@ -8412,7 +8410,7 @@ def test_wasm2js(self):
8412
8410
@no_sanitize ('no wasm2js support yet in sanitizers' )
8413
8411
@requires_wasm2js
8414
8412
def test_maybe_wasm2js (self ):
8415
- if not self .is_wasm ():
8413
+ if self .is_wasm2js ():
8416
8414
self .skipTest ('redundant to test wasm2js in wasm2js* mode' )
8417
8415
self .set_setting ('MAYBE_WASM2JS' )
8418
8416
# see that running as wasm works
@@ -8434,7 +8432,7 @@ def test_maybe_wasm2js(self):
8434
8432
'minimal_runtime' : (['-sMINIMAL_RUNTIME' ],),
8435
8433
})
8436
8434
def test_wasm2js_fallback (self , args ):
8437
- if not self .is_wasm ():
8435
+ if self .is_wasm2js ():
8438
8436
self .skipTest ('redundant to test wasm2js in wasm2js* mode' )
8439
8437
8440
8438
cmd = [EMCC , test_file ('small_hello_world.c' ), '-sWASM=2' ] + args
@@ -8736,7 +8734,7 @@ def test_return_address(self):
8736
8734
@no_lsan ('-fsanitize-minimal-runtime cannot be used with LSan' )
8737
8735
def test_ubsan_minimal_too_many_errors (self ):
8738
8736
self .emcc_args += ['-fsanitize=undefined' , '-fsanitize-minimal-runtime' ]
8739
- if not self .is_wasm ():
8737
+ if self .is_wasm2js ():
8740
8738
if self .is_optimizing ():
8741
8739
self .skipTest ('test can only be run without optimizations on asm.js' )
8742
8740
# Need to use `-g` to get proper line numbers in asm.js
@@ -8750,10 +8748,10 @@ def test_ubsan_minimal_too_many_errors(self):
8750
8748
@no_lsan ('-fsanitize-minimal-runtime cannot be used with LSan' )
8751
8749
def test_ubsan_minimal_errors_same_place (self ):
8752
8750
self .emcc_args += ['-fsanitize=undefined' , '-fsanitize-minimal-runtime' ]
8753
- if not self .is_wasm ():
8751
+ if self .is_wasm2js ():
8754
8752
if self .is_optimizing ():
8755
- self .skipTest ('test can only be run without optimizations on asm.js ' )
8756
- # Need to use `-g` to get proper line numbers in asm.js
8753
+ self .skipTest ('test can only be run without optimizations under wasm2js ' )
8754
+ # Need to use `-g` to get proper line numbers in wasm2js
8757
8755
self .emcc_args += ['-g' ]
8758
8756
self .do_runf ('core/test_ubsan_minimal_errors_same_place.c' ,
8759
8757
expected_output = 'ubsan: add-overflow by 0x[0-9a-z]*\n ' * 5 ,
@@ -8851,7 +8849,7 @@ def test_ubsan_full_static_cast(self, args):
8851
8849
@no_wasm2js ('TODO: sanitizers in wasm2js' )
8852
8850
def test_ubsan_full_stack_trace (self , g_flag , expected_output ):
8853
8851
if g_flag == '-gsource-map' :
8854
- if not self .is_wasm ():
8852
+ if self .is_wasm2js ():
8855
8853
self .skipTest ('wasm2js has no source map support' )
8856
8854
elif self .get_setting ('EVAL_CTORS' ):
8857
8855
self .skipTest ('EVAL_CTORS does not support source maps' )
@@ -8963,7 +8961,7 @@ def test_asan(self, name, expected_output, cflags=None):
8963
8961
if '-Oz' in self .emcc_args :
8964
8962
self .skipTest ('-Oz breaks source maps' )
8965
8963
8966
- if not self .is_wasm ():
8964
+ if self .is_wasm2js ():
8967
8965
self .skipTest ('wasm2js has no ASan support' )
8968
8966
8969
8967
self .emcc_args .append ('-fsanitize=address' )
0 commit comments