Update tests that would become ineffective with minimal optimizations applied

This commit is contained in:
Kamil Śliwak 2023-05-16 11:05:09 +02:00
parent 811b8e565b
commit 7ab730d410
16 changed files with 42 additions and 12 deletions

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -16,6 +16,7 @@ tag_2:
/* \"input.sol\":77:99 */
jump(tag_3)
tag_1:
sstore(0x00, 0x2a)
jump\t// out
tag_3:
"

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -16,6 +16,7 @@ tag_2:
/* \"input.sol\":77:99 */
jump(tag_3)
tag_1:
sstore(0x00, 0x2a)
jump\t// out
tag_3:
"

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -14,6 +14,7 @@
tag_2:
jump(tag_3)
tag_1:
sstore(0x00, 0x2a)
jump\t// out
tag_3:
"

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -10,13 +10,13 @@ object "C_6_deployed" {
fun_f_5()
/// @src 0:77:99
function fun_f_5()
{ }
{ sstore(0, 42) }
}
}
Binary representation:
6080604052600a600e565b6010565b565b
6080604052600a600e565b6014565b602a5f55565b
Text representation:
/* "input.sol":60:101 */
@ -28,5 +28,6 @@ tag_2:
/* "input.sol":77:99 */
jump(tag_3)
tag_1:
sstore(0x00, 0x2a)
jump // out
tag_3:

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -10,13 +10,13 @@ object "C_6_deployed" {
fun_f_5()
/// @src 0:77:99
function fun_f_5()
{ }
{ sstore(0, 42) }
}
}
Binary representation:
6080604052600a600e565b6010565b565b
6080604052600a600e565b6014565b602a5f55565b
Text representation:
/* "input.sol":60:101 */
@ -28,5 +28,6 @@ tag_2:
/* "input.sol":77:99 */
jump(tag_3)
tag_1:
sstore(0x00, 0x2a)
jump // out
tag_3:

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -8,13 +8,13 @@ object "C_6_deployed" {
mstore(64, 128)
fun_f_5()
function fun_f_5()
{ }
{ sstore(0, 42) }
}
}
Binary representation:
6080604052600a600e565b6010565b565b
6080604052600a600e565b6014565b602a5f55565b
Text representation:
mstore(0x40, 0x80)
@ -24,5 +24,6 @@ Text representation:
tag_2:
jump(tag_3)
tag_1:
sstore(0x00, 0x2a)
jump // out
tag_3:

View File

@ -9,6 +9,7 @@ object "C_6_deployed" {
/// @src 0:77:99 "function f() public {}"
function fun_f_5() {
sstore(0, 42)
}
/// @src 0:60:101 "contract C {..."
}

View File

@ -3,6 +3,10 @@ object "Contract" {
function f() {}
function g() {}
sstore(0, 1)
// NOTE: msize forces the compiler to completely disable the Yul optimizer.
// Otherwise the functions would get optimized out.
pop(msize())
}
}
@ -26,6 +30,10 @@ object "Contract" {
// 0x00
// /* "source":73:85 */
// sstore
// Bytecode: 6009565b5b565b5b565b60015f55
// Opcodes: PUSH1 0x9 JUMP JUMPDEST JUMPDEST JUMP JUMPDEST JUMPDEST JUMP JUMPDEST PUSH1 0x1 PUSH0 SSTORE
// SourceMappings: 33:15:0:-:0;;;;:::o;53:::-;;:::o;:::-;83:1;80;73:12
// /* "source":231:238 */
// msize
// /* "source":227:239 */
// pop
// Bytecode: 6009565b5b565b5b565b60015f555950
// Opcodes: PUSH1 0x9 JUMP JUMPDEST JUMPDEST JUMP JUMPDEST JUMPDEST JUMP JUMPDEST PUSH1 0x1 PUSH0 SSTORE MSIZE POP
// SourceMappings: 33:15:0:-:0;;;;:::o;53:::-;;:::o;:::-;83:1;80;73:12;231:7;227:12

View File

@ -3,6 +3,10 @@ object "Contract" {
function f() { g(1) }
function g(x) { if x { leave } g(add(x, 2)) }
g(1)
// NOTE: msize forces the compiler to completely disable the Yul optimizer.
// Otherwise f() would get optimized out.
pop(msize())
}
}
@ -62,6 +66,10 @@ object "Contract" {
// tag_2
// jump // in
// tag_9:
// Bytecode: 6026565b600b6001600e565b5b565b8015601857506024565b602260028201600e565b505b565b602e6001600e565b
// Opcodes: PUSH1 0x26 JUMP JUMPDEST PUSH1 0xB PUSH1 0x1 PUSH1 0xE JUMP JUMPDEST JUMPDEST JUMP JUMPDEST DUP1 ISZERO PUSH1 0x18 JUMPI POP PUSH1 0x24 JUMP JUMPDEST PUSH1 0x22 PUSH1 0x2 DUP3 ADD PUSH1 0xE JUMP JUMPDEST POP JUMPDEST JUMP JUMPDEST PUSH1 0x2E PUSH1 0x1 PUSH1 0xE JUMP JUMPDEST
// SourceMappings: 33:21:0:-:0;;;48:4;50:1;48:4;:::i;:::-;33:21;:::o;59:45::-;78:1;75:14;;;82:5;;;75:14;90:12;99:1;96;92:9;90:12;:::i;:::-;59:45;;:::o;:::-;109:4;111:1;109:4;:::i;:::-
// /* "source":249:256 */
// msize
// /* "source":245:257 */
// pop
// Bytecode: 6026565b600b6001600e565b5b565b8015601857506024565b602260028201600e565b505b565b602e6001600e565b5950
// Opcodes: PUSH1 0x26 JUMP JUMPDEST PUSH1 0xB PUSH1 0x1 PUSH1 0xE JUMP JUMPDEST JUMPDEST JUMP JUMPDEST DUP1 ISZERO PUSH1 0x18 JUMPI POP PUSH1 0x24 JUMP JUMPDEST PUSH1 0x22 PUSH1 0x2 DUP3 ADD PUSH1 0xE JUMP JUMPDEST POP JUMPDEST JUMP JUMPDEST PUSH1 0x2E PUSH1 0x1 PUSH1 0xE JUMP JUMPDEST MSIZE POP
// SourceMappings: 33:21:0:-:0;;;48:4;50:1;48:4;:::i;:::-;33:21;:::o;59:45::-;78:1;75:14;;;82:5;;;75:14;90:12;99:1;96;92:9;90:12;:::i;:::-;59:45;;:::o;:::-;109:4;111:1;109:4;:::i;:::-;249:7;245:12