-# Hey Emacs, this is a -*- makefile -*-
-#
-# libFIRM Project
+
#
-# $Id$
+# Project: libFIRM
+# File name: testprograms/Makefile.in
+# Purpose:
+# Author: Boris Boesler, Till Riedel
+# Modified by:
+# Created:
+# CVS-ID: $Id$
+# Copyright: (c) 1999-2003 Universität Karlsruhe
+# Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
#
top_srcdir := @top_srcdir@
- /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/array-heap_example.c
+ * Purpose: Show representation of dynamically allocated array.
+ * Author: 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 <string.h>
# include <stdio.h>
- /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/array-stack_example.c
+ * Purpose: Show representation of array on stack.
+ * Author: 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 <string.h>
# include <stdio.h>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/call_str_example.c
+ * Purpose: Shows representation of constant string.
+ * Author: 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 <string.h>
# include <stdio.h>
# include "firm.h"
/**
-* This file constructs the ir for the following pseudo-program:
-*
-* void f(char *);
-*
-* void CALL_STR_EXAMPLE_main () {
- f("Hello World\n");
-* }
-*
-* This program shall demonstrate how to represent string constants.
-**/
+ * This file constructs the ir for the following pseudo-program:
+ *
+ * void f(char *);
+ *
+ * void CALL_STR_EXAMPLE_main () {
+ * f("Hello World\n");
+ * }
+ *
+ * This program demonstrates how to represent string constants.
+ */
int main(int argc, char **argv)
{
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/cond_example.c
+ * Purpose: Shows how to represent boolean expressions.
+ * 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>
-/* Copyright (C) 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Author: Goetz Lindenmaier
-*
-* testprogram.
-*/
-
-#include <stdio.h>
+/*
+ * Project: libFIRM
+ * File name: testprograms/const_ent_example.c
+ * Purpose: Shows how to construct type information for constant entities.
+ * Author: 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 "firm.h"
/**
-* This file constructs type information for constant entities.
-*
-* It constructs the information for a class type with a dispatch
-* table. The class has a field a, and two methods f and g. The
-* class is represented by a class type with two entities for the
-* field a and the reference to the dispatch table. This reference
-* is a constant entity. Ther dispatch table is also represented
-* by a class type that contains the two methods. There is one entity
-* of the dispatch table which is constant.
-*
-* Further the example shows the representation of a constant global
-* array.
-*
-* class C {
-* int a;
-* void f();
-* void g(int);
-* }
-* int[4] arre = (7, 2, 13, 92);
-**/
+ * This file constructs type information for constant entities.
+ *
+ * It constructs the information for a class type with a dispatch
+ * table. The class has a field a, and two methods f and g. The
+ * class is represented by a class type with two entities for the
+ * field a and the reference to the dispatch table. This reference
+ * is a constant entity. Ther dispatch table is also represented
+ * by a class type that contains the two methods. There is one entity
+ * of the dispatch table which is constant.
+ *
+ * Further the example shows the representation of a constant global
+ * array.
+ *
+ * class C {
+ * int a;
+ * void f();
+ * void g(int);
+ * }
+ * int[4] arre = (7, 2, 13, 92);
+ **/
int main(int argc, char **argv)
{
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/const_eval_example.c
+ * Purpose: Test constant evaluation.
+ * 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/dead_block_example.c
+ * Purpose: Test unreachable code elimination.
+ * 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/empty.c
+ * Purpose: The smallest possible firm graph.
+ * 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>
-/* (C) 2002 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/endless_loop.c
+ * Purpose: Representation of an endless loop.
+ * Author: 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.
+ */
+
-/* $ID$ */
# include <stdio.h>
# include <string.h>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/float_example.c
+ * Purpose:
+ * 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>
-/* Copyright (C) 2002 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
-
-/* $Id$ */
+/*
+ * Project: libFIRM
+ * File name: testprograms/global_cse.c
+ * Purpose: Test global cse.
+ * 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/global_var_example.c
+ * Purpose: Illustrates representation of global variable.
+ * 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/if_else_example.c
+ * Purpose: Shows construction of if ... else control flow.
+ * Tests Phi construction.
+ * 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/if_example.c
+ * Purpose: Shows construction of if.
+ * 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>
-/* (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/if_while_example.c
+ * Purpose: Shows more complex control flow.
+ * 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>
-/* Copyright (C) 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Author: Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/inheritance_example.c
+ * Purpose: Shows type graph with inheritance.
+ * 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/irr_cf_example.c
+ * Purpose: Test Phi construction with irregular control flow.
+ * 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 "irdump.h"
# include "firm.h"
-/*
- * irregular control flow
- */
/**
* This file constructs a control flow of following shape:
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/irr_loop_example.c
+ * Purpose: Test Phi construction with irregular control flow.
+ * 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 "irdump.h"
# include "firm.h"
-/*
- * an irreducible loop.
- */
-
/**
* This file constructs a control flow of following shape:
*
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/memory_example.c
+ * Purpose: Illustrate memory edges.
+ * 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>
-/* Copyright (C)2002 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*/
-
-/* $ID$ */
-
+/*
+ * Project: libFIRM
+ * File name: testprograms/oo_inline_example.c
+ * Purpose: Test inlineing.
+ * Author: 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/oo_program_example.c
+ * Purpose: A complex example.
+ * Author: 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>
-/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Christian Schaefer, Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/three_cfpred_example.c
+ * Purpose: Construct a block with more than two predecessors.
+ * 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 "irdump.h"
# include "firm.h"
-/*
- * a dead block / unreachable code.
- */
-
/**
-* This file constructs a control flow of following shape:
-*
-*
-* firstCondBlock
-* / \
-* / \
-* |/_ _\|
-* Block1 scnCondBlock
-* | | |
-* | | |
-* | \ / \ /
-* | Block2 Block3
-* \ | /
-* \ | /
-* _\| \ / |/_
-* nextBlock
-*
-*
-* This is a program as, e.g.,
-*
-* if () then
-* { Jmp label1; } // happens anyways
-* else
-* { Jmp label1; } // happens anyways
-* label1:
-* return();
-* Jmp label1;
-*
-**/
+ * This file constructs a control flow of following shape:
+ *
+ *
+ * firstCondBlock
+ * / \
+ * / \
+ * |/_ _\|
+ * Block1 scnCondBlock
+ * | | |
+ * | | |
+ * | \ / \ /
+ * | Block2 Block3
+ * \ | /
+ * \ | /
+ * _\| \ / |/_
+ * nextBlock
+ *
+ *
+ * This is a program as, e.g.,
+ *
+ * if () then
+ * { Jmp label1; } // happens anyways
+ * else
+ * { Jmp label1; } // happens anyways
+ * label1:
+ * return();
+ * Jmp label1;
+ *
+ **/
int main(int argc, char **argv)
{
-/* Copyright (C) 2001 by Universitaet Karlsruhe
-* All rights reserved.
-*
-* Authors: Goetz Lindenmaier
-*
-* testprogram.
-*/
+/*
+ * Project: libFIRM
+ * File name: testprograms/while_example.c
+ * Purpose: Construct a loop.
+ * Author: 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>