From 8c5304368d5b8da36046fd501408629716a71819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Tue, 23 May 2023 15:30:07 +0200 Subject: [PATCH] test_via_ir_equivalence(): Simplify by merging the asm loops - And fix indentation --- test/cmdlineTests.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 8f4be1140..416b97b32 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -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