Update tests.

This commit is contained in:
chriseth 2020-10-13 13:28:39 +02:00
parent bfd267459c
commit 60af9d24ff
94 changed files with 521 additions and 339 deletions

View File

@ -28,6 +28,7 @@
#include <test/evmc/evmc.hpp>
#include <libsolutil/CommonIO.h>
#include <libsolutil/FunctionSelector.h>
#include <liblangutil/Exceptions.h>
@ -112,6 +113,14 @@ std::pair<bool, string> ExecutionFramework::compareAndCreateMessage(
return make_pair(false, message);
}
bytes ExecutionFramework::panicData(util::PanicCode _code)
{
return
m_evmVersion.supportsReturndata() ?
toCompactBigEndian(selectorFromSignature32("Panic(uint256)"), 4) + encode(u256(_code)) :
bytes();
}
u256 ExecutionFramework::gasLimit() const
{
return {m_evmcHost->tx_context.block_gas_limit};

View File

@ -33,6 +33,7 @@
#include <libsolutil/FixedHash.h>
#include <libsolutil/Keccak256.h>
#include <libsolutil/ErrorCodes.h>
#include <functional>
@ -200,6 +201,9 @@ public:
{
return bytes();
}
/// @returns error returndata corresponding to the Panic(uint256) error code,
/// if REVERT is supported by the current EVM version and the empty string otherwise.
bytes panicData(util::PanicCode _code);
//@todo might be extended in the future
template <class Arg>

View File

@ -103,7 +103,7 @@ object "C_80" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -116,7 +116,7 @@ object "C_80" {
function checked_exp_t_rational_10_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 77) { panic_error() }
if gt(exponent, 77) { panic_error_0x11() }
power := exp(10, exponent)
}
@ -124,7 +124,7 @@ object "C_80" {
function checked_exp_t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 1) { panic_error() }
if gt(exponent, 1) { panic_error_0x11() }
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639935, exponent)
}
@ -138,7 +138,7 @@ object "C_80" {
function checked_exp_t_rational_2_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 255) { panic_error() }
if gt(exponent, 255) { panic_error_0x11() }
power := exp(2, exponent)
}
@ -152,7 +152,7 @@ object "C_80" {
function checked_exp_t_rational_minus_2_by_1_t_uint256(exponent) -> power {
exponent := cleanup_t_uint256(exponent)
if gt(exponent, 255) { panic_error() }
if gt(exponent, 255) { panic_error_0x11() }
power := exp(115792089237316195423570985008687907853269984665640564039457584007913129639934, exponent)
}
@ -274,8 +274,16 @@ object "C_80" {
}
function panic_error() {
invalid()
function panic_error_0x11() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x11)
revert(0, 0x24)
}
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue {

View File

@ -57,7 +57,7 @@ object "D_15" {
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
let _2 := datasize("C_2")
let _3 := add(128, _2)
if or(gt(_3, 0xffffffffffffffff), lt(_3, 128)) { invalid() }
if or(gt(_3, 0xffffffffffffffff), lt(_3, 128)) { panic_error_0x41() }
datacopy(128, dataoffset("C_2"), _2)
pop(create(_1, 128, _2))
return(allocateMemory(_1), _1)
@ -69,9 +69,15 @@ object "D_15" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
}
object "C_2" {
code {

View File

@ -33,7 +33,7 @@ object "C_59" {
if gt(offset, _3) { revert(_1, _1) }
if iszero(slt(add(offset, 35), calldatasize())) { revert(_1, _1) }
let length := calldataload(add(4, offset))
if gt(length, _3) { invalid() }
if gt(length, _3) { panic_error_0x41() }
let _4 := mul(length, _2)
let dst := allocateMemory(add(_4, _2))
let dst_1 := dst
@ -60,7 +60,7 @@ object "C_59" {
if slt(sub(end, headStart), 0x20) { revert(value, value) }
let memPtr := mload(64)
let newFreePtr := add(memPtr, 0x20)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
value := memPtr
mstore(memPtr, calldataload(headStart))
@ -87,14 +87,14 @@ object "C_59" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function convert_t_stringliteral_6490_to_t_string() -> converted
{
let memPtr := mload(64)
let newFreePtr := add(memPtr, 160)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
converted := memPtr
mstore(memPtr, 100)
@ -109,26 +109,37 @@ object "C_59" {
}
function fun_sumArray_58(vloc__s_22_mpos) -> vloc, vloc__27_mpos
{
let _1 := mload(vloc__s_22_mpos)
if iszero(lt(vloc, _1)) { invalid() }
let _2 := mload(mload(add(add(vloc__s_22_mpos, mul(vloc, 32)), 32)))
let _3, _4 := storage_array_index_access$_t_struct$_S_storage(vloc, vloc)
sstore(_3, _2)
if iszero(lt(0x01, _1)) { invalid() }
let _5 := mload(mload(add(vloc__s_22_mpos, 64)))
if iszero(lt(vloc, 0x02)) { invalid() }
if iszero(lt(vloc, mload(vloc__s_22_mpos))) { panic_error_0x32() }
let _1 := mload(mload(add(add(vloc__s_22_mpos, mul(vloc, 32)), 32)))
let _2, _3 := storage_array_index_access$_t_struct$_S_storage(vloc, vloc)
sstore(_2, _1)
if iszero(lt(0x01, mload(vloc__s_22_mpos))) { panic_error_0x32() }
let _4 := mload(mload(add(vloc__s_22_mpos, 64)))
if iszero(lt(vloc, 0x02)) { panic_error_0x32() }
let slot := add(0x02, vloc)
let _6 := sload(slot)
let _5 := sload(slot)
let shiftBits := mul(vloc, 8)
let mask := shl(shiftBits, not(0))
sstore(slot, or(and(_6, not(mask)), and(shl(shiftBits, _5), mask)))
let _7, _8 := storage_array_index_access$_t_struct$_S_storage(0x02, vloc)
vloc := extract_from_storage_value_dynamict_uint256(sload(_7), _8)
sstore(slot, or(and(_5, not(mask)), and(shl(shiftBits, _4), mask)))
let _6, _7 := storage_array_index_access$_t_struct$_S_storage(0x02, vloc)
vloc := extract_from_storage_value_dynamict_uint256(sload(_6), _7)
vloc__27_mpos := convert_t_stringliteral_6490_to_t_string()
}
function panic_error_0x32()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x32)
revert(0, 0x24)
}
function panic_error_0x41()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
function storage_array_index_access$_t_struct$_S_storage(array, index) -> slot, offset
{
if iszero(lt(index, 0x02)) { invalid() }
if iszero(lt(index, 0x02)) { panic_error_0x32() }
slot := add(array, index)
offset := offset
}

View File

@ -33,14 +33,12 @@ object "Arraysum_33" {
for { }
lt(vloc_i, _2)
{
if eq(vloc_i, not(0)) { invalid() }
if eq(vloc_i, not(0)) { panic_error_0x11() }
vloc_i := add(vloc_i, 1)
}
{
mstore(_1, _1)
let _3 := sload(add(keccak256(_1, 0x20), vloc_i))
if gt(vloc_sum, not(_3)) { invalid() }
vloc_sum := add(vloc_sum, _3)
vloc_sum := checked_add_t_uint256(vloc_sum, sload(add(keccak256(_1, 0x20), vloc_i)))
}
let memPos := allocateMemory(_1)
return(memPos, sub(abi_encode_uint(memPos, vloc_sum), memPos))
@ -57,9 +55,25 @@ object "Arraysum_33" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { invalid() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
mstore(64, newFreePtr)
}
function checked_add_t_uint256(x, y) -> sum
{
if gt(x, not(y)) { panic_error_0x11() }
sum := add(x, y)
}
function panic_error_0x11()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x11)
revert(0, 0x24)
}
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -44,13 +44,17 @@ object \"C_6\" {
{
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function fun_f_5()
{ }
function panic_error()
{ invalid() }
function panic_error_0x41()
{
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue
{ newValue := shr(224, value) }
}

View File

@ -61,7 +61,7 @@ object \"C_6\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -69,8 +69,10 @@ object \"C_6\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue {

File diff suppressed because one or more lines are too long

View File

@ -71,7 +71,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -116,8 +116,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function round_up_to_mul_of_32(value) -> result {

View File

@ -67,7 +67,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -88,8 +88,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_right_224_unsigned(value) -> newValue {

View File

@ -67,7 +67,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -93,8 +93,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_left_224(value) -> newValue {

View File

@ -71,7 +71,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -120,8 +120,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function round_up_to_mul_of_32(value) -> result {

View File

@ -67,7 +67,7 @@ object \"C_10\" {
memPtr := mload(64)
let newFreePtr := add(memPtr, size)
// protect against overflow
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error() }
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
@ -93,8 +93,10 @@ object \"C_10\" {
}
function panic_error() {
invalid()
function panic_error_0x41() {
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
mstore(4, 0x41)
revert(0, 0x24)
}
function shift_left_224(value) -> newValue {

View File

@ -119,7 +119,7 @@ BOOST_AUTO_TEST_CASE(enum_type_cleanup)
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("f(uint256)", 0) == encodeArgs(0));
BOOST_CHECK(callContractFunction("f(uint256)", 1) == encodeArgs(1));
BOOST_CHECK(callContractFunction("f(uint256)", 2) == encodeArgs());
BOOST_CHECK(callContractFunction("f(uint256)", 2) == panicData(PanicCode::EnumConversionError));
)
}

View File

@ -33,6 +33,7 @@
#include <libevmasm/Assembly.h>
#include <libsolutil/Keccak256.h>
#include <libsolutil/ErrorCodes.h>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/test/unit_test.hpp>
@ -2554,7 +2555,7 @@ BOOST_AUTO_TEST_CASE(generic_staticcall)
ABI_CHECK(callContractFunction("g(address)", c_addressA), encodeArgs(true, 0x40, 0x20, 23 + 42));
ABI_CHECK(callContractFunction("h(address)", c_addressA), encodeArgs(false, 0x40, 0x00));
ABI_CHECK(callContractFunction("i(address,uint256)", c_addressA, 42), encodeArgs(true, 0x40, 0x20, 42));
ABI_CHECK(callContractFunction("i(address,uint256)", c_addressA, 23), encodeArgs(false, 0x40, 0x00));
ABI_CHECK(callContractFunction("i(address,uint256)", c_addressA, 23), encodeArgs(false, 0x40, 0x24) + panicData(PanicCode::Assert) + bytes(32 - 4, 0));
}
}
@ -3678,8 +3679,7 @@ BOOST_AUTO_TEST_CASE(invalid_enum_logged)
BOOST_REQUIRE_EQUAL(logTopic(0, 0), util::keccak256(string("Log(uint8)")));
BOOST_CHECK_EQUAL(h256(logData(0)), h256(u256(0)));
// should throw
ABI_CHECK(callContractFunction("test_log()"), encodeArgs());
ABI_CHECK(callContractFunction("test_log()"), panicData(PanicCode::EnumConversionError));
}
BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund)
@ -3696,7 +3696,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund)
}
}
)";
ABI_CHECK(compileAndRunWithoutCheck({{"", sourceCode}}, 0, "A"), encodeArgs());
ABI_CHECK(compileAndRunWithoutCheck({{"", sourceCode}}, 0, "A"), panicData(PanicCode::ArrayOutOfBounds));
BOOST_CHECK(!m_transactionSuccessful);
}
@ -4176,7 +4176,7 @@ BOOST_AUTO_TEST_CASE(calldata_bytes_array_bounds)
);
ABI_CHECK(
callContractFunction("f(bytes[],uint256)", 0x40, 2, 1, 0x20, 2, bytes{'a', 'b'} + bytes(30, 0)),
encodeArgs()
panicData(PanicCode::ArrayOutOfBounds)
);
}
@ -4226,11 +4226,9 @@ BOOST_AUTO_TEST_CASE(calldata_array_two_dimensional)
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256)", 0x60, i, j, encoding), encodeArgs(data[i][j]));
ABI_CHECK(callContractFunction("reenc(" + arrayType + ",uint256,uint256)", 0x60, i, j, encoding), encodeArgs(data[i][j]));
}
// out of bounds access
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256)", 0x60, i, data[i].size(), encoding), encodeArgs());
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256)", 0x60, i, data[i].size(), encoding), panicData(PanicCode::ArrayOutOfBounds));
}
// out of bounds access
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256)", 0x40, data.size(), encoding), encodeArgs());
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256)", 0x40, data.size(), encoding), panicData(PanicCode::ArrayOutOfBounds));
}
}
@ -4308,14 +4306,11 @@ BOOST_AUTO_TEST_CASE(calldata_array_dynamic_three_dimensional)
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256,uint256)", 0x80, i, j, k, encoding), encodeArgs(data[i][j][k]));
ABI_CHECK(callContractFunction("reenc(" + arrayType + ",uint256,uint256,uint256)", 0x80, i, j, k, encoding), encodeArgs(data[i][j][k]));
}
// out of bounds access
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256,uint256)", 0x80, i, j, data[i][j].size(), encoding), encodeArgs());
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256,uint256)", 0x80, i, j, data[i][j].size(), encoding), panicData(PanicCode::ArrayOutOfBounds));
}
// out of bounds access
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256)", 0x60, i, data[i].size(), encoding), encodeArgs());
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256,uint256)", 0x60, i, data[i].size(), encoding), panicData(PanicCode::ArrayOutOfBounds));
}
// out of bounds access
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256)", 0x40, data.size(), encoding), encodeArgs());
ABI_CHECK(callContractFunction("test(" + arrayType + ",uint256)", 0x40, data.size(), encoding), panicData(PanicCode::ArrayOutOfBounds));
}
}

View File

@ -327,9 +327,23 @@ BOOST_AUTO_TEST_CASE(arithmetic)
)";
bytes code = compileFirstExpression(sourceCode, {}, {{"test", "f", "y"}});
bytes panic =
bytes{uint8_t(Instruction::PUSH32)} +
fromHex("4E487B7100000000000000000000000000000000000000000000000000000000") +
bytes{
uint8_t(Instruction::PUSH1), 0x0,
uint8_t(Instruction::MSTORE),
uint8_t(Instruction::PUSH1), 0x12,
uint8_t(Instruction::PUSH1), 0x4,
uint8_t(Instruction::MSTORE),
uint8_t(Instruction::PUSH1), 0x24,
uint8_t(Instruction::PUSH1), 0x0,
uint8_t(Instruction::REVERT)
};
bytes expectation;
if (solidity::test::CommonOptions::get().optimize)
expectation = {
expectation = bytes{
uint8_t(Instruction::PUSH1), 0x2,
uint8_t(Instruction::PUSH1), 0x3,
uint8_t(Instruction::PUSH1), 0x5,
@ -346,24 +360,24 @@ BOOST_AUTO_TEST_CASE(arithmetic)
uint8_t(Instruction::DUP2),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::PUSH1), 0x1b,
uint8_t(Instruction::JUMPI),
uint8_t(Instruction::INVALID),
uint8_t(Instruction::PUSH1), 0x48,
uint8_t(Instruction::JUMPI)
} + panic + bytes{
uint8_t(Instruction::JUMPDEST),
uint8_t(Instruction::MOD),
uint8_t(Instruction::DUP2),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::PUSH1), 0x24,
uint8_t(Instruction::JUMPI),
uint8_t(Instruction::INVALID),
uint8_t(Instruction::PUSH1), 0x7e,
uint8_t(Instruction::JUMPI)
} + panic + bytes{
uint8_t(Instruction::JUMPDEST),
uint8_t(Instruction::DIV),
uint8_t(Instruction::PUSH1), 0x1,
uint8_t(Instruction::MUL)
};
else
expectation = {
expectation = bytes{
uint8_t(Instruction::PUSH1), 0x1,
uint8_t(Instruction::PUSH1), 0x2,
uint8_t(Instruction::PUSH1), 0x3,
@ -381,21 +395,22 @@ BOOST_AUTO_TEST_CASE(arithmetic)
uint8_t(Instruction::DUP2),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::PUSH1), 0x1d,
uint8_t(Instruction::JUMPI),
uint8_t(Instruction::INVALID),
uint8_t(Instruction::PUSH1), 0x4a,
uint8_t(Instruction::JUMPI)
} + panic + bytes{
uint8_t(Instruction::JUMPDEST),
uint8_t(Instruction::MOD),
uint8_t(Instruction::DUP2),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::ISZERO),
uint8_t(Instruction::PUSH1), 0x26,
uint8_t(Instruction::JUMPI),
uint8_t(Instruction::INVALID),
uint8_t(Instruction::PUSH1), 0x80,
uint8_t(Instruction::JUMPI)
} + panic + bytes{
uint8_t(Instruction::JUMPDEST),
uint8_t(Instruction::DIV),
uint8_t(Instruction::MUL)
};
BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
}

View File

@ -21,6 +21,6 @@ contract C {
// ====
// compileViaYul: also
// ----
// f(uint256): 0 -> FAILURE
// g(uint256): 0 -> FAILURE
// f(uint256): 0 -> FAILURE, hex"4e487b71", 0x12
// g(uint256): 0 -> FAILURE, hex"4e487b71", 0x12
// h() -> 2

View File

@ -14,5 +14,5 @@ contract D {
}
}
// ----
// f() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x11
// g(), 100 wei -> 1

View File

@ -10,4 +10,4 @@ contract C {
// f(uint16,uint16): 65534, 0 -> 0xfffe
// f(uint16,uint16): 65536, 0 -> 0x00
// f(uint16,uint16): 65535, 0 -> 0xffff
// f(uint16,uint16): 65535, 1 -> FAILURE
// f(uint16,uint16): 65535, 1 -> FAILURE, hex"4e487b71", 0x11

View File

@ -10,5 +10,5 @@ contract C {
// ====
// compileViaYul: also
// ----
// f(uint16,uint16,uint16): 0xe000, 0xe500, 2 -> FAILURE
// f(uint16,uint16,uint16): 0xe000, 0xe500, 2 -> FAILURE, hex"4e487b71", 0x11
// f(uint16,uint16,uint16): 0xe000, 0x1000, 0x1000 -> 0x00

View File

@ -12,4 +12,4 @@ contract C {
// compileViaYul: also
// ----
// f(uint16,uint16,uint16): 0xe000, 0xe500, 2 -> 58626
// f(uint16,uint16,uint16): 0x1000, 0xe500, 0xe000 -> FAILURE
// f(uint16,uint16,uint16): 0x1000, 0xe500, 0xe000 -> FAILURE, hex"4e487b71", 0x11

View File

@ -11,6 +11,6 @@ contract C {
// compileViaYul: also
// ----
// div(uint256,uint256): 7, 2 -> 3
// div(uint256,uint256): 7, 0 -> FAILURE # throws #
// div(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #
// mod(uint256,uint256): 7, 2 -> 1
// mod(uint256,uint256): 7, 0 -> FAILURE # throws #
// mod(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #

View File

@ -20,5 +20,5 @@ contract C {
// f(int256,int256): -7, 5 -> -2
// f(int256,int256): -7, 5 -> -2
// f(int256,int256): -5, -5 -> 0
// g(bool): true -> FAILURE
// g(bool): true -> FAILURE, hex"4e487b71", 0x11
// g(bool): false -> -57896044618658097711785492504343953926634992332820282019728792003956564819968

View File

@ -14,4 +14,4 @@ contract C {
// ----
// f(uint16): 7 -> 0x0207
// f(uint16): 0xffff -> 511
// f(uint16): 0xfeff -> FAILURE
// f(uint16): 0xfeff -> FAILURE, hex"4e487b71", 0x11

View File

@ -17,6 +17,6 @@ contract C {
// compileViaYul: also
// ----
// div(uint256,uint256): 7, 2 -> 3
// div(uint256,uint256): 7, 0 -> FAILURE # throws #
// div(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #
// mod(uint256,uint256): 7, 2 -> 1
// mod(uint256,uint256): 7, 0 -> FAILURE # throws #
// mod(uint256,uint256): 7, 0 -> FAILURE, hex"4e487b71", 0x12 # throws #

View File

@ -9,4 +9,4 @@ contract c {
// ====
// compileViaYul: also
// ----
// test() -> FAILURE
// test() -> FAILURE, hex"4e487b71", 0x31

View File

@ -12,4 +12,4 @@ contract c {
// ====
// compileViaYul: also
// ----
// test() -> FAILURE
// test() -> FAILURE, hex"4e487b71", 0x31

View File

@ -24,23 +24,23 @@ contract C {
// f(uint256[],uint256,uint256): 0x80, -1, 0, 0, 1, 42 -> FAILURE
// f(uint256[],uint256,uint256): 0x80, -1, -1, 0, 1, 42 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 0, 1, 42 -> 42, 42, 42
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 1, 1, 42 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 0, 0, 1, 42 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 1, 0, 1, 42 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 1, 1, 42 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 0, 0, 1, 42 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 1, 0, 1, 42 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 5, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4201, 0x4201, 0x4201
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 5, 4, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4205, 0x4205, 0x4205
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 5, 5, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 5, 5, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 5, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4202, 0x4202, 0x4202
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 5, 3, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4205, 0x4205, 0x4205
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 5, 4, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 5, 4, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 4, 5, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4205, 0x4205, 0x4205
// g(uint256[],uint256,uint256,uint256): 0x80, 4, 5, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 5, 5, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 4, 5, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 5, 5, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4201, 0x4201, 0x4201
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4201, 0x4201, 0x4201
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 0, 1, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 2, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4202, 0x4202, 0x4202
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 2, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 1, 2, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32
// g(uint256[],uint256,uint256,uint256): 0x80, 4, 5, 0, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> 0x4205, 0x4205, 0x4205
// g(uint256[],uint256,uint256,uint256): 0x80, 4, 5, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 4, 5, 1, 5, 0x4201, 0x4202, 0x4203, 0x4204, 0x4205 -> FAILURE, hex"4e487b71", 0x32

View File

@ -19,4 +19,4 @@ contract C {
// ----
// one() -> 3
// two() -> FAILURE
// two() -> FAILURE, hex"4e487b71", 0x51

View File

@ -22,5 +22,5 @@ contract C {
// ====
// compileViaYul: also
// ----
// f() -> FAILURE
// g() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x41
// g() -> FAILURE, hex"4e487b71", 0x41

View File

@ -24,11 +24,11 @@ contract c {
// compileViaYul: also
// ----
// length() -> 0
// get(uint256): 3 -> FAILURE
// get(uint256): 3 -> FAILURE, hex"4e487b71", 0x32
// enlarge(uint256): 4 -> 4
// length() -> 4
// set(uint256,uint256): 3, 4 -> true
// get(uint256): 3 -> 4
// length() -> 4
// set(uint256,uint256): 4, 8 -> FAILURE
// set(uint256,uint256): 4, 8 -> FAILURE, hex"4e487b71", 0x32
// length() -> 4

View File

@ -16,5 +16,5 @@ contract A {
// compileViaYul: also
// ----
// test() -> false
// testIt() -> FAILURE
// testIt() -> FAILURE, hex"4e487b71", 0x32
// test() -> false

View File

@ -20,9 +20,9 @@ contract c {
// ----
// length() -> 4
// set(uint256,uint256): 3, 4 -> true
// set(uint256,uint256): 4, 5 -> FAILURE
// set(uint256,uint256): 400, 5 -> FAILURE
// set(uint256,uint256): 4, 5 -> FAILURE, hex"4e487b71", 0x32
// set(uint256,uint256): 400, 5 -> FAILURE, hex"4e487b71", 0x32
// get(uint256): 3 -> 4
// get(uint256): 4 -> FAILURE
// get(uint256): 400 -> FAILURE
// get(uint256): 4 -> FAILURE, hex"4e487b71", 0x32
// get(uint256): 400 -> FAILURE, hex"4e487b71", 0x32
// length() -> 4

View File

@ -38,4 +38,4 @@ contract C {
// test(uint256,uint256): 10, 2 -> 13
// test(uint256,uint256): 10, 3 -> 15
// test(uint256,uint256): 10, 4 -> 18
// test(uint256,uint256): 10, 5 -> FAILURE
// test(uint256,uint256): 10, 5 -> FAILURE, hex"4e487b71", 0x51

View File

@ -23,9 +23,10 @@ contract test {
// ====
// compileViaYul: also
// EVMVersion: >=byzantium
// ----
// getChoiceExp(uint256): 3 -> FAILURE # These should throw #
// getChoiceFromSigned(int256): -1 -> FAILURE
// getChoiceFromNegativeLiteral() -> FAILURE
// getChoiceExp(uint256): 3 -> FAILURE, hex"4e487b71", 33 # These should throw #
// getChoiceFromSigned(int256): -1 -> FAILURE, hex"4e487b71", 33
// getChoiceFromNegativeLiteral() -> FAILURE, hex"4e487b71", 33
// getChoiceExp(uint256): 2 -> 2 # These should work #
// getChoiceExp(uint256): 0 -> 0

View File

@ -14,5 +14,5 @@ contract C {
// ====
// compileViaYul: also
// ----
// intern() -> FAILURE # This should throw exceptions #
// intern() -> FAILURE, hex"4e487b71", 0x51 # This should throw exceptions #
// extern() -> FAILURE

View File

@ -17,4 +17,4 @@ contract C {
}
// ----
// t() -> FAILURE
// t() -> FAILURE, hex"4e487b71", 0x51

View File

@ -18,4 +18,4 @@ contract C {
// ====
// compileViaYul: also
// ----
// t() -> FAILURE
// t() -> FAILURE, hex"4e487b71", 0x51

View File

@ -22,17 +22,17 @@ contract C {
}
}
// ====
// compileViaYul: also
// EVMVersion: >=byzantium
// compileViaYul: also
// ----
// get() -> 0x00
// assert0_delegated() -> 0x01, 0x40, 0x0
// get_delegated() -> 0x01, 0x40, 0x20, 0x0
// set(uint256): 0x01 ->
// get() -> 0x01
// assert0_delegated() -> 0x00, 0x40, 0x0
// assert0_delegated() -> 0x00, 0x40, 0x24, 0x4e487b7100000000000000000000000000000000000000000000000000000000, 0x0100000000000000000000000000000000000000000000000000000000
// get_delegated() -> 0x01, 0x40, 0x20, 0x1
// set(uint256): 0x2a ->
// get() -> 0x2a
// assert0_delegated() -> 0x00, 0x40, 0x0
// assert0_delegated() -> 0x00, 0x40, 0x24, 0x4e487b7100000000000000000000000000000000000000000000000000000000, 0x0100000000000000000000000000000000000000000000000000000000
// get_delegated() -> 0x01, 0x40, 0x20, 0x2a

View File

@ -8,4 +8,4 @@ contract test {
// ----
// f() ->
// g() -> FAILURE
// h() -> FAILURE
// h() -> FAILURE, hex"4e487b71", 0x01

View File

@ -13,4 +13,4 @@ contract C {
// ====
// compileViaYul: also
// ----
// test() -> FAILURE
// test() -> FAILURE, hex"4e487b71", 0x51

View File

@ -24,4 +24,4 @@ contract C {
// set() -> 7
// ca() -> 7
// d() -> 1
// ca() -> FAILURE
// ca() -> FAILURE, hex"4e487b71", 0x51

View File

@ -8,4 +8,4 @@ contract Test {
}
// ----
// f() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x51

View File

@ -16,6 +16,6 @@ contract C {
// ----
// g() -> 2
// h() -> FAILURE
// h() -> FAILURE, hex"4e487b71", 0x51
// set() ->
// h() -> 2

View File

@ -51,6 +51,6 @@ contract C {
// j(uint256): 1 -> 1
// j(uint256): 2 -> 4
// j(uint256): 4 -> 16
// k(uint256): 1 -> FAILURE
// k(uint256): 2 -> FAILURE
// k(uint256): 4 -> FAILURE
// k(uint256): 1 -> FAILURE, hex"4e487b71", 0x01
// k(uint256): 2 -> FAILURE, hex"4e487b71", 0x01
// k(uint256): 4 -> FAILURE, hex"4e487b71", 0x01

View File

@ -17,8 +17,8 @@ contract C {
// ====
// compileViaYul: also
// ----
// f() -> FAILURE
// g(bool): false -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x01
// g(bool): false -> FAILURE, hex"4e487b71", 0x01
// g(bool): true -> true
// h(bool): false -> FAILURE
// h(bool): true -> true

View File

@ -16,6 +16,7 @@ contract C {
}
}
// ====
// EVMVersion: >=byzantium
// compileViaYul: also
// ----
// test() -> FAILURE # should throw #
// test() -> FAILURE, hex"4e487b71", 33 # should throw #

View File

@ -26,7 +26,8 @@ contract C {
// ====
// compileViaYul: also
// EVMVersion: >=byzantium
// ----
// test_return() -> FAILURE # both should throw #
// test_inline_assignment() -> FAILURE
// test_assignment() -> FAILURE
// test_return() -> FAILURE, hex"4e487b71", 33 # both should throw #
// test_inline_assignment() -> FAILURE, hex"4e487b71", 33
// test_assignment() -> FAILURE, hex"4e487b71", 33

View File

@ -24,7 +24,8 @@ contract C {
}
// ====
// compileViaYul: also
// EVMVersion: >=byzantium
// ----
// test_eq_ok() -> 1
// test_eq() -> FAILURE # both should throw #
// test_neq() -> FAILURE
// test_eq() -> FAILURE, hex"4e487b71", 33 # both should throw #
// test_neq() -> FAILURE, hex"4e487b71", 33

View File

@ -16,8 +16,9 @@ contract C {
return 1;
}
}
// ====
// EVMVersion: >=byzantium
// ----
// test_store_ok() -> 1
// x() -> 0
// test_store() -> FAILURE # should throw #
// test_store() -> FAILURE, hex"4e487b71", 33 # should throw #

View File

@ -14,12 +14,12 @@ contract C {
}
}
// ====
// compileViaYul: also
// EVMVersion: >homestead
// allowNonExistingFunctions: true
// compileViaYul: also
// ----
// _() -> FAILURE
// e() -> FAILURE, hex"08c379a0", 0x20, 19, "Transaction failed."
// f(bool): false -> FAILURE, hex"08c379a0", 0x20, 0
// g(bool): false -> FAILURE, hex"08c379a0", 0x20, 15, "Value is false."
// h() -> FAILURE
// e() -> FAILURE, hex"08c379a0", 0x20, 0x13, "Transaction failed."
// f(bool): false -> FAILURE, hex"08c379a0", 0x20, 0x00
// g(bool): false -> FAILURE, hex"08c379a0", 0x20, 0x0f, "Value is false."
// h() -> FAILURE, hex"4e487b71", 0x01

View File

@ -9,22 +9,24 @@ contract test {
}
}
// ====
// compileViaYul: also
// EVMVersion: >=byzantium
// ABIEncoderV1Only: true
// compileViaYul: false
// ----
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0
// get(uint8): 0x02 -> 0
// get(uint8): 0x03 -> FAILURE
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0x03 -> FAILURE, hex"4e487b71", 33
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x01, 0xa1 ->
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x00, 0xef ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x01, 0x05 ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0x05
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33

View File

@ -10,31 +10,32 @@ contract test {
}
// ====
// ABIEncoderV1Only: true
// EVMVersion: >=byzantium
// ----
// table(uint8): 0 -> 0
// table(uint8): 0x01 -> 0
// table(uint8): 0xa7 -> 0
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x01, 0xa1 ->
// table(uint8): 0 -> 0
// table(uint8): 0x01 -> 0xa1
// table(uint8): 0xa7 -> 0
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x00, 0xef ->
// table(uint8): 0 -> 0xef
// table(uint8): 0x01 -> 0xa1
// table(uint8): 0xa7 -> 0
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x01, 0x05 ->
// table(uint8): 0 -> 0xef
// table(uint8): 0x01 -> 0x05
// table(uint8): 0xa7 -> 0
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0x05
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33

View File

@ -16,20 +16,23 @@ contract test {
L.set(table, k, v);
}
}
// ====
// EVMVersion: >=byzantium
// ABIEncoderV1Only: true
// ----
// library: L
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x01, 0xa1 ->
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x00, 0xef ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33
// set(uint8,uint8): 0x01, 0x05 ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0x05
// get(uint8): 0xa7 -> FAILURE
// get(uint8): 0xa7 -> FAILURE, hex"4e487b71", 33

View File

@ -0,0 +1,39 @@
pragma experimental ABIEncoderV2;
enum E { A, B, C }
library L {
function get(mapping(E => uint8) storage table, E k) external returns (uint8) {
return table[k];
}
function set(mapping(E => uint8) storage table, E k, uint8 v) external {
table[k] = v;
}
}
contract test {
mapping(E => uint8) table;
function get(E k) public returns (uint8 v) {
return L.get(table, k);
}
function set(E k, uint8 v) public {
L.set(table, k, v);
}
}
// ====
// EVMVersion: >=byzantium
// ----
// library: L
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x01, 0xa1 ->
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x00, 0xef ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x01, 0x05 ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0x05
// get(uint8): 0xa7 -> FAILURE

View File

@ -0,0 +1,32 @@
pragma experimental ABIEncoderV2;
enum E { A, B, C }
contract test {
mapping(E => uint8) table;
function get(E k) public returns (uint8 v) {
return table[k];
}
function set(E k, uint8 v) public {
table[k] = v;
}
}
// ====
// compileViaYul: also
// EVMVersion: >=byzantium
// ----
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0
// get(uint8): 0x02 -> 0
// get(uint8): 0x03 -> FAILURE
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x01, 0xa1 ->
// get(uint8): 0 -> 0
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x00, 0xef ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0xa1
// get(uint8): 0xa7 -> FAILURE
// set(uint8,uint8): 0x01, 0x05 ->
// get(uint8): 0 -> 0xef
// get(uint8): 0x01 -> 0x05
// get(uint8): 0xa7 -> FAILURE

View File

@ -20,4 +20,4 @@ contract Test {
}
}
// ----
// f() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x51

View File

@ -20,4 +20,4 @@ contract Test {
}
}
// ----
// f() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x51

View File

@ -36,4 +36,4 @@ contract InvalidTest {
}
}
// ----
// run() -> FAILURE
// run() -> FAILURE, hex"4e487b71", 0x51

View File

@ -15,5 +15,5 @@ contract InvalidTest {
}
}
// ----
// f() -> FAILURE
// f() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x51
// f() -> FAILURE, hex"4e487b71", 0x51

View File

@ -20,5 +20,5 @@ contract C {
// ----
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 0, 0, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 3, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 3, 3, 32, "01234567890123456789012345678901" -> FAILURE
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 5, 32, "01234567890123456789012345678901" -> FAILURE
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 3, 3, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
// set(string,uint256,uint256,uint256,uint256): 0xa0, 2, 4, 1, 5, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32

View File

@ -18,5 +18,5 @@ contract C {
// ----
// set(string,uint256,uint256): 0x60, 2, 0, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256): 0x60, 2, 1, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256): 0x60, 2, 2, 32, "01234567890123456789012345678901" -> FAILURE
// set(string,uint256,uint256): 0x60, 2, 2, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32
// set(string,uint256,uint256): 0x60, 200, 199, 32, "01234567890123456789012345678901" -> 0

View File

@ -19,4 +19,4 @@ contract C {
// set(string,uint256,uint256): 0x60, 5, 0, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256): 0x60, 5, 1, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256): 0x60, 5, 4, 32, "01234567890123456789012345678901" -> 0
// set(string,uint256,uint256): 0x60, 5, 5, 32, "01234567890123456789012345678901" -> FAILURE
// set(string,uint256,uint256): 0x60, 5, 5, 32, "01234567890123456789012345678901" -> FAILURE, hex"4e487b71", 0x32

View File

@ -20,7 +20,7 @@ contract C {
// ====
// compileViaYul: true
// ----
// test(uint256,uint256): 0,0 -> FAILURE
// test(uint256,uint256): 1,0 -> 1
// test(uint256,uint256): 10,5 -> 6
// test(uint256,uint256): 10,50 -> FAILURE
// test(uint256,uint256): 0, 0 -> FAILURE, hex"4e487b71", 0x32
// test(uint256,uint256): 1, 0 -> 1
// test(uint256,uint256): 10, 5 -> 6
// test(uint256,uint256): 10, 50 -> FAILURE, hex"4e487b71", 0x32

View File

@ -28,8 +28,8 @@ contract C {
// index(uint256): 10 -> true
// index(uint256): 20 -> true
// index(uint256): 0xFF -> true
// accessIndex(uint256,int256): 10,1 -> 2
// accessIndex(uint256,int256): 10,0 -> 1
// accessIndex(uint256,int256): 10,11 -> FAILURE
// accessIndex(uint256,int256): 10,10 -> FAILURE
// accessIndex(uint256,int256): 10,-1 -> FAILURE
// accessIndex(uint256,int256): 10, 1 -> 2
// accessIndex(uint256,int256): 10, 0 -> 1
// accessIndex(uint256,int256): 10, 11 -> FAILURE, hex"4e487b71", 0x32
// accessIndex(uint256,int256): 10, 10 -> FAILURE, hex"4e487b71", 0x32
// accessIndex(uint256,int256): 10, -1 -> FAILURE, hex"4e487b71", 0x32

View File

@ -17,9 +17,9 @@ contract C {
// test(uint256): 42 ->
// getLength() -> 1
// fetch(uint256): 0 -> 42
// fetch(uint256): 1 -> FAILURE
// fetch(uint256): 1 -> FAILURE, hex"4e487b71", 0x32
// test(uint256): 23 ->
// getLength() -> 2
// fetch(uint256): 0 -> 42
// fetch(uint256): 1 -> 23
// fetch(uint256): 2 -> FAILURE
// fetch(uint256): 2 -> FAILURE, hex"4e487b71", 0x32

View File

@ -17,9 +17,9 @@ contract C {
// test(uint256): 42 ->
// getLength() -> 1
// fetch(uint256): 0 -> 42
// fetch(uint256): 1 -> FAILURE
// fetch(uint256): 1 -> FAILURE, hex"4e487b71", 0x32
// test(uint256): 23 ->
// getLength() -> 2
// fetch(uint256): 0 -> 42
// fetch(uint256): 1 -> 23
// fetch(uint256): 2 -> FAILURE
// fetch(uint256): 2 -> FAILURE, hex"4e487b71", 0x32

View File

@ -12,12 +12,12 @@ contract C {
// ====
// compileViaYul: true
// ----
// test_boundary_check(uint256, uint256): 10, 11 -> FAILURE
// test_boundary_check(uint256, uint256): 10, 9 -> 0
// test_boundary_check(uint256, uint256): 1, 9 -> FAILURE
// test_boundary_check(uint256, uint256): 1, 1 -> FAILURE
// test_boundary_check(uint256, uint256): 10, 10 -> FAILURE
// test_boundary_check(uint256, uint256): 256, 256 -> FAILURE
// test_boundary_check(uint256, uint256): 256, 255 -> 0
// test_boundary_check(uint256, uint256): 256, 0xFFFF -> FAILURE
// test_boundary_check(uint256, uint256): 256, 2 -> 0
// test_boundary_check(uint256,uint256): 10, 11 -> FAILURE, hex"4e487b71", 0x32
// test_boundary_check(uint256,uint256): 10, 9 -> 0
// test_boundary_check(uint256,uint256): 1, 9 -> FAILURE, hex"4e487b71", 0x32
// test_boundary_check(uint256,uint256): 1, 1 -> FAILURE, hex"4e487b71", 0x32
// test_boundary_check(uint256,uint256): 10, 10 -> FAILURE, hex"4e487b71", 0x32
// test_boundary_check(uint256,uint256): 256, 256 -> FAILURE, hex"4e487b71", 0x32
// test_boundary_check(uint256,uint256): 256, 255 -> 0
// test_boundary_check(uint256,uint256): 256, 0xFFFF -> FAILURE, hex"4e487b71", 0x32
// test_boundary_check(uint256,uint256): 256, 2 -> 0

View File

@ -8,4 +8,4 @@ contract C {
// EVMVersion: >=petersburg
// compileViaYul: true
// ----
// popEmpty() -> FAILURE
// popEmpty() -> FAILURE, hex"4e487b71", 0x31

View File

@ -17,6 +17,6 @@ contract C {
// compileViaYul: true
// ----
// f(bool): true -> true
// f(bool): false -> FAILURE
// fail() -> FAILURE
// f(bool): false -> FAILURE, hex"4e487b71", 0x01
// fail() -> FAILURE, hex"4e487b71", 0x01
// succeed() -> true

View File

@ -14,6 +14,6 @@ contract C {
// compileViaYul: true
// ----
// f(bool): true -> true
// f(bool): false -> FAILURE
// f(bool): false -> FAILURE, hex"4e487b71", 0x01
// f2(bool): true -> true
// f2(bool): false -> FAILURE

View File

@ -10,11 +10,11 @@ contract C {
// ====
// compileViaYul: also
// ----
// f(uint256[],uint256): 0x40, 0, 0 -> FAILURE
// f(uint256[],uint256): 0x40, 0, 0 -> FAILURE, hex"4e487b71", 0x32
// f(uint256[],uint256): 0x40, 0, 1, 23 -> 23
// f(uint256[],uint256): 0x40, 1, 1, 23 -> FAILURE
// f(uint256[],uint256): 0x40, 1, 1, 23 -> FAILURE, hex"4e487b71", 0x32
// f(uint256[],uint256): 0x40, 0, 2, 23, 42 -> 23
// f(uint256[],uint256): 0x40, 1, 2, 23, 42 -> 42
// f(uint256[],uint256): 0x40, 2, 2, 23, 42 -> FAILURE
// f(uint256[],uint256): 0x40, 2, 2, 23, 42 -> FAILURE, hex"4e487b71", 0x32
// f(uint256[][],uint256,uint256): 0x60, 0, 0 -> FAILURE
// f(uint256[][],uint256,uint256): 0x60, 0, 0, 1, 0x20, 1, 23 -> 23

View File

@ -40,6 +40,6 @@ contract C {
// f_e_only(uint256[],uint256): 0x40, 3, 5, 1, 2, 3, 4, 5 -> 3
// f_e_only(uint256[],uint256): 0x40, 6, 5, 1, 2, 3, 4, 5 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 2, 4, 1, 5, 1, 2, 3, 4, 5 -> 4
// g(uint256[],uint256,uint256,uint256): 0x80, 2, 4, 3, 5, 1, 2, 3, 4, 5 -> FAILURE
// g(uint256[],uint256,uint256,uint256): 0x80, 2, 4, 3, 5, 1, 2, 3, 4, 5 -> FAILURE, hex"4e487b71", 0x32
// gg(uint256[],uint256,uint256,uint256): 0x80, 2, 4, 1, 5, 1, 2, 3, 4, 5 -> 4
// gg(uint256[],uint256,uint256,uint256): 0x80, 2, 4, 3, 5, 1, 2, 3, 4, 5 -> FAILURE
// gg(uint256[],uint256,uint256,uint256): 0x80, 2, 4, 3, 5, 1, 2, 3, 4, 5 -> FAILURE, hex"4e487b71", 0x32

View File

@ -15,6 +15,6 @@ contract C {
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 1, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> 1, 2, 1, 23
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 1, 0, 1, 0x20, 0x40, 0x80, 1, 42, 2, 23, 17 -> 1, 2, 2, 23
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 1, 1, 1, 0x20, 0x40, 0x80, 1, 42, 2, 23, 17 -> 1, 2, 2, 17
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 1, 0, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> FAILURE
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 2, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> FAILURE
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 2, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> FAILURE
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 1, 0, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> FAILURE, hex"4e487b71", 0x32
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 2, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> FAILURE, hex"4e487b71", 0x32
// f(uint256[][2][],uint256,uint256,uint256): 0x80, 0, 2, 0, 1, 0x20, 0x40, 0x80, 1, 42, 1, 23 -> FAILURE, hex"4e487b71", 0x32

View File

@ -9,4 +9,4 @@ contract C {
// ----
// f(bytes[],uint256): 0x40, 0, 1, 0x20, 2, hex"6162" -> 0x61
// f(bytes[],uint256): 0x40, 1, 1, 0x20, 2, hex"6162" -> 0x62
// f(bytes[],uint256): 0x40, 2, 1, 0x20, 2, hex"6162" -> FAILURE
// f(bytes[],uint256): 0x40, 2, 1, 0x20, 2, hex"6162" -> FAILURE, hex"4e487b71", 0x32

View File

@ -60,6 +60,6 @@ contract C {
// mod() -> 1, 0
// inc_pre() -> 1
// inc_post() -> 0
// dec_pre() -> FAILURE
// dec_post() -> FAILURE
// neg() -> FAILURE
// dec_pre() -> FAILURE, hex"4e487b71", 0x11
// dec_post() -> FAILURE, hex"4e487b71", 0x11
// neg() -> FAILURE, hex"4e487b71", 0x11

View File

@ -21,5 +21,5 @@ contract C {
// ====
// compileViaYul: true
// ----
// call_deleted_internal_func() -> FAILURE
// call_deleted_internal_func() -> FAILURE, hex"4e487b71", 0x51
// call_internal_func() -> true

View File

@ -11,8 +11,8 @@ contract C {
// ----
// f(uint256,uint256): 5, 6 -> 11
// f(uint256,uint256): -2, 1 -> -1
// f(uint256,uint256): -2, 2 -> FAILURE
// f(uint256,uint256): 2, -2 -> FAILURE
// f(uint256,uint256): -2, 2 -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): 2, -2 -> FAILURE, hex"4e487b71", 0x11
// g(uint8,uint8): 128, 64 -> 192
// g(uint8,uint8): 128, 127 -> 255
// g(uint8,uint8): 128, 128 -> FAILURE
// g(uint8,uint8): 128, 128 -> FAILURE, hex"4e487b71", 0x11

View File

@ -16,12 +16,12 @@ contract C {
// f(int256,int256): -5, -6 -> -11
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0, 0x0F -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
// f(int256,int256): 0x0F, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 -> FAILURE
// f(int256,int256): 1, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 1, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000001, -1 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): -1, 0x8000000000000000000000000000000000000000000000000000000000000001 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000000, -1 -> FAILURE
// f(int256,int256): -1, 0x8000000000000000000000000000000000000000000000000000000000000000 -> FAILURE
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000000, -1 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): -1, 0x8000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): 5, 6 -> 11
// g(int8,int8): -2, 1 -> -1
// g(int8,int8): -2, 2 -> 0
@ -29,9 +29,9 @@ contract C {
// g(int8,int8): -5, -6 -> -11
// g(int8,int8): 126, 1 -> 127
// g(int8,int8): 1, 126 -> 127
// g(int8,int8): 127, 1 -> FAILURE
// g(int8,int8): 1, 127 -> FAILURE
// g(int8,int8): 127, 1 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): 1, 127 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -127, -1 -> -128
// g(int8,int8): -1, -127 -> -128
// g(int8,int8): -127, -2 -> FAILURE
// g(int8,int8): -2, -127 -> FAILURE
// g(int8,int8): -127, -2 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -2, -127 -> FAILURE, hex"4e487b71", 0x11

View File

@ -13,15 +13,15 @@ contract C {
// compileViaYul: also
// ----
// f(uint256,uint256): 10, 3 -> 3
// f(uint256,uint256): 1, 0 -> FAILURE
// f(uint256,uint256): 0, 0 -> FAILURE
// f(uint256,uint256): 1, 0 -> FAILURE, hex"4e487b71", 0x12
// f(uint256,uint256): 0, 0 -> FAILURE, hex"4e487b71", 0x12
// f(uint256,uint256): 0, 1 -> 0
// g(int8,int8): -10, 3 -> -3
// g(int8,int8): -10, -3 -> 3
// g(int8,int8): -10, 0 -> FAILURE
// g(int8,int8): -10, 0 -> FAILURE, hex"4e487b71", 0x12
// g(int8,int8): -128, 1 -> -128
// g(int8,int8): -128, -2 -> 64
// g(int8,int8): -128, 2 -> -64
// g(int8,int8): -128, -1 -> FAILURE
// g(int8,int8): -128, -1 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -127, -1 -> 127
// h(uint256,uint256): 0x8000000000000000000000000000000000000000000000000000000000000000, -1 -> 0

View File

@ -13,13 +13,13 @@ contract C {
// f(uint256,uint256): 10, 2 -> 0
// f(uint256,uint256): 11, 2 -> 1
// f(uint256,uint256): 2, 2 -> 0
// f(uint256,uint256): 1, 0 -> FAILURE
// f(uint256,uint256): 0, 0 -> FAILURE
// f(uint256,uint256): 1, 0 -> FAILURE, hex"4e487b71", 0x12
// f(uint256,uint256): 0, 0 -> FAILURE, hex"4e487b71", 0x12
// f(uint256,uint256): 0, 1 -> 0
// g(uint8,uint8): 10, 3 -> 1
// g(uint8,uint8): 10, 2 -> 0
// g(uint8,uint8): 11, 2 -> 1
// g(uint8,uint8): 2, 2 -> 0
// g(uint8,uint8): 1, 0 -> FAILURE
// g(uint8,uint8): 0, 0 -> FAILURE
// g(uint8,uint8): 1, 0 -> FAILURE, hex"4e487b71", 0x12
// g(uint8,uint8): 0, 0 -> FAILURE, hex"4e487b71", 0x12
// g(uint8,uint8): 0, 1 -> 0

View File

@ -16,9 +16,9 @@ contract C {
// f(int256,int256): 10, -3 -> 1
// f(int256,int256): -10, -3 -> -1
// f(int256,int256): 2, 2 -> 0
// f(int256,int256): 1, 0 -> FAILURE
// f(int256,int256): -1, 0 -> FAILURE
// f(int256,int256): 0, 0 -> FAILURE
// f(int256,int256): 1, 0 -> FAILURE, hex"4e487b71", 0x12
// f(int256,int256): -1, 0 -> FAILURE, hex"4e487b71", 0x12
// f(int256,int256): 0, 0 -> FAILURE, hex"4e487b71", 0x12
// f(int256,int256): 0, 1 -> 0
// f(int256,int256): 0, -1 -> 0
// g(int8,int8): 10, 3 -> 1
@ -28,8 +28,8 @@ contract C {
// g(int8,int8): 10, -3 -> 1
// g(int8,int8): -10, -3 -> -1
// g(int8,int8): 2, 2 -> 0
// g(int8,int8): 1, 0 -> FAILURE
// g(int8,int8): -1, 0 -> FAILURE
// g(int8,int8): 0, 0 -> FAILURE
// g(int8,int8): 1, 0 -> FAILURE, hex"4e487b71", 0x12
// g(int8,int8): -1, 0 -> FAILURE, hex"4e487b71", 0x12
// g(int8,int8): 0, 0 -> FAILURE, hex"4e487b71", 0x12
// g(int8,int8): 0, 1 -> 0
// g(int8,int8): 0, -1 -> 0

View File

@ -11,27 +11,27 @@ contract C {
// ----
// f(uint256,uint256): 5, 6 -> 30
// f(uint256,uint256): -1, 1 -> -1
// f(uint256,uint256): -1, 2 -> FAILURE
// f(uint256,uint256): 0x8000000000000000000000000000000000000000000000000000000000000000, 2 -> FAILURE
// f(uint256,uint256): -1, 2 -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): 0x8000000000000000000000000000000000000000000000000000000000000000, 2 -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 2 -> -2
// f(uint256,uint256): 2, 0x8000000000000000000000000000000000000000000000000000000000000000 -> FAILURE
// f(uint256,uint256): 2, 0x8000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): 2, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> -2
// f(uint256,uint256): 0x0100000000000000000000000000000000, 0x0100000000000000000000000000000000 -> FAILURE
// f(uint256,uint256): 0x0100000000000000000000000000000000, 0x0100000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): 0x0100000000000000000000000000000000, 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
// f(uint256,uint256): 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x0100000000000000000000000000000000 -> 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
// f(uint256,uint256): 0x0100000000000000000000000000000001, 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> -1
// f(uint256,uint256): 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x0100000000000000000000000000000001 -> -1
// f(uint256,uint256): 0x0100000000000000000000000000000002, 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE
// f(uint256,uint256): 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x0100000000000000000000000000000002 -> FAILURE
// f(uint256,uint256): 0x0100000000000000000000000000000002, 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): 0x00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x0100000000000000000000000000000002 -> FAILURE, hex"4e487b71", 0x11
// f(uint256,uint256): -1, 0 -> 0
// f(uint256,uint256): 0, -1 -> 0
// g(uint8,uint8): 5, 6 -> 30
// g(uint8,uint8): 0x80, 2 -> FAILURE
// g(uint8,uint8): 0x80, 2 -> FAILURE, hex"4e487b71", 0x11
// g(uint8,uint8): 0x7F, 2 -> 254
// g(uint8,uint8): 2, 0x7F -> 254
// g(uint8,uint8): 0x10, 0x10 -> FAILURE
// g(uint8,uint8): 0x10, 0x10 -> FAILURE, hex"4e487b71", 0x11
// g(uint8,uint8): 0x0F, 0x11 -> 0xFF
// g(uint8,uint8): 0x0F, 0x12 -> FAILURE
// g(uint8,uint8): 0x12, 0x0F -> FAILURE
// g(uint8,uint8): 0x0F, 0x12 -> FAILURE, hex"4e487b71", 0x11
// g(uint8,uint8): 0x12, 0x0F -> FAILURE, hex"4e487b71", 0x11
// g(uint8,uint8): 0xFF, 0 -> 0
// g(uint8,uint8): 0, 0xFF -> 0

View File

@ -13,37 +13,51 @@ contract C {
// f(int256,int256): -1, 1 -> -1
// f(int256,int256): -1, 2 -> -2 # positive, positive #
// f(int256,int256): 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 2 -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
// f(int256,int256): 0x4000000000000000000000000000000000000000000000000000000000000000, 2 -> FAILURE
// f(int256,int256): 0x4000000000000000000000000000000000000000000000000000000000000000, 2 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 2, 0x3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
// f(int256,int256): 2, 0x4000000000000000000000000000000000000000000000000000000000000000 -> FAILURE # positive, negative #
// f(int256,int256): 2, 0x4000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11 # positive, negative #
// f(int256,int256): 2, 0x4000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11 # positive, negative #
// f(int256,int256): 2, 0x4000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11 # positive, negative #
// f(int256,int256): 0x4000000000000000000000000000000000000000000000000000000000000000, -2 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): 0x4000000000000000000000000000000000000000000000000000000000000001, -2 -> FAILURE
// f(int256,int256): 0x4000000000000000000000000000000000000000000000000000000000000001, -2 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 2, 0xC000000000000000000000000000000000000000000000000000000000000000 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): 2, 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE # negative, positive #
// f(int256,int256): 2, 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE, hex"4e487b71", 0x11 # negative, positive #
// f(int256,int256): 2, 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE, hex"4e487b71", 0x11 # negative, positive #
// f(int256,int256): 2, 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE, hex"4e487b71", 0x11 # negative, positive #
// f(int256,int256): -2, 0x4000000000000000000000000000000000000000000000000000000000000000 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): -2, 0x4000000000000000000000000000000000000000000000000000000000000001 -> FAILURE
// f(int256,int256): -2, 0x4000000000000000000000000000000000000000000000000000000000000001 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 0xC000000000000000000000000000000000000000000000000000000000000000, 2 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 2 -> FAILURE # negative, negative #
// f(int256,int256): 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 2 -> FAILURE, hex"4e487b71", 0x11 # negative, negative #
// f(int256,int256): 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 2 -> FAILURE, hex"4e487b71", 0x11 # negative, negative #
// f(int256,int256): 0xBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 2 -> FAILURE, hex"4e487b71", 0x11 # negative, negative #
// f(int256,int256): 0xC000000000000000000000000000000000000000000000000000000000000001, -2 -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
// f(int256,int256): 0xC000000000000000000000000000000000000000000000000000000000000000, -2 -> FAILURE
// f(int256,int256): 0xC000000000000000000000000000000000000000000000000000000000000000, -2 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): -2, 0xC000000000000000000000000000000000000000000000000000000000000001 -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
// f(int256,int256): -2, 0xC000000000000000000000000000000000000000000000000000000000000000 -> FAILURE # small type #
// f(int256,int256): -2, 0xC000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11 # small type #
// f(int256,int256): -2, 0xC000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11 # small type #
// f(int256,int256): -2, 0xC000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11 # small type #
// g(int8,int8): 5, 6 -> 30
// g(int8,int8): -1, 1 -> -1
// g(int8,int8): -1, 2 -> -2 # positive, positive #
// g(int8,int8): 63, 2 -> 126
// g(int8,int8): 64, 2 -> FAILURE
// g(int8,int8): 64, 2 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): 2, 63 -> 126
// g(int8,int8): 2, 64 -> FAILURE # positive, negative #
// g(int8,int8): 2, 64 -> FAILURE, hex"4e487b71", 0x11 # positive, negative #
// g(int8,int8): 2, 64 -> FAILURE, hex"4e487b71", 0x11 # positive, negative #
// g(int8,int8): 2, 64 -> FAILURE, hex"4e487b71", 0x11 # positive, negative #
// g(int8,int8): 64, -2 -> -128
// g(int8,int8): 65, -2 -> FAILURE
// g(int8,int8): 65, -2 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): 2, -64 -> -128
// g(int8,int8): 2, -65 -> FAILURE # negative, positive #
// g(int8,int8): 2, -65 -> FAILURE, hex"4e487b71", 0x11 # negative, positive #
// g(int8,int8): 2, -65 -> FAILURE, hex"4e487b71", 0x11 # negative, positive #
// g(int8,int8): 2, -65 -> FAILURE, hex"4e487b71", 0x11 # negative, positive #
// g(int8,int8): -2, 64 -> -128
// g(int8,int8): -2, 65 -> FAILURE
// g(int8,int8): -2, 65 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -64, 2 -> -128
// g(int8,int8): -65, 2 -> FAILURE # negative, negative #
// g(int8,int8): -65, 2 -> FAILURE, hex"4e487b71", 0x11 # negative, negative #
// g(int8,int8): -65, 2 -> FAILURE, hex"4e487b71", 0x11 # negative, negative #
// g(int8,int8): -65, 2 -> FAILURE, hex"4e487b71", 0x11 # negative, negative #
// g(int8,int8): -63, -2 -> 126
// g(int8,int8): -64, -2 -> FAILURE
// g(int8,int8): -64, -2 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -2, -63 -> 126
// g(int8,int8): -2, -64 -> FAILURE
// g(int8,int8): -2, -64 -> FAILURE, hex"4e487b71", 0x11

View File

@ -11,7 +11,7 @@ contract C {
// ----
// f(uint256,uint256): 6, 5 -> 1
// f(uint256,uint256): 6, 6 -> 0
// f(uint256,uint256): 5, 6 -> FAILURE
// f(uint256,uint256): 5, 6 -> FAILURE, hex"4e487b71", 0x11
// g(uint8,uint8): 6, 5 -> 1
// g(uint8,uint8): 6, 6 -> 0
// g(uint8,uint8): 5, 6 -> FAILURE
// g(uint8,uint8): 5, 6 -> FAILURE, hex"4e487b71", 0x11

View File

@ -16,16 +16,16 @@ contract C {
// f(int256,int256): 2, 2 -> 0
// f(int256,int256): -5, -6 -> 1
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0, -15 -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0, -16 -> FAILURE
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, -1 -> FAILURE
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0, -16 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, -1 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 15, 0x8000000000000000000000000000000000000000000000000000000000000010 -> 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
// f(int256,int256): 16, 0x8000000000000000000000000000000000000000000000000000000000000010 -> FAILURE
// f(int256,int256): 1, 0x8000000000000000000000000000000000000000000000000000000000000000 -> FAILURE
// f(int256,int256): 16, 0x8000000000000000000000000000000000000000000000000000000000000010 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 1, 0x8000000000000000000000000000000000000000000000000000000000000000 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): -1, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): -2, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE
// f(int256,int256): -2, 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000001, 1 -> 0x8000000000000000000000000000000000000000000000000000000000000000
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000001, 2 -> FAILURE
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000000, 1 -> FAILURE
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000001, 2 -> FAILURE, hex"4e487b71", 0x11
// f(int256,int256): 0x8000000000000000000000000000000000000000000000000000000000000000, 1 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): 5, 6 -> -1
// g(int8,int8): -2, 1 -> -3
// g(int8,int8): -2, 2 -> -4
@ -34,9 +34,9 @@ contract C {
// g(int8,int8): -5, -6 -> 1
// g(int8,int8): 126, -1 -> 127
// g(int8,int8): 1, -126 -> 127
// g(int8,int8): 127, -1 -> FAILURE
// g(int8,int8): 1, -127 -> FAILURE
// g(int8,int8): 127, -1 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): 1, -127 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -127, 1 -> -128
// g(int8,int8): -1, 127 -> -128
// g(int8,int8): -127, 2 -> FAILURE
// g(int8,int8): -2, 127 -> FAILURE
// g(int8,int8): -127, 2 -> FAILURE, hex"4e487b71", 0x11
// g(int8,int8): -2, 127 -> FAILURE, hex"4e487b71", 0x11

View File

@ -99,6 +99,6 @@ contract ERC20 {
// totalSupply() -> 20
// transfer(address,uint256): 2, 5 -> true
// decreaseAllowance(address,uint256): 2, 0 -> true
// decreaseAllowance(address,uint256): 2, 1 -> FAILURE
// decreaseAllowance(address,uint256): 2, 1 -> FAILURE, hex"4e487b71", 0x11
// transfer(address,uint256): 2, 14 -> true
// transfer(address,uint256): 2, 2 -> FAILURE
// transfer(address,uint256): 2, 2 -> FAILURE, hex"4e487b71", 0x11

View File

@ -32,18 +32,18 @@ contract C {
// compileViaYul: true
// ----
// exp_2(uint256): 255 -> 57896044618658097711785492504343953926634992332820282019728792003956564819968
// exp_2(uint256): 256 -> FAILURE
// exp_2(uint256): 256 -> FAILURE, hex"4e487b71", 0x11
// exp_minus_2(uint256): 255 -> -57896044618658097711785492504343953926634992332820282019728792003956564819968
// exp_minus_2(uint256): 256 -> FAILURE
// exp_minus_2(uint256): 256 -> FAILURE, hex"4e487b71", 0x11
// exp_uint_max(uint256): 1 -> 115792089237316195423570985008687907853269984665640564039457584007913129639935
// exp_uint_max(uint256): 2 -> FAILURE
// exp_uint_max(uint256): 2 -> FAILURE, hex"4e487b71", 0x11
// exp_int_max(uint256): 1 -> -57896044618658097711785492504343953926634992332820282019728792003956564819968
// exp_int_max(uint256): 2 -> FAILURE
// exp_int_max(uint256): 2 -> FAILURE, hex"4e487b71", 0x11
// exp_5(uint256): 110 -> 77037197775489434122239117703397092741524065928615527809597551822662353515625
// exp_5(uint256): 111 -> FAILURE
// exp_5(uint256): 111 -> FAILURE, hex"4e487b71", 0x11
// exp_minus_5(uint256): 109 -> -15407439555097886824447823540679418548304813185723105561919510364532470703125
// exp_minus_5(uint256): 110 -> FAILURE
// exp_minus_5(uint256): 110 -> FAILURE, hex"4e487b71", 0x11
// exp_256(uint256): 31 -> 452312848583266388373324160190187140051835877600158453279131187530910662656
// exp_256(uint256): 32 -> FAILURE
// exp_256(uint256): 32 -> FAILURE, hex"4e487b71", 0x11
// exp_minus_256(uint256): 31 -> -452312848583266388373324160190187140051835877600158453279131187530910662656
// exp_minus_256(uint256): 32 -> FAILURE
// exp_minus_256(uint256): 32 -> FAILURE, hex"4e487b71", 0x11

View File

@ -10,29 +10,29 @@ contract C {
// compileViaYul: also
// ----
// f(int8,uint256): 2, 6 -> 64
// f(int8,uint256): 2, 7 -> FAILURE
// f(int8,uint256): 2, 8 -> FAILURE
// f(int8,uint256): 2, 7 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): 2, 8 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -2, 6 -> 64
// f(int8,uint256): -2, 7 -> -128
// f(int8,uint256): -2, 8 -> FAILURE
// f(int8,uint256): 6, 3 -> FAILURE
// f(int8,uint256): -2, 8 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): 6, 3 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): 7, 2 -> 0x31
// f(int8,uint256): 7, 3 -> FAILURE
// f(int8,uint256): 7, 3 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -7, 2 -> 0x31
// f(int8,uint256): -7, 3 -> FAILURE
// f(int8,uint256): -7, 4 -> FAILURE
// f(int8,uint256): 127, 31 -> FAILURE
// f(int8,uint256): 127, 131 -> FAILURE
// f(int8,uint256): -7, 3 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -7, 4 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): 127, 31 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): 127, 131 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -128, 0 -> 1
// f(int8,uint256): -128, 1 -> -128
// f(int8,uint256): -128, 31 -> FAILURE
// f(int8,uint256): -128, 131 -> FAILURE
// f(int8,uint256): -128, 31 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -128, 131 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -11, 2 -> 121
// f(int8,uint256): -12, 2 -> FAILURE
// f(int8,uint256): 12, 2 -> FAILURE
// f(int8,uint256): -12, 2 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): 12, 2 -> FAILURE, hex"4e487b71", 0x11
// f(int8,uint256): -5, 3 -> -125
// f(int8,uint256): -6, 3 -> FAILURE
// f(int8,uint256): -6, 3 -> FAILURE, hex"4e487b71", 0x11
// g(int256,uint256): -7, 90 -> 11450477594321044359340126713545146077054004823284978858214566372120240027249
// g(int256,uint256): -7, 91 -> FAILURE
// g(int256,uint256): -7, 91 -> FAILURE, hex"4e487b71", 0x11
// g(int256,uint256): -63, 42 -> 3735107253208426854890677539053540390278853997836851167913009474475553834369
// g(int256,uint256): -63, 43 -> FAILURE
// g(int256,uint256): -63, 43 -> FAILURE, hex"4e487b71", 0x11

View File

@ -10,22 +10,22 @@ contract C {
// compileViaYul: also
// ----
// f(uint8,uint8): 2, 7 -> 0x80
// f(uint8,uint8): 2, 8 -> FAILURE
// f(uint8,uint8): 2, 8 -> FAILURE, hex"4e487b71", 0x11
// f(uint8,uint8): 15, 2 -> 225
// f(uint8,uint8): 6, 3 -> 0xd8
// f(uint8,uint8): 7, 2 -> 0x31
// f(uint8,uint8): 7, 3 -> FAILURE
// f(uint8,uint8): 7, 4 -> FAILURE
// f(uint8,uint8): 255, 31 -> FAILURE
// f(uint8,uint8): 255, 131 -> FAILURE
// f(uint8,uint8): 7, 3 -> FAILURE, hex"4e487b71", 0x11
// f(uint8,uint8): 7, 4 -> FAILURE, hex"4e487b71", 0x11
// f(uint8,uint8): 255, 31 -> FAILURE, hex"4e487b71", 0x11
// f(uint8,uint8): 255, 131 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 0x200000000000000000000000000000000, 1 -> 0x0200000000000000000000000000000000
// g(uint256,uint256): 0x100000000000000000000000000000010, 2 -> FAILURE
// g(uint256,uint256): 0x200000000000000000000000000000000, 2 -> FAILURE
// g(uint256,uint256): 0x200000000000000000000000000000000, 3 -> FAILURE
// g(uint256,uint256): 0x100000000000000000000000000000010, 2 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 0x200000000000000000000000000000000, 2 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 0x200000000000000000000000000000000, 3 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 255, 31 -> 400631961586894742455537928461950192806830589109049416147172451019287109375
// g(uint256,uint256): 255, 32 -> -13630939032658036097408813250890608687528184442832962921928608997994916749311
// g(uint256,uint256): 255, 33 -> FAILURE
// g(uint256,uint256): 255, 131 -> FAILURE
// g(uint256,uint256): 255, 33 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 255, 131 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 258, 31 -> 575719427506838823084316385994930914701079543089399988096291424922125729792
// g(uint256,uint256): 258, 37 -> FAILURE
// g(uint256,uint256): 258, 131 -> FAILURE
// g(uint256,uint256): 258, 37 -> FAILURE, hex"4e487b71", 0x11
// g(uint256,uint256): 258, 131 -> FAILURE, hex"4e487b71", 0x11

View File

@ -19,7 +19,7 @@ contract C {
// ====
// compileViaYul: also
// ----
// f() -> FAILURE
// f() -> FAILURE, hex"4e487b71", 0x51
// g() -> FAILURE
// h2() -> FAILURE
// h2() -> FAILURE, hex"4e487b71", 0x51
// k2() -> FAILURE

View File

@ -87,24 +87,24 @@ contract C {
// ----
// preincr_s8(int8): 128 -> FAILURE
// postincr_s8(int8): 128 -> FAILURE
// preincr_s8(int8): 127 -> FAILURE
// postincr_s8(int8): 127 -> FAILURE
// preincr_s8(int8): 127 -> FAILURE, hex"4e487b71", 0x11
// postincr_s8(int8): 127 -> FAILURE, hex"4e487b71", 0x11
// preincr_s8(int8): 126 -> 127, 127
// postincr_s8(int8): 126 -> 126, 127
// predecr_s8(int8): -128 -> FAILURE
// postdecr_s8(int8): -128 -> FAILURE
// predecr_s8(int8): -128 -> FAILURE, hex"4e487b71", 0x11
// postdecr_s8(int8): -128 -> FAILURE, hex"4e487b71", 0x11
// predecr_s8(int8): -127 -> -128, -128
// postdecr_s8(int8): -127 -> -127, -128
// preincr_s8(int8): -5 -> -4, -4
// postincr_s8(int8): -5 -> -5, -4
// predecr_s8(int8): -5 -> -6, -6
// postdecr_s8(int8): -5 -> -5, -6
// preincr_u8(uint8): 255 -> FAILURE
// postincr_u8(uint8): 255 -> FAILURE
// preincr_u8(uint8): 254 -> FAILURE
// postincr_u8(uint8): 254 -> FAILURE
// predecr_u8(uint8): 0 -> FAILURE
// postdecr_u8(uint8): 0 -> FAILURE
// preincr_u8(uint8): 255 -> FAILURE, hex"4e487b71", 0x11
// postincr_u8(uint8): 255 -> FAILURE, hex"4e487b71", 0x11
// preincr_u8(uint8): 254 -> FAILURE, hex"4e487b71", 0x11
// postincr_u8(uint8): 254 -> FAILURE, hex"4e487b71", 0x11
// predecr_u8(uint8): 0 -> FAILURE, hex"4e487b71", 0x11
// postdecr_u8(uint8): 0 -> FAILURE, hex"4e487b71", 0x11
// predecr_u8(uint8): 1 -> 0
// postdecr_u8(uint8): 1 -> 1
// preincr_u8(uint8): 2 -> 6
@ -123,14 +123,14 @@ contract C {
// bitnot(int256): -100 -> 99
// bitnot_u8(uint8): 100 -> 155
// bitnot_s8() -> 99
// negate(int256): -57896044618658097711785492504343953926634992332820282019728792003956564819968 -> FAILURE
// negate(int256): -57896044618658097711785492504343953926634992332820282019728792003956564819968 -> FAILURE, hex"4e487b71", 0x11
// negate(int256): -57896044618658097711785492504343953926634992332820282019728792003956564819967 -> 57896044618658097711785492504343953926634992332820282019728792003956564819967
// negate(int256): 0 -> 0
// negate(int256): 1 -> -1
// negate(int256): -1 -> 1
// negate_s8(int8): -128 -> FAILURE
// negate_s8(int8): -128 -> FAILURE, hex"4e487b71", 0x11
// negate_s8(int8): -138 -> FAILURE
// negate_s8(int8): -127 -> 127
// negate_s8(int8): 127 -> -127
// negate_s16(int16): -32768 -> FAILURE
// negate_s16(int16): -32768 -> FAILURE, hex"4e487b71", 0x11
// negate_s16(int16): -32767 -> 32767