diff options
-rw-r--r-- | test/harness-windows/wasm2c/simd_formatting.txt | 18 | ||||
-rw-r--r-- | test/harness/wasm2c/simd_formatting.txt | 18 | ||||
-rwxr-xr-x | test/run-spec-wasm2c.py | 7 | ||||
-rwxr-xr-x | test/run-tests.py | 2 | ||||
-rw-r--r-- | test/spec-wasm2c-prefix.c | 16 | ||||
-rw-r--r-- | test/utils.py | 6 |
6 files changed, 63 insertions, 4 deletions
diff --git a/test/harness-windows/wasm2c/simd_formatting.txt b/test/harness-windows/wasm2c/simd_formatting.txt new file mode 100644 index 00000000..1c9d9f9a --- /dev/null +++ b/test/harness-windows/wasm2c/simd_formatting.txt @@ -0,0 +1,18 @@ +;;; TOOL: run-spec-wasm2c +;;; ERROR: 1 +;;; PLATFORMS: Windows +(module + (func (export "x") (param $x v128) (result v128) (local.get $x)) +) +(assert_return (invoke "x" (v128.const i8x16 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F)) + (v128.const i8x16 0xFF 0xFE 0xFD 0xFC 0xFB 0xFA 0xF9 0xF8 0xF7 0xF6 0xF5 0xF4 0xF3 0xF2 0xF1 0xF0)) +(;; STDERR ;;; +Error running "'out/test/harness-windows/wasm2c/simd_formatting\simd_formatting.exe'" (1): +0/1 tests passed. + +out/test/harness-windows/wasm2c/simd_formatting\simd_formatting-main.c:384: assertion failed: in w2c_simd__formatting__0__wasm_x(&simd__formatting__0__wasm_instance, simde_wasm_i8x16_make(0u,1u,2u,3u,4u,5u,6u,7u,8u,9u,10u,11u,12u,13u,14u,15u)): expected <255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 >, got <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 >. + +;;; STDERR ;;) +(;; STDOUT ;;; +0/1 tests passed. +;;; STDOUT ;;) diff --git a/test/harness/wasm2c/simd_formatting.txt b/test/harness/wasm2c/simd_formatting.txt new file mode 100644 index 00000000..cbfa29f6 --- /dev/null +++ b/test/harness/wasm2c/simd_formatting.txt @@ -0,0 +1,18 @@ +;;; TOOL: run-spec-wasm2c +;;; ERROR: 1 +;;; NOT-PLATFORMS: Windows +(module + (func (export "x") (param $x v128) (result v128) (local.get $x)) +) +(assert_return (invoke "x" (v128.const i8x16 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F)) + (v128.const i8x16 0xFF 0xFE 0xFD 0xFC 0xFB 0xFA 0xF9 0xF8 0xF7 0xF6 0xF5 0xF4 0xF3 0xF2 0xF1 0xF0)) +(;; STDERR ;;; +Error running "out/test/harness/wasm2c/simd_formatting/simd_formatting" (1): +0/1 tests passed. + +out/test/harness/wasm2c/simd_formatting/simd_formatting-main.c:384: assertion failed: in w2c_simd__formatting__0__wasm_x(&simd__formatting__0__wasm_instance, simde_wasm_i8x16_make(0u,1u,2u,3u,4u,5u,6u,7u,8u,9u,10u,11u,12u,13u,14u,15u)): expected <255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 >, got <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 >. + +;;; STDERR ;;) +(;; STDOUT ;;; +0/1 tests passed. +;;; STDOUT ;;) diff --git a/test/run-spec-wasm2c.py b/test/run-spec-wasm2c.py index 533ec045..af8b3ad7 100755 --- a/test/run-spec-wasm2c.py +++ b/test/run-spec-wasm2c.py @@ -408,7 +408,7 @@ class CWriter(object): return ', '.join(self._Constant({'type': const['lane_type'], 'value': val}) for val in const['value']) def _SIMDFound(self, num, lane_type, lane_count): - return 'simde_wasm_%sx%d_extract_lane(actual, %d)' % (lane_type, lane_count, num) + return 'v128_%sx%d_extract_lane(actual, %d)' % (lane_type, lane_count, num) def _SIMDFoundList(self, lane_type, lane_count): return ', '.join(self._SIMDFound(num, lane_type, lane_count) for num in range(lane_count)) @@ -644,7 +644,10 @@ def main(args): # Run the resulting binary if options.run: - utils.Executable(main_exe, forward_stdout=True).RunWithArgs() + error = utils.Executable(main_exe).RunWithArgsForError() + if error: + print(error, file=sys.stderr) + return 1 return 0 diff --git a/test/run-tests.py b/test/run-tests.py index 80ed189d..3f995e2b 100755 --- a/test/run-tests.py +++ b/test/run-tests.py @@ -503,6 +503,8 @@ class TestInfo(object): self.env = dict(x.split('=') for x in value.split()) elif key == 'PLATFORMS': self.skip = platform.system() not in value.split() + elif key == 'NOT-PLATFORMS': + self.skip = platform.system() in value.split() else: raise Error('Unknown directive: %s' % key) diff --git a/test/spec-wasm2c-prefix.c b/test/spec-wasm2c-prefix.c index b2f5d103..ab57e9b4 100644 --- a/test/spec-wasm2c-prefix.c +++ b/test/spec-wasm2c-prefix.c @@ -13,6 +13,18 @@ #include "wasm-rt-impl.h" #include "wasm-rt-exceptions.h" +// like is_equal_TYPE below, always use unsigned for these +#define v128_i8x16_extract_lane simde_wasm_u8x16_extract_lane +#define v128_u8x16_extract_lane simde_wasm_u8x16_extract_lane +#define v128_i16x8_extract_lane simde_wasm_u16x8_extract_lane +#define v128_u16x8_extract_lane simde_wasm_u16x8_extract_lane +#define v128_i32x4_extract_lane simde_wasm_u32x4_extract_lane +#define v128_u32x4_extract_lane simde_wasm_u32x4_extract_lane +#define v128_i64x2_extract_lane simde_wasm_u64x2_extract_lane +#define v128_u64x2_extract_lane simde_wasm_u64x2_extract_lane +#define v128_f32x4_extract_lane simde_wasm_f32x4_extract_lane +#define v128_f64x2_extract_lane simde_wasm_f64x2_extract_lane + static int g_tests_run; static int g_tests_passed; @@ -143,8 +155,8 @@ static void error(const char* file, int line, const char* format, ...) { #define MULTI_T_UNPACK_(...) __VA_ARGS__ #define MULTI_T_UNPACK(arg) MULTI_T_UNPACK_ arg -#define MULTI_i8 "%su " -#define MULTI_i16 "%su " +#define MULTI_i8 "%" PRIu8 " " +#define MULTI_i16 "%" PRIu16 " " #define MULTI_i32 "%u " #define MULTI_i64 "%" PRIu64 " " #define MULTI_f32 "%.9g " diff --git a/test/utils.py b/test/utils.py index ee33f3c9..fab0d4b0 100644 --- a/test/utils.py +++ b/test/utils.py @@ -94,6 +94,12 @@ class Executable(object): if error: raise error + def RunWithArgsForError(self, *args, **kwargs): + stdout, stderr, error = self._RunWithArgsInternal(*args, **kwargs) + if stdout: + sys.stdout.write(stdout) + return error + def AppendArg(self, arg): self.after_args.append(arg) |