Skip to content

Commit 152f4af

Browse files
committed
eof: Update semanticTests tests for EOF
1 parent 21fdda6 commit 152f4af

File tree

51 files changed

+309
-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.

51 files changed

+309
-0
lines changed

test/libsolidity/semanticTests/constructor/callvalue_check.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ contract B4 { constructor() {} }
1111
contract C {
1212
function createWithValue(bytes memory c, uint256 value) public payable returns (bool) {
1313
uint256 y = 0;
14+
// TODO: This test is hard to recreate for EOF as for now eofcreate is disallowed in inline assembly.
1415
assembly { y := create(value, add(c, 0x20), mload(c)) }
1516
return y != 0;
1617
}
@@ -29,6 +30,7 @@ contract C {
2930
}
3031
// ====
3132
// EVMVersion: >homestead
33+
// bytecodeFormat: legacy
3234
// ----
3335
// f(uint256), 2000 ether: 0 -> true
3436
// f(uint256), 2000 ether: 100 -> false

test/libsolidity/semanticTests/deployedCodeExclusion/bound_function.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
function longdata(S memory) pure returns (bytes memory) {
23
return
34
"xasopca.pngaibngidak.jbtnudak.cAP.BRRSMCPJAGPD KIAJDOMHUKR,SCPID"
@@ -36,5 +37,7 @@ contract C {
3637
return x < data.length;
3738
}
3839
}
40+
// ====
41+
// bytecodeFormat: legacy
3942
// ----
4043
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/library_function.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
library L {
23
function longdata() pure internal returns (bytes memory) {
34
return
@@ -30,5 +31,7 @@ contract C {
3031
return x < data.length;
3132
}
3233
}
34+
// ====
35+
// bytecodeFormat: legacy
3336
// ----
3437
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/module_function.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
==== Source: mod.sol ====
23
function longdata() pure returns (bytes memory) {
34
return
@@ -32,5 +33,7 @@ contract C {
3233
return x < data.length;
3334
}
3435
}
36+
// ====
37+
// bytecodeFormat: legacy
3538
// ----
3639
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/static_base_function.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
abstract contract S {
23
function longdata() internal pure returns (bytes memory) {
34
return
@@ -31,5 +32,7 @@ contract C is S {
3132
return x < data.length;
3233
}
3334
}
35+
// ====
36+
// bytecodeFormat: legacy
3437
// ----
3538
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/subassembly_deduplication.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
contract A {
23
function longdata() pure external returns (bytes memory) {
34
return
@@ -37,5 +38,7 @@ contract C {
3738
x < 2 * type(A).creationCode.length;
3839
}
3940
}
41+
// ====
42+
// bytecodeFormat: legacy
4043
// ----
4144
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/super_function.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
abstract contract S {
23
function longdata() internal pure returns (bytes memory) {
34
return
@@ -31,5 +32,7 @@ contract C is S {
3132
return x < data.length;
3233
}
3334
}
35+
// ====
36+
// bytecodeFormat: legacy
3437
// ----
3538
// test() -> true

test/libsolidity/semanticTests/deployedCodeExclusion/virtual_function.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: Recreate this test for EOF when subassembly deduplication will be supported for EOF too.
12
abstract contract S {
23
function longdata() internal virtual pure returns (bytes memory);
34
}
@@ -35,5 +36,7 @@ contract C is X {
3536
return x < data.length;
3637
}
3738
}
39+
// ====
40+
// bytecodeFormat: legacy
3841
// ----
3942
// test() -> true

test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// TODO: Implement this test for EOF. Now it's not possible because deployed contract address depends on contract bytecode.
2+
// This means that the address changes when optimisations are applied.
13
contract D {
24
event Deposit(address indexed _from, bytes32 indexed _id, uint _value);
35
function deposit(bytes32 _id) public payable {
@@ -13,6 +15,8 @@ contract C {
1315
d.deposit(_id);
1416
}
1517
}
18+
// ====
19+
// bytecodeFormat: legacy
1620
// ----
1721
// constructor() ->
1822
// gas irOptimized: 113970

test/libsolidity/semanticTests/experimental/stub.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ contract C {
9292
// EVMVersion: >=constantinople
9393
// ====
9494
// compileViaYul: true
95+
// bytecodeFormat: legacy
9596
// ----
9697
// (): 0 -> 0
9798
// (): 1 -> 544

0 commit comments

Comments
 (0)