summaryrefslogtreecommitdiff
path: root/tests/t0016-macro-include.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t0016-macro-include.sh')
-rwxr-xr-xtests/t0016-macro-include.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/t0016-macro-include.sh b/tests/t0016-macro-include.sh
new file mode 100755
index 0000000..0c1b56e
--- /dev/null
+++ b/tests/t0016-macro-include.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -eu
+base="${TMPDIR-/tmp}/mcpu-cpp-minclude-$$"
+mkdir -p "$base/inc"
+trap 'rm -rf "$base"' EXIT HUP INT TERM
+cat > "$base/main.c" <<'EOT'
+#define HEADER <macro.h>
+#include HEADER
+VALUE
+EOT
+cat > "$base/inc/macro.h" <<'EOT'
+#define VALUE 77
+EOT
+"$MCPU_CPP" --no-config -I "$base/inc" "$base/main.c" -o "$base/out"
+grep '^77$' "$base/out" >/dev/null
+grep "^# 3 \"$base/main.c\" 2$" "$base/out" >/dev/null