diff options
| author | kx <kx@radix-linux.su> | 2026-10-01 12:02:28 +0300 |
|---|---|---|
| committer | kx <kx@radix-linux.su> | 2026-10-01 12:02:28 +0300 |
| commit | ba1b04d64bdfaf377915b22f77520216ebe47674 (patch) | |
| tree | 044343035c28b2b04ca9725f26e9b7c39342d19c /tests/t0014-preprocessing-phases.sh | |
| parent | 124b140798456778e2a96851cc7268aa9a726698 (diff) | |
| download | mcpu-cpp-1.0.2.tar.xz | |
Version 1.0.21.0.2
Diffstat (limited to 'tests/t0014-preprocessing-phases.sh')
| -rwxr-xr-x | tests/t0014-preprocessing-phases.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/t0014-preprocessing-phases.sh b/tests/t0014-preprocessing-phases.sh new file mode 100755 index 0000000..5cc98c8 --- /dev/null +++ b/tests/t0014-preprocessing-phases.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -eu +src="${TMPDIR-/tmp}/mcpu-cpp-phases-$$.c" +out="${TMPDIR-/tmp}/mcpu-cpp-phases-$$.out" +trap 'rm -f "$src" "$out"' EXIT HUP INT TERM +cat > "$src" <<'EOT' +#defi\ +ne VALUE 10\ +20 +/* comment */ VALUE // trailing comment +const char *s = "VALUE /* not a comment */"; +EOT +"$MCPU_CPP" --no-config "$src" -o "$out" +grep '1020' "$out" >/dev/null +grep 'VALUE /\* not a comment \*/' "$out" >/dev/null +if grep 'trailing comment' "$out" >/dev/null; then + exit 1 +fi +if grep '/\* comment \*/' "$out" >/dev/null; then + exit 1 +fi |
