diff options
-rw-r--r-- | src/parsing.h | 6 | ||||
-rw-r--r-- | test/revision | 2 | ||||
-rw-r--r-- | test/s2wasm_known_binaryen_shell_test_failures.txt | 1 | ||||
m--------- | test/spec | 0 | ||||
-rw-r--r-- | test/torture-s/20050107-1.c.s | 44 | ||||
-rw-r--r-- | test/torture-s/20050119-1.c.s | 95 | ||||
-rw-r--r-- | test/torture-s/20050119-2.c.s | 52 |
7 files changed, 198 insertions, 2 deletions
diff --git a/src/parsing.h b/src/parsing.h index 817355e92..1ea0ec254 100644 --- a/src/parsing.h +++ b/src/parsing.h @@ -60,7 +60,11 @@ Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allocator) } bool negative = str[0] == '-'; const char *positive = negative ? str + 1 : str; - if (positive[0] == '+') positive++; + if (!negative) { + if (positive[0] == '+') { + positive++; + } + } if (positive[0] == 'n' && positive[1] == 'a' && positive[2] == 'n') { const char * modifier = positive[3] == ':' ? positive + 4 : nullptr; assert(modifier ? positive[4] == '0' && positive[5] == 'x' : 1); diff --git a/test/revision b/test/revision index 064256798..14057d17e 100644 --- a/test/revision +++ b/test/revision @@ -1 +1 @@ -2678 +2686 diff --git a/test/s2wasm_known_binaryen_shell_test_failures.txt b/test/s2wasm_known_binaryen_shell_test_failures.txt index 6bbda22aa..23b5a5b1d 100644 --- a/test/s2wasm_known_binaryen_shell_test_failures.txt +++ b/test/s2wasm_known_binaryen_shell_test_failures.txt @@ -58,6 +58,7 @@ simd-5.c.s.wast 20041113-1.c.s.wast 20041124-1.c.s.wast 20041214-1.c.s.wast +20050119-1.c.s.wast 20050203-1.c.s.wast 20050502-1.c.s.wast 20050502-2.c.s.wast diff --git a/test/spec b/test/spec -Subproject 62c0033ab090da1e61281f9c3dd6f7857d453f3 +Subproject b6284fdbf37c4055d375250d8b0b2e98a2c5b94 diff --git a/test/torture-s/20050107-1.c.s b/test/torture-s/20050107-1.c.s new file mode 100644 index 000000000..489c22446 --- /dev/null +++ b/test/torture-s/20050107-1.c.s @@ -0,0 +1,44 @@ + .text + .file "/b/build/slave/linux/build/src/src/work/gcc/gcc/testsuite/gcc.c-torture/execute/20050107-1.c" + .section .text.foo,"ax",@progbits + .hidden foo + .globl foo + .type foo,@function +foo: # @foo + .param i32 +# BB#0: # %entry + block + i32.load8_u $push0=, 0($0) + i32.const $push1=, 1 + i32.ne $push2=, $pop0, $pop1 + br_if $pop2, 0 # 0: down to label0 +# BB#1: # %lor.lhs.false + i32.load8_u $push3=, 1($0) + i32.const $push4=, 2 + i32.ne $push5=, $pop3, $pop4 + br_if $pop5, 0 # 0: down to label0 +# BB#2: # %if.end + return +.LBB0_3: # %if.then + end_block # label0: + call abort@FUNCTION + unreachable + .endfunc +.Lfunc_end0: + .size foo, .Lfunc_end0-foo + + .section .text.main,"ax",@progbits + .hidden main + .globl main + .type main,@function +main: # @main + .result i32 +# BB#0: # %foo.exit + i32.const $push0=, 0 + return $pop0 + .endfunc +.Lfunc_end1: + .size main, .Lfunc_end1-main + + + .ident "clang version 3.9.0 " diff --git a/test/torture-s/20050119-1.c.s b/test/torture-s/20050119-1.c.s new file mode 100644 index 000000000..c8e3ee99f --- /dev/null +++ b/test/torture-s/20050119-1.c.s @@ -0,0 +1,95 @@ + .text + .file "/b/build/slave/linux/build/src/src/work/gcc/gcc/testsuite/gcc.c-torture/execute/20050119-1.c" + .section .text.foo,"ax",@progbits + .hidden foo + .globl foo + .type foo,@function +foo: # @foo + .param i32 +# BB#0: # %entry + block + i32.load8_u $push0=, 0($0) + i32.load8_u $push1=, 1($0) + i32.ne $push2=, $pop0, $pop1 + br_if $pop2, 0 # 0: down to label0 +# BB#1: # %if.end + block + i32.load8_u $push3=, 2($0) + i32.const $push4=, 2 + i32.ne $push5=, $pop3, $pop4 + br_if $pop5, 0 # 0: down to label1 +# BB#2: # %if.end7 + return +.LBB0_3: # %if.then6 + end_block # label1: + call abort@FUNCTION + unreachable +.LBB0_4: # %if.then + end_block # label0: + call abort@FUNCTION + unreachable + .endfunc +.Lfunc_end0: + .size foo, .Lfunc_end0-foo + + .section .text.main,"ax",@progbits + .hidden main + .globl main + .type main,@function +main: # @main + .result i32 + .local i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 +# BB#0: # %entry + i32.const $1=, __stack_pointer + i32.load $1=, 0($1) + i32.const $2=, 16 + i32.sub $10=, $1, $2 + i32.const $2=, __stack_pointer + i32.store $10=, 0($2), $10 + i32.const $push0=, 1 + i32.store8 $push1=, 8($10):p2align=3, $pop0 + tee_local $push18=, $0=, $pop1 + i32.const $3=, 8 + i32.add $3=, $10, $3 + i32.or $push2=, $3, $pop18 + i32.store8 $discard=, 0($pop2), $0 + i32.const $push3=, 2 + i32.const $4=, 8 + i32.add $4=, $10, $4 + i32.or $push4=, $4, $pop3 + i32.const $push17=, 2 + i32.store8 $discard=, 0($pop4):p2align=1, $pop17 + i32.const $push8=, 4 + i32.const $5=, 8 + i32.add $5=, $10, $5 + i32.or $push9=, $5, $pop8 + i32.const $push5=, 3 + i32.const $6=, 8 + i32.add $6=, $10, $6 + i32.or $push6=, $6, $pop5 + i32.const $push16=, 3 + i32.store8 $push7=, 0($pop6), $pop16 + i32.store8 $discard=, 0($pop9):p2align=2, $pop7 + i32.const $push10=, 5 + i32.const $7=, 8 + i32.add $7=, $10, $7 + i32.or $push11=, $7, $pop10 + i32.const $push12=, 258 + i32.store16 $discard=, 0($pop11):p2align=0, $pop12 + i32.const $push13=, 7 + i32.const $8=, 8 + i32.add $8=, $10, $8 + i32.or $push14=, $8, $pop13 + i32.const $push15=, 0 + i32.store8 $0=, 0($pop14), $pop15 + i32.const $9=, 8 + i32.add $9=, $10, $9 + call foo@FUNCTION, $9 + call exit@FUNCTION, $0 + unreachable + .endfunc +.Lfunc_end1: + .size main, .Lfunc_end1-main + + + .ident "clang version 3.9.0 " diff --git a/test/torture-s/20050119-2.c.s b/test/torture-s/20050119-2.c.s new file mode 100644 index 000000000..c73598f7c --- /dev/null +++ b/test/torture-s/20050119-2.c.s @@ -0,0 +1,52 @@ + .text + .file "/b/build/slave/linux/build/src/src/work/gcc/gcc/testsuite/gcc.c-torture/execute/20050119-2.c" + .section .text.foo,"ax",@progbits + .hidden foo + .globl foo + .type foo,@function +foo: # @foo + .param i32 + .result i32 +# BB#0: # %entry + block + i32.load8_u $push0=, 0($0) + i32.load8_u $push1=, 1($0) + i32.ne $push2=, $pop0, $pop1 + br_if $pop2, 0 # 0: down to label0 +# BB#1: # %if.end + block + i32.load8_u $push3=, 2($0) + i32.const $push4=, 2 + i32.ne $push5=, $pop3, $pop4 + br_if $pop5, 0 # 0: down to label1 +# BB#2: # %if.end7 + i32.load8_u $push6=, 3($0) + return $pop6 +.LBB0_3: # %if.then6 + end_block # label1: + call abort@FUNCTION + unreachable +.LBB0_4: # %if.then + end_block # label0: + call abort@FUNCTION + unreachable + .endfunc +.Lfunc_end0: + .size foo, .Lfunc_end0-foo + + .section .text.main,"ax",@progbits + .hidden main + .globl main + .type main,@function +main: # @main + .result i32 +# BB#0: # %if.end + i32.const $push0=, 0 + call exit@FUNCTION, $pop0 + unreachable + .endfunc +.Lfunc_end1: + .size main, .Lfunc_end1-main + + + .ident "clang version 3.9.0 " |