mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
test_via_ir_equivalence(): Simplify by merging the asm loops
- And fix indentation
This commit is contained in:
parent
bcdb41f743
commit
8c5304368d
@ -332,14 +332,14 @@ function test_via_ir_equivalence()
|
||||
sed '/^Optimized IR:$/d' |
|
||||
split_on_empty_lines_into_numbered_files "$output_file_prefix" ".yul"
|
||||
|
||||
for yul_file in $(find . -name "${output_file_prefix}*.yul" | sort -V); do
|
||||
msg_on_error --no-stderr "$SOLC" --strict-assembly --asm "${optimizer_flags[@]}" "$yul_file" |
|
||||
sed '/^Text representation:$/d' > "${yul_file/.yul/.asm}"
|
||||
done
|
||||
|
||||
local asm_output_two_stage asm_output_via_ir
|
||||
for asm_file in $(find . -name "${output_file_prefix}*.asm" | sort -V); do
|
||||
asm_output_two_stage+=$(sed '/^=======/d')
|
||||
|
||||
for yul_file in $(find . -name "${output_file_prefix}*.yul" | sort -V); do
|
||||
asm_output_two_stage+=$(
|
||||
msg_on_error --no-stderr "$SOLC" --strict-assembly --asm "${optimizer_flags[@]}" "$yul_file" |
|
||||
sed '/^Text representation:$/d' |
|
||||
sed '/^=======/d'
|
||||
)
|
||||
done
|
||||
|
||||
asm_output_via_ir=$(
|
||||
@ -354,7 +354,7 @@ function test_via_ir_equivalence()
|
||||
|
||||
for yul_file in $(find . -name "${output_file_prefix}*.yul" | sort -V); do
|
||||
bin_output_two_stage+=$(
|
||||
msg_on_error --no-stderr "$SOLC" --strict-assembly --bin "${optimizer_flags[@]}" "$yul_file" |
|
||||
msg_on_error --no-stderr "$SOLC" --strict-assembly --bin "${optimizer_flags[@]}" "$yul_file" |
|
||||
sed '/^Binary representation:$/d' |
|
||||
sed '/^=======/d'
|
||||
)
|
||||
@ -362,8 +362,8 @@ function test_via_ir_equivalence()
|
||||
|
||||
bin_output_via_ir=$(
|
||||
msg_on_error --no-stderr "$SOLC" --via-ir --bin "${optimizer_flags[@]}" "$solidity_file" |
|
||||
sed '/^Binary:$/d' |
|
||||
sed '/^=======/d'
|
||||
sed '/^Binary:$/d' |
|
||||
sed '/^=======/d'
|
||||
)
|
||||
|
||||
diff_values "$bin_output_two_stage" "$bin_output_via_ir" --ignore-space-change --ignore-blank-lines
|
||||
|
Loading…
Reference in New Issue
Block a user