log -header "Same direction SHL: (a << b) << c" log -push design -reset read_verilog <> b) >> c" log -push design -reset read_verilog <> b) >> c; endmodule EOF check -assert equiv_opt -assert opt_shift -combine design -load postopt select -assert-count 1 t:$shr select -assert-count 1 t:$add design -reset log -pop log -header "Same direction SSHR: (a >>> b) >>> c (signed arithmetic)" log -push design -reset read_verilog <>> b) >>> c; endmodule EOF check -assert equiv_opt -assert opt_shift -combine design -load postopt select -assert-count 1 t:$sshr select -assert-count 1 t:$add design -reset log -pop log -header "Negative case: fanout from intermediate wire prevents combining" log -push design -reset read_verilog <> c" log -push design -reset read_verilog <> c; endmodule EOF check -assert opt_shift -combine select -assert-count 1 t:$shl select -assert-count 0 t:$shr select -assert-count 1 t:$sub design -reset log -pop log -header "Mixed direction: (a >> b) << c" log -push design -reset read_verilog <> b) << c; endmodule EOF check -assert opt_shift -combine select -assert-count 0 t:$shl select -assert-count 1 t:$shr select -assert-count 1 t:$sub design -reset log -pop log -header "Cross-type same direction: $shr then $sshr" log -push design -reset read_rtlil <