diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/example/c-api-hello-world.c | 2 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 120 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 662 | ||||
-rw-r--r-- | test/example/find_div0s.cpp | 2 | ||||
-rw-r--r-- | test/example/relooper-fuzz.c | 26 | ||||
-rw-r--r-- | test/llvm_autogenerated/memory-addr64.s | 23 | ||||
-rw-r--r-- | test/llvm_autogenerated/memory-addr64.wast | 20 | ||||
m--------- | test/spec | 0 |
8 files changed, 410 insertions, 445 deletions
diff --git a/test/example/c-api-hello-world.c b/test/example/c-api-hello-world.c index 016c2404b..e4a8a1cad 100644 --- a/test/example/c-api-hello-world.c +++ b/test/example/c-api-hello-world.c @@ -13,7 +13,7 @@ int main() { // Get the 0 and 1 arguments, and add them BinaryenExpressionRef x = BinaryenGetLocal(module, 0, BinaryenInt32()), y = BinaryenGetLocal(module, 1, BinaryenInt32()); - BinaryenExpressionRef add = BinaryenBinary(module, BinaryenAdd(), x, y); + BinaryenExpressionRef add = BinaryenBinary(module, BinaryenAddInt32(), x, y); // Create the add function // Note: no additional local variables diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 6ccd642ae..4e0bd5af4 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -73,7 +73,7 @@ void test_core() { constF64Bits = BinaryenConst(module, BinaryenLiteralFloat64Bits(0xffff12345678abcdLL)); const char* switchValueNames[] = { "the-value" }; - const char* switchBodyNames[] = { "the-body" }; + const char* switchBodyNames[] = { "the-nothing" }; BinaryenExpressionRef callOperands2[] = { makeInt32(module, 13), makeFloat64(module, 3.7) }; BinaryenExpressionRef callOperands4[] = { makeInt32(module, 13), makeInt64(module, 37), makeFloat32(module, 1.3f), makeFloat64(module, 3.7) }; @@ -81,19 +81,19 @@ void test_core() { BinaryenType params[4] = { BinaryenInt32(), BinaryenInt64(), BinaryenFloat32(), BinaryenFloat64() }; BinaryenFunctionTypeRef iiIfF = BinaryenAddFunctionType(module, "iiIfF", BinaryenInt32(), params, 4); - BinaryenExpressionRef bodyList[] = { + BinaryenExpressionRef valueList[] = { // Unary - makeUnary(module, BinaryenClz(), 1), - makeUnary(module, BinaryenCtz(), 2), - makeUnary(module, BinaryenPopcnt(), 1), - makeUnary(module, BinaryenNeg(), 3), - makeUnary(module, BinaryenAbs(), 4), - makeUnary(module, BinaryenCeil(), 3), - makeUnary(module, BinaryenFloor(), 4), - makeUnary(module, BinaryenTrunc(), 3), - makeUnary(module, BinaryenNearest(), 3), - makeUnary(module, BinaryenSqrt(), 4), - makeUnary(module, BinaryenEqZ(), 1), + makeUnary(module, BinaryenClzInt32(), 1), + makeUnary(module, BinaryenCtzInt64(), 2), + makeUnary(module, BinaryenPopcntInt32(), 1), + makeUnary(module, BinaryenNegFloat32(), 3), + makeUnary(module, BinaryenAbsFloat64(), 4), + makeUnary(module, BinaryenCeilFloat32(), 3), + makeUnary(module, BinaryenFloorFloat64(), 4), + makeUnary(module, BinaryenTruncFloat32(), 3), + makeUnary(module, BinaryenNearestFloat32(), 3), + makeUnary(module, BinaryenSqrtFloat64(), 4), + makeUnary(module, BinaryenEqZInt32(), 1), makeUnary(module, BinaryenExtendSInt32(), 1), makeUnary(module, BinaryenExtentUInt32(), 1), makeUnary(module, BinaryenWrapInt64(), 2), @@ -120,38 +120,38 @@ void test_core() { makeUnary(module, BinaryenReinterpretInt32(), 1), makeUnary(module, BinaryenReinterpretInt64(), 2), // Binary - makeBinary(module, BinaryenAdd(), 1), - makeBinary(module, BinaryenSub(), 4), - makeBinary(module, BinaryenDivS(), 1), - makeBinary(module, BinaryenDivU(), 2), - makeBinary(module, BinaryenRemS(), 2), - makeBinary(module, BinaryenRemU(), 1), - makeBinary(module, BinaryenAnd(), 1), - makeBinary(module, BinaryenOr(), 2), - makeBinary(module, BinaryenXor(), 1), - makeBinary(module, BinaryenShl(), 2), - makeBinary(module, BinaryenShrU(), 2), - makeBinary(module, BinaryenShrS(), 1), - makeBinary(module, BinaryenRotL(), 1), - makeBinary(module, BinaryenRotR(), 2), - makeBinary(module, BinaryenDiv(), 3), - makeBinary(module, BinaryenCopySign(), 4), - makeBinary(module, BinaryenMin(), 3), - makeBinary(module, BinaryenMax(), 4), - makeBinary(module, BinaryenEq(), 1), - makeBinary(module, BinaryenNe(), 3), - makeBinary(module, BinaryenLtS(), 1), - makeBinary(module, BinaryenLtU(), 2), - makeBinary(module, BinaryenLeS(), 2), - makeBinary(module, BinaryenLeU(), 1), - makeBinary(module, BinaryenGtS(), 2), - makeBinary(module, BinaryenGtU(), 1), - makeBinary(module, BinaryenGeS(), 1), - makeBinary(module, BinaryenGeU(), 2), - makeBinary(module, BinaryenLt(), 3), - makeBinary(module, BinaryenLe(), 4), - makeBinary(module, BinaryenGt(), 4), - makeBinary(module, BinaryenGe(), 3), + makeBinary(module, BinaryenAddInt32(), 1), + makeBinary(module, BinaryenSubFloat64(), 4), + makeBinary(module, BinaryenDivSInt32(), 1), + makeBinary(module, BinaryenDivUInt64(), 2), + makeBinary(module, BinaryenRemSInt64(), 2), + makeBinary(module, BinaryenRemUInt32(), 1), + makeBinary(module, BinaryenAndInt32(), 1), + makeBinary(module, BinaryenOrInt64(), 2), + makeBinary(module, BinaryenXorInt32(), 1), + makeBinary(module, BinaryenShlInt64(), 2), + makeBinary(module, BinaryenShrUInt64(), 2), + makeBinary(module, BinaryenShrSInt32(), 1), + makeBinary(module, BinaryenRotLInt32(), 1), + makeBinary(module, BinaryenRotRInt64(), 2), + makeBinary(module, BinaryenDivFloat32(), 3), + makeBinary(module, BinaryenCopySignFloat64(), 4), + makeBinary(module, BinaryenMinFloat32(), 3), + makeBinary(module, BinaryenMaxFloat64(), 4), + makeBinary(module, BinaryenEqInt32(), 1), + makeBinary(module, BinaryenNeFloat32(), 3), + makeBinary(module, BinaryenLtSInt32(), 1), + makeBinary(module, BinaryenLtUInt64(), 2), + makeBinary(module, BinaryenLeSInt64(), 2), + makeBinary(module, BinaryenLeUInt32(), 1), + makeBinary(module, BinaryenGtSInt64(), 2), + makeBinary(module, BinaryenGtUInt32(), 1), + makeBinary(module, BinaryenGeSInt32(), 1), + makeBinary(module, BinaryenGeUInt64(), 2), + makeBinary(module, BinaryenLtFloat32(), 3), + makeBinary(module, BinaryenLeFloat64(), 4), + makeBinary(module, BinaryenGtFloat64(), 4), + makeBinary(module, BinaryenGeFloat32(), 3), // All the rest BinaryenBlock(module, NULL, NULL, 0), // block with no name BinaryenIf(module, makeInt32(module, 1), makeInt32(module, 2), makeInt32(module, 3)), @@ -160,18 +160,21 @@ void test_core() { BinaryenLoop(module, NULL, "in2", makeInt32(module, 0)), BinaryenLoop(module, NULL, NULL, makeInt32(module, 0)), BinaryenBreak(module, "the-value", makeInt32(module, 0), makeInt32(module, 1)), - BinaryenBreak(module, "the-body", makeInt32(module, 2), NULL), + BinaryenBreak(module, "the-nothing", makeInt32(module, 2), NULL), BinaryenBreak(module, "the-value", NULL, makeInt32(module, 3)), - BinaryenBreak(module, "the-body", NULL, NULL), + BinaryenBreak(module, "the-nothing", NULL, NULL), BinaryenSwitch(module, switchValueNames, 1, "the-value", makeInt32(module, 0), makeInt32(module, 1)), - BinaryenSwitch(module, switchBodyNames, 1, "the-body", makeInt32(module, 2), NULL), - BinaryenUnary(module, BinaryenEqZ(), // check the output type of the call node + BinaryenSwitch(module, switchBodyNames, 1, "the-nothing", makeInt32(module, 2), NULL), + BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node BinaryenCall(module, "kitchen-sinker", callOperands4, 4, BinaryenInt32()) ), - BinaryenUnary(module, BinaryenEqZ(), // check the output type of the call node - BinaryenCallImport(module, "an-imported", callOperands2, 2, BinaryenFloat32()) + BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node + BinaryenUnary(module, + BinaryenTruncSFloat32ToInt32(), + BinaryenCallImport(module, "an-imported", callOperands2, 2, BinaryenFloat32()) + ) ), - BinaryenUnary(module, BinaryenEqZ(), // check the output type of the call node + BinaryenUnary(module, BinaryenEqZInt32(), // check the output type of the call node BinaryenCallIndirect(module, makeInt32(module, 2449), callOperands4, 4, iiIfF) ), BinaryenGetLocal(module, 0, BinaryenInt32()), @@ -183,16 +186,17 @@ void test_core() { BinaryenStore(module, 4, 0, 0, makeInt32(module, 10), makeInt32(module, 11)), BinaryenStore(module, 8, 2, 4, makeInt32(module, 110), makeInt64(module, 111)), BinaryenSelect(module, makeInt32(module, 1), makeInt32(module, 3), makeInt32(module, 5)), - BinaryenReturn(module, NULL), - BinaryenReturn(module, makeFloat32(module, 1)), + BinaryenReturn(module, makeInt32(module, 1337)), // TODO: Host BinaryenNop(module), BinaryenUnreachable(module), }; - // Make the main body of the function. one block with a return value, one without - BinaryenExpressionRef value = BinaryenBlock(module, "the-value", bodyList, sizeof(bodyList) / sizeof(BinaryenExpressionRef)); - BinaryenExpressionRef body = BinaryenBlock(module, "the-body", &value, 1); + // Make the main body of the function. and one block with a return value, one without + BinaryenExpressionRef value = BinaryenBlock(module, "the-value", valueList, sizeof(valueList) / sizeof(BinaryenExpressionRef)); + BinaryenExpressionRef nothing = BinaryenBlock(module, "the-nothing", &value, 1); + BinaryenExpressionRef bodyList[] = { nothing, makeInt32(module, 42) }; + BinaryenExpressionRef body = BinaryenBlock(module, "the-body", bodyList, 2); // Create the function BinaryenType localTypes[] = { BinaryenInt32() }; @@ -397,7 +401,7 @@ void test_binaries() { BinaryenFunctionTypeRef iii = BinaryenAddFunctionType(module, "iii", BinaryenInt32(), params, 2); BinaryenExpressionRef x = BinaryenGetLocal(module, 0, BinaryenInt32()), y = BinaryenGetLocal(module, 1, BinaryenInt32()); - BinaryenExpressionRef add = BinaryenBinary(module, BinaryenAdd(), x, y); + BinaryenExpressionRef add = BinaryenBinary(module, BinaryenAddInt32(), x, y); BinaryenFunctionRef adder = BinaryenAddFunction(module, "adder", iii, NULL, 0, add); size = BinaryenModuleWrite(module, buffer, 1024); // write out the module BinaryenModuleDispose(module); diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index e36e9ba14..c4fb6a4af 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -19,340 +19,344 @@ BinaryenFloat64: 4 (func $kitchen-sinker (type $iiIfF) (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) (local $4 i32) (block $the-body - (block $the-value - (i32.clz - (i32.const -10) - ) - (i64.ctz - (i64.const -22) - ) - (i32.popcnt - (i32.const -10) - ) - (f32.neg - (f32.const -33.61199951171875) - ) - (f64.abs - (f64.const -9005.841) - ) - (f32.ceil - (f32.const -33.61199951171875) - ) - (f64.floor - (f64.const -9005.841) - ) - (f32.trunc - (f32.const -33.61199951171875) - ) - (f32.nearest - (f32.const -33.61199951171875) - ) - (f64.sqrt - (f64.const -9005.841) - ) - (i32.eqz - (i32.const -10) - ) - (i64.extend_s/i32 - (i32.const -10) - ) - (i64.extend_u/i32 - (i32.const -10) - ) - (i32.wrap/i64 - (i64.const -22) - ) - (i32.trunc_s/f32 - (f32.const -33.61199951171875) - ) - (i64.trunc_s/f32 - (f32.const -33.61199951171875) - ) - (i32.trunc_u/f32 - (f32.const -33.61199951171875) - ) - (i64.trunc_u/f32 - (f32.const -33.61199951171875) - ) - (i32.trunc_s/f64 - (f64.const -9005.841) - ) - (i64.trunc_s/f64 - (f64.const -9005.841) - ) - (i32.trunc_u/f64 - (f64.const -9005.841) - ) - (i64.trunc_u/f64 - (f64.const -9005.841) - ) - (i32.reinterpret/f32 - (f32.const -33.61199951171875) - ) - (i64.reinterpret/f64 - (f64.const -9005.841) - ) - (f32.convert_s/i32 - (i32.const -10) - ) - (f64.convert_s/i32 - (i32.const -10) - ) - (f32.convert_u/i32 - (i32.const -10) - ) - (f64.convert_u/i32 - (i32.const -10) - ) - (f32.convert_s/i64 - (i64.const -22) - ) - (f64.convert_s/i64 - (i64.const -22) - ) - (f32.convert_u/i64 - (i64.const -22) - ) - (f64.convert_u/i64 - (i64.const -22) - ) - (f64.promote/f32 - (f32.const -33.61199951171875) - ) - (f32.demote/f64 - (f64.const -9005.841) - ) - (f32.reinterpret/i32 - (i32.const -10) - ) - (f64.reinterpret/i64 - (i64.const -22) - ) - (i32.add - (i32.const -10) - (i32.const -11) - ) - (f64.sub - (f64.const -9005.841) - (f64.const -9007.333) - ) - (i32.div_s - (i32.const -10) - (i32.const -11) - ) - (i64.div_u - (i64.const -22) - (i64.const -23) - ) - (i64.rem_s - (i64.const -22) - (i64.const -23) - ) - (i32.rem_u - (i32.const -10) - (i32.const -11) - ) - (i32.and - (i32.const -10) - (i32.const -11) - ) - (i64.or - (i64.const -22) - (i64.const -23) - ) - (i32.xor - (i32.const -10) - (i32.const -11) - ) - (i64.shl - (i64.const -22) - (i64.const -23) - ) - (i64.shr_u - (i64.const -22) - (i64.const -23) - ) - (i32.shr_s - (i32.const -10) - (i32.const -11) - ) - (i32.rotl - (i32.const -10) - (i32.const -11) - ) - (i64.rotr - (i64.const -22) - (i64.const -23) - ) - (f32.div - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - (f64.copysign - (f64.const -9005.841) - (f64.const -9007.333) - ) - (f32.min - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - (f64.max - (f64.const -9005.841) - (f64.const -9007.333) - ) - (i32.eq - (i32.const -10) - (i32.const -11) - ) - (f32.ne - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - (i32.lt_s - (i32.const -10) - (i32.const -11) - ) - (i64.lt_u - (i64.const -22) - (i64.const -23) - ) - (i64.le_s - (i64.const -22) - (i64.const -23) - ) - (i32.le_u - (i32.const -10) - (i32.const -11) - ) - (i64.gt_s - (i64.const -22) - (i64.const -23) - ) - (i32.gt_u - (i32.const -10) - (i32.const -11) - ) - (i32.ge_s - (i32.const -10) - (i32.const -11) - ) - (i64.ge_u - (i64.const -22) - (i64.const -23) - ) - (f32.lt - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - (f64.le - (f64.const -9005.841) - (f64.const -9007.333) - ) - (f64.gt - (f64.const -9005.841) - (f64.const -9007.333) - ) - (f32.ge - (f32.const -33.61199951171875) - (f32.const -62.5) - ) - (block - ) - (if - (i32.const 1) - (i32.const 2) - (i32.const 3) - ) - (if - (i32.const 4) - (i32.const 5) - ) - (loop $out $in - (i32.const 0) - ) - (loop $in2 - (i32.const 0) - ) - (loop - (i32.const 0) - ) - (br_if $the-value - (i32.const 1) - (i32.const 0) - ) - (br_if $the-body - (i32.const 2) - ) - (br $the-value - (i32.const 3) - ) - (br $the-body) - (br_table $the-value $the-value - (i32.const 1) - (i32.const 0) - ) - (br_table $the-body $the-body - (i32.const 2) - ) - (i32.eqz - (call $kitchen-sinker - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) + (block $the-nothing + (block $the-value + (i32.clz + (i32.const -10) ) - ) - (f32.eqz - (call_import $an-imported - (i32.const 13) - (f64.const 3.7) + (i64.ctz + (i64.const -22) ) - ) - (i32.eqz - (call_indirect $iiIfF - (i32.const 2449) - (i32.const 13) - (i64.const 37) - (f32.const 1.2999999523162842) - (f64.const 3.7) + (i32.popcnt + (i32.const -10) ) + (f32.neg + (f32.const -33.61199951171875) + ) + (f64.abs + (f64.const -9005.841) + ) + (f32.ceil + (f32.const -33.61199951171875) + ) + (f64.floor + (f64.const -9005.841) + ) + (f32.trunc + (f32.const -33.61199951171875) + ) + (f32.nearest + (f32.const -33.61199951171875) + ) + (f64.sqrt + (f64.const -9005.841) + ) + (i32.eqz + (i32.const -10) + ) + (i64.extend_s/i32 + (i32.const -10) + ) + (i64.extend_u/i32 + (i32.const -10) + ) + (i32.wrap/i64 + (i64.const -22) + ) + (i32.trunc_s/f32 + (f32.const -33.61199951171875) + ) + (i64.trunc_s/f32 + (f32.const -33.61199951171875) + ) + (i32.trunc_u/f32 + (f32.const -33.61199951171875) + ) + (i64.trunc_u/f32 + (f32.const -33.61199951171875) + ) + (i32.trunc_s/f64 + (f64.const -9005.841) + ) + (i64.trunc_s/f64 + (f64.const -9005.841) + ) + (i32.trunc_u/f64 + (f64.const -9005.841) + ) + (i64.trunc_u/f64 + (f64.const -9005.841) + ) + (i32.reinterpret/f32 + (f32.const -33.61199951171875) + ) + (i64.reinterpret/f64 + (f64.const -9005.841) + ) + (f32.convert_s/i32 + (i32.const -10) + ) + (f64.convert_s/i32 + (i32.const -10) + ) + (f32.convert_u/i32 + (i32.const -10) + ) + (f64.convert_u/i32 + (i32.const -10) + ) + (f32.convert_s/i64 + (i64.const -22) + ) + (f64.convert_s/i64 + (i64.const -22) + ) + (f32.convert_u/i64 + (i64.const -22) + ) + (f64.convert_u/i64 + (i64.const -22) + ) + (f64.promote/f32 + (f32.const -33.61199951171875) + ) + (f32.demote/f64 + (f64.const -9005.841) + ) + (f32.reinterpret/i32 + (i32.const -10) + ) + (f64.reinterpret/i64 + (i64.const -22) + ) + (i32.add + (i32.const -10) + (i32.const -11) + ) + (f64.sub + (f64.const -9005.841) + (f64.const -9007.333) + ) + (i32.div_s + (i32.const -10) + (i32.const -11) + ) + (i64.div_u + (i64.const -22) + (i64.const -23) + ) + (i64.rem_s + (i64.const -22) + (i64.const -23) + ) + (i32.rem_u + (i32.const -10) + (i32.const -11) + ) + (i32.and + (i32.const -10) + (i32.const -11) + ) + (i64.or + (i64.const -22) + (i64.const -23) + ) + (i32.xor + (i32.const -10) + (i32.const -11) + ) + (i64.shl + (i64.const -22) + (i64.const -23) + ) + (i64.shr_u + (i64.const -22) + (i64.const -23) + ) + (i32.shr_s + (i32.const -10) + (i32.const -11) + ) + (i32.rotl + (i32.const -10) + (i32.const -11) + ) + (i64.rotr + (i64.const -22) + (i64.const -23) + ) + (f32.div + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + (f64.copysign + (f64.const -9005.841) + (f64.const -9007.333) + ) + (f32.min + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + (f64.max + (f64.const -9005.841) + (f64.const -9007.333) + ) + (i32.eq + (i32.const -10) + (i32.const -11) + ) + (f32.ne + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + (i32.lt_s + (i32.const -10) + (i32.const -11) + ) + (i64.lt_u + (i64.const -22) + (i64.const -23) + ) + (i64.le_s + (i64.const -22) + (i64.const -23) + ) + (i32.le_u + (i32.const -10) + (i32.const -11) + ) + (i64.gt_s + (i64.const -22) + (i64.const -23) + ) + (i32.gt_u + (i32.const -10) + (i32.const -11) + ) + (i32.ge_s + (i32.const -10) + (i32.const -11) + ) + (i64.ge_u + (i64.const -22) + (i64.const -23) + ) + (f32.lt + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + (f64.le + (f64.const -9005.841) + (f64.const -9007.333) + ) + (f64.gt + (f64.const -9005.841) + (f64.const -9007.333) + ) + (f32.ge + (f32.const -33.61199951171875) + (f32.const -62.5) + ) + (block + ) + (if + (i32.const 1) + (i32.const 2) + (i32.const 3) + ) + (if + (i32.const 4) + (i32.const 5) + ) + (loop $out $in + (i32.const 0) + ) + (loop $in2 + (i32.const 0) + ) + (loop + (i32.const 0) + ) + (br_if $the-value + (i32.const 1) + (i32.const 0) + ) + (br_if $the-nothing + (i32.const 2) + ) + (br $the-value + (i32.const 3) + ) + (br $the-nothing) + (br_table $the-value $the-value + (i32.const 1) + (i32.const 0) + ) + (br_table $the-nothing $the-nothing + (i32.const 2) + ) + (i32.eqz + (call $kitchen-sinker + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + ) + ) + (i32.eqz + (i32.trunc_s/f32 + (call_import $an-imported + (i32.const 13) + (f64.const 3.7) + ) + ) + ) + (i32.eqz + (call_indirect $iiIfF + (i32.const 2449) + (i32.const 13) + (i64.const 37) + (f32.const 1.2999999523162842) + (f64.const 3.7) + ) + ) + (get_local $0) + (set_local $0 + (i32.const 101) + ) + (i32.load + (i32.const 1) + ) + (i64.load8_s offset=2 align=4 + (i32.const 8) + ) + (f32.load + (i32.const 2) + ) + (f64.load offset=2 + (i32.const 9) + ) + (i32.store + (i32.const 10) + (i32.const 11) + ) + (i64.store offset=2 align=4 + (i32.const 110) + (i64.const 111) + ) + (select + (i32.const 3) + (i32.const 5) + (i32.const 1) + ) + (return + (i32.const 1337) + ) + (nop) + (unreachable) ) - (get_local $0) - (set_local $0 - (i32.const 101) - ) - (i32.load - (i32.const 1) - ) - (i64.load8_s offset=2 align=4 - (i32.const 8) - ) - (f32.load - (i32.const 2) - ) - (f64.load offset=2 - (i32.const 9) - ) - (i32.store - (i32.const 10) - (i32.const 11) - ) - (i64.store offset=2 align=4 - (i32.const 110) - (i64.const 111) - ) - (select - (i32.const 3) - (i32.const 5) - (i32.const 1) - ) - (return) - (return - (f32.const 1) - ) - (nop) - (unreachable) ) + (i32.const 42) ) ) (func $starter (type $v) diff --git a/test/example/find_div0s.cpp b/test/example/find_div0s.cpp index c3a2c0750..45e7f4633 100644 --- a/test/example/find_div0s.cpp +++ b/test/example/find_div0s.cpp @@ -42,7 +42,7 @@ int main() { struct DivZeroSeeker : public PostWalker<DivZeroSeeker, Visitor<DivZeroSeeker>> { void visitBinary(Binary* curr) { // In every Binary, look for integer divisions - if (curr->op == BinaryOp::DivS || curr->op == BinaryOp::DivU) { + if (curr->op == BinaryOp::DivSInt32 || curr->op == BinaryOp::DivUInt32) { // Check if the right operand is a constant, and if it is 0 auto right = curr->right->dynCast<Const>(); if (right && right->value.getInteger() == 0) { diff --git a/test/example/relooper-fuzz.c b/test/example/relooper-fuzz.c index cfd10a9b3..ecb204347 100644 --- a/test/example/relooper-fuzz.c +++ b/test/example/relooper-fuzz.c @@ -16,7 +16,7 @@ int main() { // if the end, halt BinaryenExpressionRef halter = BinaryenIf(module, BinaryenBinary(module, - BinaryenEq(), + BinaryenEqInt32(), BinaryenLoad(module, 4, 0, 0, 0, BinaryenInt32(), BinaryenConst(module, BinaryenLiteralInt32(4))), BinaryenConst(module, BinaryenLiteralInt32(4 * 27)) // jumps of 4 bytes ), @@ -28,7 +28,7 @@ int main() { 4, 0, 0, BinaryenConst(module, BinaryenLiteralInt32(4)), BinaryenBinary(module, - BinaryenAdd(), + BinaryenAddInt32(), BinaryenLoad(module, 4, 0, 0, 0, BinaryenInt32(), BinaryenConst(module, BinaryenLiteralInt32(4))), BinaryenConst(module, BinaryenLiteralInt32(4)) ) @@ -37,7 +37,7 @@ int main() { // optionally, print the return value BinaryenExpressionRef args[] = { BinaryenBinary(module, - BinaryenSub(), + BinaryenSubInt32(), BinaryenConst(module, BinaryenLiteralInt32(0)), BinaryenLoad(module, 4, 0, 4, 0, BinaryenInt32(), @@ -155,9 +155,9 @@ int main() { } RelooperAddBranch(b0, b5, BinaryenBinary(module, - BinaryenEq(), + BinaryenEqInt32(), BinaryenBinary(module, - BinaryenRemU(), + BinaryenRemUInt32(), BinaryenGetLocal(module, 0, BinaryenInt32()), BinaryenConst(module, BinaryenLiteralInt32(2)) ), @@ -171,9 +171,9 @@ int main() { RelooperAddBranch(b2, b5, NULL, NULL); RelooperAddBranch(b3, b5, BinaryenBinary(module, - BinaryenEq(), + BinaryenEqInt32(), BinaryenBinary(module, - BinaryenRemU(), + BinaryenRemUInt32(), BinaryenGetLocal(module, 0, BinaryenInt32()), BinaryenConst(module, BinaryenLiteralInt32(2)) ), @@ -183,9 +183,9 @@ int main() { RelooperAddBranch(b3, b8, NULL, NULL); RelooperAddBranch(b4, b4, BinaryenBinary(module, - BinaryenEq(), + BinaryenEqInt32(), BinaryenBinary(module, - BinaryenRemU(), + BinaryenRemUInt32(), BinaryenGetLocal(module, 0, BinaryenInt32()), BinaryenConst(module, BinaryenLiteralInt32(3)) ), @@ -193,9 +193,9 @@ int main() { ), NULL); RelooperAddBranch(b4, b5, BinaryenBinary(module, - BinaryenEq(), + BinaryenEqInt32(), BinaryenBinary(module, - BinaryenRemU(), + BinaryenRemUInt32(), BinaryenGetLocal(module, 0, BinaryenInt32()), BinaryenConst(module, BinaryenLiteralInt32(3)) ), @@ -205,9 +205,9 @@ int main() { RelooperAddBranch(b4, b2, NULL, NULL); RelooperAddBranch(b5, b4, BinaryenBinary(module, - BinaryenEq(), + BinaryenEqInt32(), BinaryenBinary(module, - BinaryenRemU(), + BinaryenRemUInt32(), BinaryenGetLocal(module, 0, BinaryenInt32()), BinaryenConst(module, BinaryenLiteralInt32(2)) ), diff --git a/test/llvm_autogenerated/memory-addr64.s b/test/llvm_autogenerated/memory-addr64.s deleted file mode 100644 index 7a8ca3e8e..000000000 --- a/test/llvm_autogenerated/memory-addr64.s +++ /dev/null @@ -1,23 +0,0 @@ - .text - .file "/s/llvm/llvm/test/CodeGen/WebAssembly/memory-addr64.ll" - .globl memory_size - .type memory_size,@function -memory_size: - .result i64 - memory_size $push0= - return $pop0 - .endfunc -.Lfunc_end0: - .size memory_size, .Lfunc_end0-memory_size - - .globl grow_memory - .type grow_memory,@function -grow_memory: - .param i64 - grow_memory $0 - return - .endfunc -.Lfunc_end1: - .size grow_memory, .Lfunc_end1-grow_memory - - diff --git a/test/llvm_autogenerated/memory-addr64.wast b/test/llvm_autogenerated/memory-addr64.wast deleted file mode 100644 index b9b52d85f..000000000 --- a/test/llvm_autogenerated/memory-addr64.wast +++ /dev/null @@ -1,20 +0,0 @@ -(module - (memory 1 - (segment 4 "\10\04\00\00") - ) - (export "memory" memory) - (export "memory_size" $memory_size) - (export "grow_memory" $grow_memory) - (func $memory_size (result i64) - (return - (current_memory) - ) - ) - (func $grow_memory (param $$0 i64) - (grow_memory - (get_local $$0) - ) - (return) - ) -) -;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] } diff --git a/test/spec b/test/spec -Subproject 3b4a2a969b104915cbc6695c83810f72769ff1b +Subproject 613dd58acfcc97c500dd6a77d88c716225db6e8 |