#!/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