First implementation of lowering for calls with compound return values
[libfirm] / testprograms / identify_types.c
1 /*
2  * Project:     libFIRM
3  * File name:   testprograms/indentify_types.c
4  * Purpose:     Shows use of type identification
5  * Author:      Christian Schaefer, Goetz Lindenmaier
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1999-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 # include <stdio.h>
14 # include <string.h>
15
16 # include "irvrfy.h"
17 # include "irdump.h"
18 # include "firm.h"
19 # include "type_identify.h"
20
21
22
23 int main(int argc, char **argv)
24 {
25   ident *i1, *i2;
26   type  *t1, *t2, *t3;
27
28   printf("\nCreating type information for IDENTIFY_TYPES ...\n");
29
30
31
32
33   /** init library */
34   firm_parameter_t params;
35   type_identify_if_t params2;
36   memset (&params, 0, sizeof(params));
37   params.size = sizeof(params);
38   params2.cmp = compare_names;
39   params2.hash = NULL;
40   params.ti_if = &params2;
41   init_firm(&params);
42
43
44   i1 = new_id_from_str("type1");
45   i2 = new_id_from_str("type2");
46
47   t1 = new_type_class(i1);
48   t1 = mature_type(t1);
49
50   t1 = mature_type(t1);
51
52   t2 = new_type_class(i1);
53   t2 = mature_type(t2);
54
55   t3 = new_type_class(i2);
56   t3 = mature_type(t3);
57
58   /*
59   printf(" t1: "); DDMT(t1);
60   printf(" t2: "); DDMT(t2);
61   printf(" t3: "); DDMT(t3);
62   */
63
64   printf("Done building the graph.  Dumping it.\n");
65   dump_all_types(0);
66
67   printf("use xvcg to view this graph:\n");
68   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
69
70   return (0);
71 }