diff options
Diffstat (limited to 'tests/t0019-recursive-macro.sh')
| -rwxr-xr-x | tests/t0019-recursive-macro.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/t0019-recursive-macro.sh b/tests/t0019-recursive-macro.sh new file mode 100755 index 0000000..ffba144 --- /dev/null +++ b/tests/t0019-recursive-macro.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eu +src="${TMPDIR-/tmp}/mcpu-cpp-recursive-$$.c" +out="${TMPDIR-/tmp}/mcpu-cpp-recursive-$$.out" +trap 'rm -f "$src" "$out"' EXIT HUP INT TERM +cat > "$src" <<'EOT' +int foo; +#define foo (4 + foo) +f = foo; +EOT +"$MCPU_CPP" --no-config "$src" -o "$out" +grep '^int foo;$' "$out" >/dev/null +grep '^f = (4 + foo);$' "$out" >/dev/null |
