Warn about undefined preprocessor symbols at expansion time, not parse time
[smatch.git] / test-linearize.c
blob63ecdc7148836d9331184181c8dc77cbc6a4d4b8
1 /*
2 * Parse and linearize the tree for testing.
4 * Copyright (C) 2003 Transmeta Corp.
5 * 2003-2004 Linus Torvalds
7 * Licensed under the Open Software License version 1.1
8 */
9 #include <stdarg.h>
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <string.h>
13 #include <ctype.h>
14 #include <unistd.h>
15 #include <fcntl.h>
17 #include "lib.h"
18 #include "allocate.h"
19 #include "token.h"
20 #include "parse.h"
21 #include "symbol.h"
22 #include "expression.h"
23 #include "linearize.h"
25 static void clean_up_symbols(struct symbol_list *list)
27 struct symbol *sym;
29 FOR_EACH_PTR(list, sym) {
30 struct entrypoint *ep;
32 expand_symbol(sym);
33 ep = linearize_symbol(sym);
34 if (ep)
35 show_entry(ep);
36 } END_FOR_EACH_PTR(sym);
39 int main(int argc, char **argv)
41 sparse_initialize(argc, argv);
42 while (*argv)
43 clean_up_symbols(sparse(argv));
44 return 0;