@@ -46,7 +46,7 @@ def decorated(self, *args, **kwargs):
4646 self .require_simd ()
4747 if self .get_setting ('MEMORY64' ) == 2 :
4848 self .skipTest ('https://github.com/WebAssembly/binaryen/issues/4638' )
49- if not self .is_wasm ():
49+ if self .is_wasm2js ():
5050 self .skipTest ('wasm2js only supports MVP for now' )
5151 if '-O3' in self .emcc_args :
5252 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):
6262 if self .get_setting ('MEMORY64' ) == 2 :
6363 self .skipTest ('https://github.com/WebAssembly/binaryen/issues/4638' )
6464 # 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 ():
6666 self .skipTest ('wasm2js only supports MVP for now' )
6767 self .emcc_args .append ('-mrelaxed-simd' )
6868 f (self )
@@ -71,7 +71,7 @@ def decorated(self):
7171
7272def needs_non_trapping_float_to_int (f ):
7373 def decorated (self ):
74- if not self .is_wasm ():
74+ if self .is_wasm2js ():
7575 self .skipTest ('wasm2js only supports MVP for now' )
7676 f (self )
7777 return decorated
@@ -102,7 +102,7 @@ def with_both_eh_sjlj(f):
102102 def metafunc (self , is_native ):
103103 if is_native :
104104 # Wasm EH is currently supported only in wasm backend and V8
105- if not self .is_wasm ():
105+ if self .is_wasm2js ():
106106 self .skipTest ('wasm2js does not support wasm EH/SjLj' )
107107 self .require_wasm_eh ()
108108 # FIXME Temporarily disabled. Enable this later when the bug is fixed.
@@ -902,7 +902,7 @@ def test_longjmp_with_and_without_exceptions(self):
902902 # Wasm SjLj with and without Wasm EH support
903903 self .clear_setting ('DISABLE_EXCEPTION_CATCHING' )
904904 self .set_setting ('SUPPORT_LONGJMP' , 'wasm' )
905- if not self .is_wasm ():
905+ if self .is_wasm2js ():
906906 self .skipTest ('wasm2js does not support wasm EH/SjLj' )
907907 self .require_wasm_eh ()
908908 # FIXME Temporarily disabled. Enable this later when the bug is fixed.
@@ -1037,7 +1037,7 @@ def test_exceptions_with_and_without_longjmp(self):
10371037 self .do_run_in_out_file_test ('core/test_exceptions.cpp' , out_suffix = '_caught' )
10381038 # Wasm EH with and without Wasm SjLj support
10391039 self .clear_setting ('DISABLE_EXCEPTION_CATCHING' )
1040- if not self .is_wasm ():
1040+ if self .is_wasm2js ():
10411041 self .skipTest ('wasm2js does not support wasm EH/SjLj' )
10421042 self .require_wasm_eh ()
10431043 # FIXME Temporarily disabled. Enable this later when the bug is fixed.
@@ -2028,7 +2028,7 @@ def test_memorygrowth(self):
20282028 self .do_runf (src , '*pre: hello,4.955*\n *hello,4.955*\n *hello,4.955*' )
20292029 win = read_file ('test_memorygrowth.js' )
20302030
2031- if '-O2' in self .emcc_args and not self .is_wasm ():
2031+ if '-O2' in self .emcc_args and self .is_wasm2js ():
20322032 # Make sure ALLOW_MEMORY_GROWTH generates different code (should be less optimized)
20332033 code_start = '// EMSCRIPTEN_START_FUNCS'
20342034 self .assertContained (code_start , fail )
@@ -2061,7 +2061,7 @@ def test_memorygrowth_2(self):
20612061 self .do_runf (src , '*pre: hello,4.955*\n *hello,4.955*\n *hello,4.955*' )
20622062 win = read_file ('test_memorygrowth_2.js' )
20632063
2064- if '-O2' in self .emcc_args and not self .is_wasm ():
2064+ if '-O2' in self .emcc_args and self .is_wasm2js ():
20652065 # Make sure ALLOW_MEMORY_GROWTH generates different code (should be less optimized)
20662066 assert len (fail ) < len (win ), 'failing code - without memory growth on - is more optimized, and smaller' + str ([len (fail ), len (win )])
20672067
@@ -2080,7 +2080,7 @@ def test_memorygrowth_3(self):
20802080 def test_memorygrowth_MAXIMUM_MEMORY (self ):
20812081 if self .has_changed_setting ('ALLOW_MEMORY_GROWTH' ):
20822082 self .skipTest ('test needs to modify memory growth' )
2083- if not self .is_wasm ():
2083+ if self .is_wasm2js ():
20842084 self .skipTest ('wasm memory specific test' )
20852085
20862086 # check that memory growth does not exceed the wasm mem max limit
@@ -2092,7 +2092,7 @@ def test_memorygrowth_MAXIMUM_MEMORY(self):
20922092 def test_memorygrowth_linear_step (self ):
20932093 if self .has_changed_setting ('ALLOW_MEMORY_GROWTH' ):
20942094 self .skipTest ('test needs to modify memory growth' )
2095- if not self .is_wasm ():
2095+ if self .is_wasm2js ():
20962096 self .skipTest ('wasm memory specific test' )
20972097
20982098 # 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):
21052105 def test_memorygrowth_geometric_step (self ):
21062106 if self .has_changed_setting ('ALLOW_MEMORY_GROWTH' ):
21072107 self .skipTest ('test needs to modify memory growth' )
2108- if not self .is_wasm ():
2108+ if self .is_wasm2js ():
21092109 self .skipTest ('wasm memory specific test' )
21102110
21112111 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):
40304030
40314031 @needs_dylink
40324032 def test_dylink_memory_growth (self ):
4033- if not self .is_wasm ():
4034- self .skipTest ('wasm only' )
40354033 self .set_setting ('ALLOW_MEMORY_GROWTH' )
40364034 self .do_basic_dylink_test ()
40374035
@@ -4884,7 +4882,7 @@ def test_dylink_hyper_dupe(self):
48844882 ''' ,
48854883 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 ' ],
48864884 # 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 ())
48884886
48894887 print ('check warnings' )
48904888 full = self .run_js ('src.js' )
@@ -4927,7 +4925,7 @@ def test_dylink_load_compiled_side_module(self):
49274925 ''' ,
49284926 expected = ['sidef: 10' ],
49294927 # 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 ())
49314929
49324930 @needs_dylink
49334931 def test_dylink_dso_needed (self ):
@@ -5363,7 +5361,7 @@ def test_langinfo(self):
53635361
53645362 def test_files (self ):
53655363 # 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 ():
53675365 print ('closure 2' )
53685366 self .emcc_args += ['--closure' , '2' ] # Use closure 2 here for some additional coverage
53695367 # Sadly --closure=2 is not yet free of closure warnings
@@ -6204,7 +6202,7 @@ def test_iostream_and_determinism(self):
62046202 shutil .copy2 ('src.js' , 'src.js.previous' )
62056203
62066204 # Same but for the wasm file.
6207- if self .is_wasm () and not self . get_setting ( 'WASM2JS' ) :
6205+ if self .is_wasm ():
62086206 if os .path .exists ('src.wasm.previous' ):
62096207 self .assertBinaryEqual ('src.wasm' , 'src.wasm.previous' )
62106208 shutil .copy2 ('src.wasm' , 'src.wasm.previous' )
@@ -7730,7 +7728,7 @@ def test_source_map(self, args):
77307728 self .emcc (os .path .abspath ('src.cpp' ),
77317729 self .get_emcc_args (),
77327730 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
77347732 # after removing the @line and @sourceMappingURL comments, the build
77357733 # result should be identical to the non-source-mapped debug version.
77367734 # this is worth checking because the parser AST swaps strings for token
@@ -7908,7 +7906,7 @@ def test_modularize_closure_pre(self):
79087906 # test that the combination of modularize + closure + pre-js works. in that mode,
79097907 # closure should not minify the Module object in a way that the pre-js cannot use it.
79107908 create_file ('post.js' , 'var TheModule = Module();\n ' )
7911- if not self .is_wasm ():
7909+ if self .is_wasm2js ():
79127910 # TODO(sbc): Fix closure warnings with MODULARIZE + WASM=0
79137911 self .ldflags .append ('-Wno-error=closure' )
79147912
@@ -8396,7 +8394,7 @@ def verify_broken(args):
83968394 @no_sanitize ('no wasm2js support yet in sanitizers' )
83978395 @requires_wasm2js
83988396 def test_wasm2js (self ):
8399- if not self .is_wasm ():
8397+ if self .is_wasm2js ():
84008398 self .skipTest ('redundant to test wasm2js in wasm2js* mode' )
84018399 self .set_setting ('WASM' , 0 )
84028400 self .do_core_test ('test_hello_world.c' )
@@ -8412,7 +8410,7 @@ def test_wasm2js(self):
84128410 @no_sanitize ('no wasm2js support yet in sanitizers' )
84138411 @requires_wasm2js
84148412 def test_maybe_wasm2js (self ):
8415- if not self .is_wasm ():
8413+ if self .is_wasm2js ():
84168414 self .skipTest ('redundant to test wasm2js in wasm2js* mode' )
84178415 self .set_setting ('MAYBE_WASM2JS' )
84188416 # see that running as wasm works
@@ -8434,7 +8432,7 @@ def test_maybe_wasm2js(self):
84348432 'minimal_runtime' : (['-sMINIMAL_RUNTIME' ],),
84358433 })
84368434 def test_wasm2js_fallback (self , args ):
8437- if not self .is_wasm ():
8435+ if self .is_wasm2js ():
84388436 self .skipTest ('redundant to test wasm2js in wasm2js* mode' )
84398437
84408438 cmd = [EMCC , test_file ('small_hello_world.c' ), '-sWASM=2' ] + args
@@ -8736,7 +8734,7 @@ def test_return_address(self):
87368734 @no_lsan ('-fsanitize-minimal-runtime cannot be used with LSan' )
87378735 def test_ubsan_minimal_too_many_errors (self ):
87388736 self .emcc_args += ['-fsanitize=undefined' , '-fsanitize-minimal-runtime' ]
8739- if not self .is_wasm ():
8737+ if self .is_wasm2js ():
87408738 if self .is_optimizing ():
87418739 self .skipTest ('test can only be run without optimizations on asm.js' )
87428740 # Need to use `-g` to get proper line numbers in asm.js
@@ -8750,10 +8748,10 @@ def test_ubsan_minimal_too_many_errors(self):
87508748 @no_lsan ('-fsanitize-minimal-runtime cannot be used with LSan' )
87518749 def test_ubsan_minimal_errors_same_place (self ):
87528750 self .emcc_args += ['-fsanitize=undefined' , '-fsanitize-minimal-runtime' ]
8753- if not self .is_wasm ():
8751+ if self .is_wasm2js ():
87548752 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
87578755 self .emcc_args += ['-g' ]
87588756 self .do_runf ('core/test_ubsan_minimal_errors_same_place.c' ,
87598757 expected_output = 'ubsan: add-overflow by 0x[0-9a-z]*\n ' * 5 ,
@@ -8851,7 +8849,7 @@ def test_ubsan_full_static_cast(self, args):
88518849 @no_wasm2js ('TODO: sanitizers in wasm2js' )
88528850 def test_ubsan_full_stack_trace (self , g_flag , expected_output ):
88538851 if g_flag == '-gsource-map' :
8854- if not self .is_wasm ():
8852+ if self .is_wasm2js ():
88558853 self .skipTest ('wasm2js has no source map support' )
88568854 elif self .get_setting ('EVAL_CTORS' ):
88578855 self .skipTest ('EVAL_CTORS does not support source maps' )
@@ -8963,7 +8961,7 @@ def test_asan(self, name, expected_output, cflags=None):
89638961 if '-Oz' in self .emcc_args :
89648962 self .skipTest ('-Oz breaks source maps' )
89658963
8966- if not self .is_wasm ():
8964+ if self .is_wasm2js ():
89678965 self .skipTest ('wasm2js has no ASan support' )
89688966
89698967 self .emcc_args .append ('-fsanitize=address' )
0 commit comments