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@xxxxxxxxx> --- .gitignore | 1 + Makefile | 1 + test-show-type.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 test-show-type.c diff --git a/.gitignore b/.gitignore index 7565fd56d..da103de82 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ compile graph test-dissect test-linearize +test-show-type example test-unssa ctags diff --git a/Makefile b/Makefile index a87d06438..deab48976 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/test-show-type.c b/test-show-type.c new file mode 100644 index 000000000..8396fdcf5 --- /dev/null +++ b/test-show-type.c @@ -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; +} -- 2.24.0