@@ -20,6 +20,7 @@ compile
graph
test-dissect
test-linearize
+test-show-type
example
test-unssa
ctags
@@ -80,6 +80,7 @@ PROGRAMS += test-dissect
PROGRAMS += test-lexing
PROGRAMS += test-linearize
PROGRAMS += test-parsing
+PROGRAMS += test-show-type
PROGRAMS += test-unssa
INST_PROGRAMS=sparse cgcc
new file mode 100644
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: MIT
+
+#include <stdio.h>
+#include "lib.h"
+#include "symbol.h"
+
+static void show_symbols(struct symbol_list *list)
+{
+ struct symbol *sym;
+
+ FOR_EACH_PTR(list, sym) {
+ printf("%s;\n", show_typename(sym));
+ } END_FOR_EACH_PTR(sym);
+}
+
+int main(int argc, char **argv)
+{
+ struct string_list *filelist = NULL;
+ char *file;
+
+ sparse_initialize(argc, argv, &filelist);
+ Wdecl = 0;
+ FOR_EACH_PTR(filelist, file) {
+ show_symbols(sparse(file));
+ } END_FOR_EACH_PTR(file);
+
+ return has_error;
+}
Add another small client doing nothing but display the type of the toplevel symbols. This will help to test further changes in do_show_type(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- .gitignore | 1 + Makefile | 1 + test-show-type.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 test-show-type.c