test of identify types
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 9 Jun 2004 20:30:57 +0000 (20:30 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Wed, 9 Jun 2004 20:30:57 +0000 (20:30 +0000)
[r3046]

testprograms/identify_types.c [new file with mode: 0644]

diff --git a/testprograms/identify_types.c b/testprograms/identify_types.c
new file mode 100644 (file)
index 0000000..ab3fce5
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Project:     libFIRM
+ * File name:   testprograms/indentify_types.c
+ * Purpose:     Shows use of type identification
+ * Author:      Christian Schaefer, Goetz Lindenmaier
+ * Modified by:
+ * Created:
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 1999-2003 Universität Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
+
+# include <stdio.h>
+# include <string.h>
+
+# include "irvrfy.h"
+# include "irdump.h"
+# include "firm.h"
+# include "type_identify.h"
+
+
+
+int main(int argc, char **argv)
+{
+  ident *i1, *i2;
+  type  *t1, *t2, *t3;
+
+  printf("\nCreating type information for IDENTIFY_TYPES ...\n");
+
+
+  compare_types_func = compare_names;
+
+  /** init library */
+  init_firm (NULL);
+
+  i1 = new_id_from_str("type1");
+  i2 = new_id_from_str("type2");
+
+  t1 = new_type_class(i1);
+  t1 = mature_type(t1);
+
+  t1 = mature_type(t1);
+
+  t2 = new_type_class(i1);
+  t2 = mature_type(t2);
+
+  t3 = new_type_class(i2);
+  t3 = mature_type(t3);
+
+  /*
+  printf(" t1: "); DDMT(t1);
+  printf(" t2: "); DDMT(t2);
+  printf(" t3: "); DDMT(t3);
+  */
+
+  printf("Done building the graph.  Dumping it.\n");
+  dump_all_types();
+
+  printf("use xvcg to view this graph:\n");
+  printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
+
+  return (0);
+}