Skip to content

Commit

Permalink
Test i64 math only in wasm2js mode (#20791)
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken authored Nov 29, 2023
1 parent 58cf85c commit 3fd2ad3
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ def decorated(f):
return decorated


# Some tests are marked as only-wasm2js because they test basic codegen in a way
# that is mainly useful for the wasm2js compiler and not LLVM. LLVM tests its
# own codegen, while wasm2js testing is split between the binaryen repo (which
# tests wat files) and this repo (which tests C/C++ files).
def only_wasm2js(note=''):
assert not callable(note)

Expand Down Expand Up @@ -452,60 +456,76 @@ def test_int53_convertI32PairToI53Checked(self):
else:
self.do_core_test('test_convertI32PairToI53Checked.cpp', interleaved_output=False)

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64(self):
self.do_core_test('test_i64.c')

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64_2(self):
self.do_core_test('test_i64_2.cpp')

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64_3(self):
self.do_core_test('test_i64_3.cpp')

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64_4(self):
# stuff that also needs sign corrections

self.do_core_test('test_i64_4.c')

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64_b(self):
self.do_core_test('test_i64_b.cpp')

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64_cmp(self):
self.do_core_test('test_i64_cmp.cpp')

@only_wasm2js('test shifts etc. on 64-bit integers')
def test_i64_cmp2(self):
self.do_core_test('test_i64_cmp2.c')

@only_wasm2js('test unions of i64 and double')
def test_i64_double(self):
self.do_core_test('test_i64_double.cpp')

@only_wasm2js('test 64-bit multiply')
def test_i64_umul(self):
self.do_core_test('test_i64_umul.c')

@only_wasm2js('test 64-bit math')
@also_with_standalone_wasm()
@no_ubsan('contains UB')
def test_i64_precise(self):
self.do_core_test('test_i64_precise.c')

@only_wasm2js('test 64-bit multiply')
def test_i64_precise_needed(self):
self.do_core_test('test_i64_precise_needed.c')

def test_i64_llabs(self):
# test the libc llabs() method
self.do_core_test('test_i64_llabs.c')

def test_i64_zextneg(self):
# test zero/sign-extension in printf arguments
self.do_core_test('test_i64_zextneg.c')

@only_wasm2js('test 64-bit math')
def test_i64_7z(self):
# needs to flush stdio streams
self.set_setting('EXIT_RUNTIME')
self.do_core_test('test_i64_7z.c', args=['hallo'])

@only_wasm2js('test 64-bit math with short values')
def test_i64_i16(self):
self.do_core_test('test_i64_i16.c')

@only_wasm2js('test 64-bit/double conversions')
def test_i64_qdouble(self):
self.do_core_test('test_i64_qdouble.c')

@only_wasm2js('tests va_arg() with i64 params')
def test_i64_varargs(self):
self.do_core_test('test_i64_varargs.c', args='waka fleefl asdfasdfasdfasdf'.split())

Expand Down

0 comments on commit 3fd2ad3

Please sign in to comment.