Skip to content

Commit a165382

Browse files
committed
eof: Update semanticTests tests for EOF
1 parent 407517e commit a165382

File tree

100 files changed

+1594
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1594
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
contract C {
2+
uint120[3] x;
3+
function f() public returns (bytes32 hash1, bytes32 hash2, bytes32 hash3) {
4+
uint120[] memory y = new uint120[](3);
5+
x[0] = y[0] = uint120(type(uint).max - 1);
6+
x[1] = y[1] = uint120(type(uint).max - 2);
7+
x[2] = y[2] = uint120(type(uint).max - 3);
8+
hash1 = keccak256(abi.encodePacked(x));
9+
hash2 = keccak256(abi.encodePacked(y));
10+
hash3 = keccak256(abi.encodePacked(this.f));
11+
}
12+
}
13+
// ====
14+
// EVMVersion: >=prague
15+
// bytecodeFormat: >=EOFv1
16+
// ----
17+
// f() -> 0xba4f20407251e4607cd66b90bfea19ec6971699c03e4a4f3ea737d5818ac27ae, 0xba4f20407251e4607cd66b90bfea19ec6971699c03e4a4f3ea737d5818ac27ae, 0x8a1a644bc732d428df88d4952d1be96a9217ec31fdec3f55bae4059f936e955d

test/libsolidity/semanticTests/builtinFunctions/keccak256_packed_complex_types.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ contract C {
1010
hash3 = keccak256(abi.encodePacked(C(address(0x1234))));
1111
}
1212
}
13+
// ====
14+
// bytecodeFormat: legacy
1315
// ----
1416
// f() -> 0xba4f20407251e4607cd66b90bfea19ec6971699c03e4a4f3ea737d5818ac27ae, 0xba4f20407251e4607cd66b90bfea19ec6971699c03e4a4f3ea737d5818ac27ae, 0xe7490fade3a8e31113ecb6c0d2635e28a6f5ca8359a57afe914827f41ddf0848

test/libsolidity/semanticTests/constructor/callvalue_check.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ contract C {
2929
}
3030
// ====
3131
// EVMVersion: >homestead
32+
// bytecodeFormat: legacy
3233
// ----
3334
// f(uint256), 2000 ether: 0 -> true
3435
// f(uint256), 2000 ether: 100 -> false
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
contract A1 {}
2+
contract B1 is A1 { constructor() payable {} }
3+
4+
contract A2 { constructor() {} }
5+
contract B2 is A2 { constructor() payable {} }
6+
7+
contract B3 { constructor() payable {} }
8+
9+
contract C {
10+
function f() public payable returns (bool) {
11+
// Make sure none of these revert.
12+
new B1{value: 10, salt: hex"00"}();
13+
new B2{value: 10, salt: hex"01"}();
14+
new B3{value: 10, salt: hex"02"}();
15+
return true;
16+
}
17+
}
18+
// ====
19+
// bytecodeFormat: >=EOFv1
20+
// EVMVersion: >=prague
21+
// ----
22+
// f(), 2000 ether -> true
23+
// gas irOptimized: 117623
24+
// gas irOptimized code: 1800
25+
// gas legacy: 117821
26+
// gas legacy code: 4800
27+
// gas legacyOptimized: 117690
28+
// gas legacyOptimized code: 4800

test/libsolidity/semanticTests/constructor/no_callvalue_check.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ contract C {
1515
return true;
1616
}
1717
}
18+
// ====
19+
// bytecodeFormat: legacy
1820
// ----
1921
// f(), 2000 ether -> true
2022
// gas irOptimized: 117688

test/libsolidity/semanticTests/deployedCodeExclusion/bound_function.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@ contract C {
3636
return x < data.length;
3737
}
3838
}
39+
// ====
40+
// bytecodeFormat: legacy
3941
// ----
4042
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/library_function.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ contract C {
3030
return x < data.length;
3131
}
3232
}
33+
// ====
34+
// bytecodeFormat: legacy
3335
// ----
3436
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/module_function.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ contract C {
3232
return x < data.length;
3333
}
3434
}
35+
// ====
36+
// bytecodeFormat: legacy
3537
// ----
3638
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ contract C is S {
3131
return x < data.length;
3232
}
3333
}
34+
// ====
35+
// bytecodeFormat: legacy
3436
// ----
3537
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/subassembly_deduplication.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ contract C {
3737
x < 2 * type(A).creationCode.length;
3838
}
3939
}
40+
// ====
41+
// bytecodeFormat: legacy
4042
// ----
4143
// test() -> true

0 commit comments

Comments
 (0)