diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | test-show-type.c | 28 |
3 files changed, 30 insertions, 0 deletions
@@ -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 diff --git a/test-show-type.c b/test-show-type.c new file mode 100644 index 00000000..8396fdcf --- /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; +} |
