aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_invalid_directives.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_invalid_directives.sh')
-rw-r--r--tests/test_invalid_directives.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_invalid_directives.sh b/tests/test_invalid_directives.sh
new file mode 100644
index 0000000..877f9e9
--- /dev/null
+++ b/tests/test_invalid_directives.sh
@@ -0,0 +1,28 @@
+cat <<'EOF' > expected
+main.c:1: invalid preprocessing directive, '#foo'
+EOF
+test_compile_error <<'EOF'
+#foo
+
+int main() {}
+EOF
+
+cat <<'EOF' > expected
+main.c:1: invalid preprocessing directive, '#bar'
+EOF
+test_compile_error <<'EOF'
+# bar 1 2 3
+
+int main() {}
+EOF
+
+cat <<'EOF' > expected
+EOF
+test_diff <<'EOF'
+#if 0
+#baz
+#endif
+
+int main() {}
+EOF
+