mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Ensure we fail gracefully when user tries to optimize Yul code
This commit is contained in:
@@ -332,13 +332,12 @@ printTask "Testing assemble, yul, strict-assembly and optimize..."
|
||||
# Test options above in conjunction with --optimize.
|
||||
# Using both, --assemble and --optimize should fail.
|
||||
! echo '{}' | "$SOLC" - --assemble --optimize &>/dev/null
|
||||
! echo '{}' | "$SOLC" - --yul --optimize &>/dev/null
|
||||
|
||||
# Test yul and strict assembly output
|
||||
# Non-empty code results in non-empty binary representation with optimizations turned off,
|
||||
# while it results in empty binary representation with optimizations turned on.
|
||||
test_solc_assembly_output "{ let x:u256 := 0:u256 }" "{ let x:u256 := 0:u256 }" "--yul"
|
||||
test_solc_assembly_output "{ let x:u256 := 0:u256 }" "{ }" "--yul --optimize"
|
||||
|
||||
test_solc_assembly_output "{ let x := 0 }" "{ let x := 0 }" "--strict-assembly"
|
||||
test_solc_assembly_output "{ let x := 0 }" "{ }" "--strict-assembly --optimize"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user