aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--lib.c2
-rw-r--r--validation/preprocessor/bad-cmdline-include.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 2b600fee..4bc5cd02 100644
--- a/lib.c
+++ b/lib.c
@@ -383,6 +383,8 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list
char **args;
struct symbol_list *list;
+ base_filename = "command-line";
+
// Initialize symbol stream first, so that we can add defines etc
init_symbols();
diff --git a/validation/preprocessor/bad-cmdline-include.c b/validation/preprocessor/bad-cmdline-include.c
new file mode 100644
index 00000000..e4ee03f4
--- /dev/null
+++ b/validation/preprocessor/bad-cmdline-include.c
@@ -0,0 +1,11 @@
+#error some random error
+
+/*
+ * check-name: bad-cmdline-include
+ * check-command: sparse -include $file
+ *
+ * check-error-start
+command-line: note: in included file (through builtin):
+preprocessor/bad-cmdline-include.c:1:2: error: some random error
+ * check-error-end
+ */