2020-07-22 14:52:28 +00:00
|
|
|
contract C {
|
|
|
|
function f(int8 x, uint y) public returns (int) {
|
|
|
|
return x**y;
|
|
|
|
}
|
|
|
|
function g(int256 x, uint y) public returns (int) {
|
|
|
|
return x**y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
2020-09-15 14:16:30 +00:00
|
|
|
// compileViaYul: also
|
2021-04-23 15:59:01 +00:00
|
|
|
// compileToEwasm: also
|
2020-07-22 14:52:28 +00:00
|
|
|
// ----
|
|
|
|
// f(int8,uint256): 2, 6 -> 64
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(int8,uint256): 2, 7 -> FAILURE, hex"4e487b71", 0x11
|
|
|
|
// f(int8,uint256): 2, 8 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// f(int8,uint256): -2, 6 -> 64
|
|
|
|
// f(int8,uint256): -2, 7 -> -128
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(int8,uint256): -2, 8 -> FAILURE, hex"4e487b71", 0x11
|
|
|
|
// f(int8,uint256): 6, 3 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// f(int8,uint256): 7, 2 -> 0x31
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(int8,uint256): 7, 3 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// f(int8,uint256): -7, 2 -> 0x31
|
2020-10-13 11:28:39 +00:00
|
|
|
// 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
|
2020-07-22 14:52:28 +00:00
|
|
|
// f(int8,uint256): -128, 0 -> 1
|
|
|
|
// f(int8,uint256): -128, 1 -> -128
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(int8,uint256): -128, 31 -> FAILURE, hex"4e487b71", 0x11
|
|
|
|
// f(int8,uint256): -128, 131 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// f(int8,uint256): -11, 2 -> 121
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(int8,uint256): -12, 2 -> FAILURE, hex"4e487b71", 0x11
|
|
|
|
// f(int8,uint256): 12, 2 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// f(int8,uint256): -5, 3 -> -125
|
2020-10-13 11:28:39 +00:00
|
|
|
// f(int8,uint256): -6, 3 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// g(int256,uint256): -7, 90 -> 11450477594321044359340126713545146077054004823284978858214566372120240027249
|
2020-10-13 11:28:39 +00:00
|
|
|
// g(int256,uint256): -7, 91 -> FAILURE, hex"4e487b71", 0x11
|
2020-07-22 14:52:28 +00:00
|
|
|
// g(int256,uint256): -63, 42 -> 3735107253208426854890677539053540390278853997836851167913009474475553834369
|
2020-10-13 11:28:39 +00:00
|
|
|
// g(int256,uint256): -63, 43 -> FAILURE, hex"4e487b71", 0x11
|