mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into breaking
This commit is contained in:
@@ -39,7 +39,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0
|
||||
// g() -> 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract c {
|
||||
function test1(uint256[][] calldata c) external returns (uint256, uint256) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
|
||||
@@ -16,7 +16,6 @@ contract B {
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// testIt() ->
|
||||
// test() -> 2
|
||||
|
||||
@@ -8,7 +8,7 @@ contract B is A {
|
||||
uint public y = f();
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
|
||||
@@ -12,6 +12,6 @@ contract D {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> true
|
||||
|
||||
@@ -12,6 +12,6 @@ contract D {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 2
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
contract C {
|
||||
uint8 public a;
|
||||
uint16 public b;
|
||||
uint128 public c;
|
||||
uint public d;
|
||||
constructor() {
|
||||
a = 3;
|
||||
b = 4;
|
||||
c = 5;
|
||||
d = 6;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// a() -> 3
|
||||
// b() -> 4
|
||||
// c() -> 5
|
||||
// d() -> 6
|
||||
@@ -0,0 +1,14 @@
|
||||
contract C {
|
||||
string public a;
|
||||
string public b;
|
||||
bytes public c;
|
||||
constructor() {
|
||||
a = "hello world";
|
||||
b = hex"41424344";
|
||||
c = hex"ff077fff";
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// a() -> 0x20, 11, "hello world"
|
||||
// b() -> 0x20, 4, "ABCD"
|
||||
// c() -> 0x20, 4, -439061522557375173052089223601630338202760422010735733633791622124826263552
|
||||
@@ -0,0 +1,35 @@
|
||||
contract C {
|
||||
uint8 public a;
|
||||
uint16 public b;
|
||||
uint128 public c;
|
||||
uint public d;
|
||||
bytes1 public e;
|
||||
bytes20 public f;
|
||||
bytes32 public g;
|
||||
bool public h;
|
||||
address public i;
|
||||
constructor() {
|
||||
a = 3;
|
||||
b = 4;
|
||||
c = 5;
|
||||
d = 6;
|
||||
e = bytes1(uint8(0x7f));
|
||||
f = bytes20(uint160(0x64656164626565663135646561640000000000000010));
|
||||
g = bytes32(uint256(0x6465616462656566313564656164000000000000000000000000000000000010));
|
||||
h = true;
|
||||
i = address(type(uint160).max / 3);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileToEwasm: also
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// a() -> 3
|
||||
// b() -> 4
|
||||
// c() -> 5
|
||||
// d() -> 6
|
||||
// e() -> 0x7f00000000000000000000000000000000000000000000000000000000000000
|
||||
// f() -> 0x6164626565663135646561640000000000000010000000000000000000000000
|
||||
// g() -> 0x6465616462656566313564656164000000000000000000000000000000000010
|
||||
// h() -> true
|
||||
// i() -> 0x5555555555555555555555555555555555555555
|
||||
@@ -0,0 +1,10 @@
|
||||
pragma abicoder v1;
|
||||
contract C {
|
||||
function t(uint) public pure {}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=byzantium
|
||||
// compileViaYul: false
|
||||
// revertStrings: debug
|
||||
// ----
|
||||
// t(uint256) -> FAILURE, hex"08c379a0", 0x20, 0x12, "Calldata too short"
|
||||
@@ -0,0 +1,10 @@
|
||||
pragma abicoder v2;
|
||||
contract C {
|
||||
function t(uint) public pure {}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=byzantium
|
||||
// compileViaYul: false
|
||||
// revertStrings: debug
|
||||
// ----
|
||||
// t(uint256) -> FAILURE, hex"08c379a0", 0x20, 34, "ABI decoding: tuple data too sho", "rt"
|
||||
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
@@ -42,7 +42,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f((uint128, (uint128, uint256[][2], uint32)), uint32): 0x40, 44, 11, 0x40, 22, 0x60, 33, 0x40, 0x40, 2, 1, 2 -> 44, 22, 1, 2, 33
|
||||
// g(((uint128, uint256[][2], uint32)[2])): 0x20, 0x20, 0x40, 0x40, 22, 0x60, 33, 0x40, 0x40, 2, 1, 2 -> 22, 1, 2, 33
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
struct S {
|
||||
uint128 p1;
|
||||
@@ -23,7 +23,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// library: L
|
||||
// f((uint128, (uint128, uint256[][2], uint32)), uint32): 0x40, 44, 11, 0x40, 22, 0x60, 33, 0x40, 0x40, 2, 1, 2 -> 44, 22, 1, 2, 33
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
@@ -18,6 +18,6 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint32, (uint128, uint256[][2], uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 78, 1, 2, 88
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
@@ -17,6 +17,6 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint32, (uint128, uint256[][2], uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 78, 1, 2, 88
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
uint256 a;
|
||||
bytes b;
|
||||
uint256 c;
|
||||
}
|
||||
|
||||
function f(S calldata c)
|
||||
external
|
||||
pure
|
||||
returns (uint256, byte, byte, uint256)
|
||||
{
|
||||
S memory m = c;
|
||||
return (m.a, m.b[0], m.b[1], m.c);
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f((uint256,bytes,uint256)): 0x20, 42, 0x60, 23, 2, "ab" -> 42, "a", "b", 23
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
pragma abicoder v2;
|
||||
|
||||
contract C {
|
||||
struct S {
|
||||
@@ -18,6 +18,6 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(uint32, (uint128, uint256[][2], uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 78, 1, 2, 88
|
||||
|
||||
@@ -36,6 +36,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// EVMVersion: >=byzantium
|
||||
// ----
|
||||
// library: L
|
||||
|
||||
@@ -19,5 +19,7 @@ contract Test {
|
||||
new C();
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> FAILURE, hex"4e487b71", 0x51
|
||||
|
||||
+2
@@ -19,5 +19,7 @@ contract Test {
|
||||
new C();
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> FAILURE, hex"4e487b71", 0x51
|
||||
|
||||
@@ -18,7 +18,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test(uint256,uint256): 0, 0 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test(uint256,uint256): 1, 0 -> 1
|
||||
|
||||
@@ -6,7 +6,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// create(uint256): 0 -> 0
|
||||
// create(uint256): 7 -> 7
|
||||
|
||||
@@ -22,7 +22,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// index(uint256): 0 -> true
|
||||
// index(uint256): 10 -> true
|
||||
|
||||
@@ -14,7 +14,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_indices(uint256): 1 ->
|
||||
// test_indices(uint256): 129 ->
|
||||
|
||||
@@ -10,7 +10,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_boundary_check(uint256,uint256): 10, 11 -> FAILURE, hex"4e487b71", 0x32
|
||||
// test_boundary_check(uint256,uint256): 10, 9 -> 0
|
||||
|
||||
@@ -50,7 +50,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_zeroed_indicies(uint256): 1 ->
|
||||
// test_zeroed_indicies(uint256): 5 ->
|
||||
|
||||
@@ -7,7 +7,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
// set_get_length(uint256): 1 -> 1
|
||||
|
||||
@@ -6,6 +6,6 @@ contract C {
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=petersburg
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// popEmpty() -> FAILURE, hex"4e487b71", 0x31
|
||||
|
||||
@@ -9,7 +9,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// EVMVersion: >=petersburg
|
||||
// ----
|
||||
// pushEmpty(uint256): 128
|
||||
|
||||
@@ -10,7 +10,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// EVMVersion: >=petersburg
|
||||
// ----
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
|
||||
@@ -9,7 +9,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set_get_length(uint256): 0 -> 0
|
||||
// set_get_length(uint256): 1 -> 0
|
||||
|
||||
@@ -14,7 +14,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(bool): true -> true
|
||||
|
||||
@@ -11,7 +11,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(bool): true -> true
|
||||
|
||||
@@ -37,7 +37,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f(address): 0x1234 -> false
|
||||
// f(address): 0x00 -> true
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
contract C {
|
||||
// If these two functions are identical, the optimiser
|
||||
// on the old codegen path can deduplicate them, and breaking the test.
|
||||
function internal1() internal pure returns (bool) {
|
||||
return true;
|
||||
}
|
||||
function internal2() internal pure returns (bool) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function equal() public pure returns (bool same, bool diff, bool inv) {
|
||||
@@ -23,7 +25,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// equal() -> true, false, false
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 0x78
|
||||
|
||||
@@ -7,7 +7,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// g() -> 0x1234567800000000000000000000000000000000000000000000000000000000
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(uint256): 0x12345678 -> 0x78
|
||||
|
||||
@@ -9,7 +9,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 0x78
|
||||
|
||||
@@ -12,7 +12,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// g() -> 0x78
|
||||
|
||||
@@ -8,7 +8,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 0x78
|
||||
|
||||
@@ -19,7 +19,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// call_deleted_internal_func() -> FAILURE, hex"4e487b71", 0x51
|
||||
|
||||
@@ -17,7 +17,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 0
|
||||
|
||||
@@ -60,7 +60,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(bool): 0 -> 23
|
||||
|
||||
@@ -8,7 +8,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// keccak1() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107
|
||||
// keccak2() -> 0x64e604787cbf194841e7b68d7cd28786f6c9a0a3ab9f8b0a0e87cb4387ab0107
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(address): 0x1234 -> 0x1234
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(uint256): 6 -> 6
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(bool): true -> true
|
||||
|
||||
@@ -24,7 +24,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 2
|
||||
|
||||
@@ -30,7 +30,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 11
|
||||
|
||||
@@ -27,7 +27,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 1
|
||||
|
||||
@@ -30,7 +30,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 1024
|
||||
|
||||
@@ -5,6 +5,6 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// set(string): 0x20, 32, "01234567890123456789012345678901" ->
|
||||
|
||||
@@ -6,7 +6,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// test() -> true
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 7
|
||||
|
||||
@@ -6,7 +6,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 255
|
||||
|
||||
@@ -9,7 +9,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// or(uint256): 0 -> true, 0
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(uint256,uint256): 5, 6 -> 5, 6
|
||||
|
||||
@@ -12,7 +12,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 6
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// allowNonExistingFunctions: true
|
||||
// ----
|
||||
|
||||
@@ -29,7 +29,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// test_simple(uint256): 0 -> 3, 4, 5
|
||||
// test_simple(uint256): 1 -> 3, 4, 5
|
||||
|
||||
@@ -11,7 +11,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f(uint8): 6 -> 9
|
||||
|
||||
@@ -11,7 +11,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// setX(uint256): 6 -> 6
|
||||
|
||||
@@ -5,7 +5,7 @@ contract C {
|
||||
function h() external pure returns (bytes4) { return 0xcafecafe; }
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f1() -> 0x20, 6, left(0x616263616263)
|
||||
|
||||
@@ -19,7 +19,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// short_dyn() -> 0x20, 3, "abc"
|
||||
|
||||
@@ -18,7 +18,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 70
|
||||
|
||||
@@ -24,7 +24,7 @@ contract C is X {
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: true
|
||||
// compileViaYul: also
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> 3
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
bytes memory y = "def";
|
||||
y[0] &= "d";
|
||||
assert(y[0] == "d");
|
||||
|
||||
y[0] |= "e";
|
||||
assert(y[0] == "d"); // fails
|
||||
|
||||
y[0] ^= "f";
|
||||
assert(y[0] == (byte("d") | byte("e")) ^ byte("f"));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (189-208): CHC: Assertion violation happens here.
|
||||
@@ -0,0 +1,17 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
bytes3 y = "def";
|
||||
y &= "def";
|
||||
assert(y == "def");
|
||||
|
||||
y |= "dee";
|
||||
assert(y == "def"); // fails
|
||||
|
||||
y ^= "fed";
|
||||
assert(y == (bytes3("def") | bytes3("dee")) ^ bytes3("fed"));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (180-198): CHC: Assertion violation happens here.
|
||||
@@ -0,0 +1,21 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
function f() public pure {
|
||||
bytes32 y = "abcdefghabcdefghabcdefghabcdefgh";
|
||||
bytes32 z = y;
|
||||
y &= "bcdefghabcdefghabcdefghabcdefgha";
|
||||
z &= "bcdefghabcdefghabcdefghabcdefgha";
|
||||
assert(y == "abcdefghabcdefghabcdefghabcdefgh"); // fails
|
||||
|
||||
y |= "cdefghabcdefghabcdefghabcdefghab";
|
||||
z |= "cdefghabcdefghabcdefghabcdefghab";
|
||||
assert(y == "abcdefghabcdefghabcdefghabcd"); // fails
|
||||
|
||||
y ^= "abcdefghabcdefghabcdefghabcdefgh";
|
||||
assert(y == z ^ "abcdefghabcdefghabcdefghabcdefgh");
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (262-309): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (427-470): CHC: Assertion violation happens here.
|
||||
Reference in New Issue
Block a user