*** empty log message ***
[libfirm] / testprograms / oo_program_example.c
index 28e7b5d..aba9308 100644 (file)
@@ -22,7 +22,7 @@
 ***    return (d + a);
 ***  end
 ***
-***  set_a(e:int):void
+***  set_a(e:int): void
 ***    self.a = e;
 ***  end
 ***
@@ -60,7 +60,7 @@ main(void)
 
   /* first build procedure main */
   printf("creating an IR graph: OO_PROGRAM_EXAMPLE...\n");
-  owner = new_type_class (id_from_str ("OO_PROGRAM_EXAMPLE", 18));
+  owner = get_glob_type();
   proc_main = new_type_method(id_from_str("main", 4), 0, 1);
   set_method_res_type(proc_main, 0, (type *)prim_t_int);
 
@@ -74,7 +74,7 @@ main(void)
 
   /* allocate the defined object and generate the type information */
   class_prima = new_type_class(id_from_str ("PRIMA", 5));
-  obj_size = new_SymConst((type *)class_prima, size);
+  obj_size = new_SymConst((type_or_id *)class_prima, size);
   obj_o    = new_Alloc(get_store(), obj_size, (type *)class_prima, heap_alloc);
   set_store(new_Proj(obj_o, mode_M, 0));  /* make the changed memory visible */
   obj_o    = new_Proj(obj_o, mode_p, 1);  /* remember the pointer to the object */
@@ -137,6 +137,7 @@ main(void)
   mature_block (main_irg->end_block);
 
   printf("\nDone building the graph.\n");
+  vrfy_graph(main_irg);
   printf("Dumping the graph and a type graph.\n");
   dump_ir_block_graph (main_irg);
   dump_type_graph(main_irg);
@@ -167,6 +168,7 @@ main(void)
   mature_block (set_a_irg->end_block);
 
   printf("\nDone building the graph.\n");
+  vrfy_graph(set_a_irg);
   printf("Dumping the graph and a type graph.\n");
   dump_ir_block_graph (set_a_irg);
   dump_type_graph(set_a_irg);
@@ -200,6 +202,9 @@ main(void)
   add_in_edge (c_irg->end_block, x);
   mature_block (c_irg->end_block);
 
+  /* verify the graph */
+  vrfy_graph(main_irg);
+
   printf("\nDone building the graph.\n");
   printf("Dumping the graph and a type graph.\n");
   dump_ir_block_graph (c_irg);
@@ -208,7 +213,7 @@ main(void)
   /****************************************************************************/
 
   printf("\nuse xvcg to view these graphs:\n");
-  printf("/ben/trapp/bin/i486/xvcg GRAPHNAME\n");
+  printf("/ben/goetz/bin/xvcg GRAPHNAME\n");
 
   return (1);
 }