summaryrefslogtreecommitdiff
path: root/tests/t0018-include-lexing.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0018-include-lexing.sh')
-rwxr-xr-xtests/t0018-include-lexing.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/t0018-include-lexing.sh b/tests/t0018-include-lexing.sh
new file mode 100755
index 0000000..ed1561d
--- /dev/null
+++ b/tests/t0018-include-lexing.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -eu
+base="${TMPDIR-/tmp}/mcpu-cpp-include-lex-$$"
+mkdir -p "$base/inc/x"
+trap 'rm -rf "$base"' EXIT HUP INT TERM
+cat > "$base/main.c" <<'EOT'
+#include \
+<x/*y>
+AFTER
+EOT
+cat > "$base/inc/x/*y" <<'EOT'
+INSIDE
+EOT
+"$MCPU_CPP" --no-config -I "$base/inc" "$base/main.c" -o "$base/out"
+grep '^INSIDE$' "$base/out" >/dev/null
+grep '^AFTER$' "$base/out" >/dev/null
+grep "^# 3 \"$base/main.c\" 2$" "$base/out" >/dev/null