[tuples] patch: gcc.dg/gimple tests

Aldy Hernandez aldyh@redhat.com
Sat Jun 23 02:22:00 GMT 2007


Hi folks.

Here are some tests I've been accumulating for the tuples work.  Diego
suggested I put them in gcc.dg/gimple/.

All the tests but with_size_expr.c and gs_call.c should compile with
cc1.

Committed.


        * testsuite/gcc.dg/gimple/gimple.exp: New.
        * testsuite/gcc.dg/gimple/compound_expr.c: New.
        * testsuite/gcc.dg/gimple/with_size_expr.c: New.
        * testsuite/gcc.dg/gimple/compound_expr.c: New.
        * testsuite/gcc.dg/gimple/gs_call.c: New.
        * testsuite/gcc.dg/gimple/constructors.c: New.
        * testsuite/gcc.dg/gimple/gs_return.c: New.
        * testsuite/gcc.dg/gimple/gs_assign.c: New.

Index: testsuite/gcc.dg/gimple/gimple.exp
===================================================================
--- testsuite/gcc.dg/gimple/gimple.exp	(revision 0)
+++ testsuite/gcc.dg/gimple/gimple.exp	(revision 0)
@@ -0,0 +1,35 @@
+#   Copyright (C) 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+    set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+        "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
Index: testsuite/gcc.dg/gimple/compound_expr.c
===================================================================
--- testsuite/gcc.dg/gimple/compound_expr.c	(revision 0)
+++ testsuite/gcc.dg/gimple/compound_expr.c	(revision 0)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+/* Test COMPOUND_EXPRs.  */
+
+int a, b, c;
+
+void foo()
+{
+    a = (b, c);
+}
Index: testsuite/gcc.dg/gimple/with_size_expr.c
===================================================================
--- testsuite/gcc.dg/gimple/with_size_expr.c	(revision 0)
+++ testsuite/gcc.dg/gimple/with_size_expr.c	(revision 0)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+/* Test GS_ASSIGN for variable sized assignments (WITH_SIZE_EXPR).  */
+
+void init (void *);
+
+void f(int a) 
+{
+  struct {int b[a];} c, d;
+
+  init(&c);
+  d = c;
+}
+
Index: testsuite/gcc.dg/gimple/compound_expr.c
===================================================================
--- testsuite/gcc.dg/gimple/compound_expr.c	(revision 0)
+++ testsuite/gcc.dg/gimple/compound_expr.c	(revision 0)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+/* Test COMPOUND_EXPRs.  */
+
+int a, b, c;
+
+void foo()
+{
+    a = (b, c);
+}
Index: testsuite/gcc.dg/gimple/gs_call.c
===================================================================
--- testsuite/gcc.dg/gimple/gs_call.c	(revision 0)
+++ testsuite/gcc.dg/gimple/gs_call.c	(revision 0)
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+/* Test GS_CALL.  */
+
+void foo()
+{
+    bar(), tool();
+}
Index: testsuite/gcc.dg/gimple/constructors.c
===================================================================
--- testsuite/gcc.dg/gimple/constructors.c	(revision 0)
+++ testsuite/gcc.dg/gimple/constructors.c	(revision 0)
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+/* Test CONSTRUCTORs.  */
+
+void bar (int *);
+
+void foo()
+{
+    int a[5] = { 1, 2, 3, 4, 5 };
+    bar(a);
+}
Index: testsuite/gcc.dg/gimple/gs_return.c
===================================================================
--- testsuite/gcc.dg/gimple/gs_return.c	(revision 0)
+++ testsuite/gcc.dg/gimple/gs_return.c	(revision 0)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+/* Test GS_RETURN.  */
+
+int a, b;
+
+void foo()
+{
+    return a + b;
+}
Index: testsuite/gcc.dg/gimple/gs_assign.c
===================================================================
--- testsuite/gcc.dg/gimple/gs_assign.c	(revision 0)
+++ testsuite/gcc.dg/gimple/gs_assign.c	(revision 0)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+/* Test GS_ASSIGN.  */
+
+int a, b, c;
+
+void foo()
+{
+    a = b + c;
+}



More information about the Gcc-patches mailing list