diff --git a/tests/various/const_cmdline_nested.sh b/tests/various/const_cmdline_nested.sh new file mode 100644 index 000000000..7fe41e644 --- /dev/null +++ b/tests/various/const_cmdline_nested.sh @@ -0,0 +1,27 @@ +trap 'echo "ERROR in const_cmdline_nested.sh" >&2; exit 1' ERR + +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT + +cat > "$tmp/design.v" <<'EOT' +module top(output [7:0] o); +assign o = 8'hAA; +endmodule +EOT + +printf "setattr -set foo 2'd7 t:*\n" > "$tmp/inner.ys" +cat > "$tmp/outer.ys" <&1) +echo "$out" | grep -E "inner\.ys:1: Warning: While parsing constant \`2'd7'" > /dev/null +echo "$out" | grep -E "outer\.ys:[0-9]+: Warning: While parsing constant \`3'd15'" > /dev/null + +# cmd fallback - no source location prefix +out=$(${YOSYS} -q -p "read_verilog $tmp/design.v; prep -top top; setattr -set foo 2'd7 t:*" 2>&1) +echo "$out" | grep -E "^Warning: While parsing constant \`2'd7'" > /dev/null