s390: New directory.
authorUros Bizjak <uros@gcc.gnu.org>
Thu, 23 Aug 2007 13:03:07 +0000 (15:03 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 23 Aug 2007 13:03:07 +0000 (15:03 +0200)
* gcc.target/s390: New directory.
* gcc.target/s390/s390.exp: New file.
* gcc.dg/20020926-1.c, gcc.dg/20030123-1.c, gcc.dg/20030129-1.c,
gcc.dg/20040305-1.c, gcc.dg/20041109-1.c, gcc.dg/20041216-1.c,
gcc.dg/20050409-1.c, gcc.dg/20050524-1.c, gcc.dg/20050824-1.c,
gcc.dg/pr20927.c, gcc.dg/pr24624.c, gcc.dg/pr27661.c: Move to
gcc.target/s390 directory.

From-SVN: r127738

26 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20020926-1.c [deleted file]
gcc/testsuite/gcc.dg/20030123-1.c [deleted file]
gcc/testsuite/gcc.dg/20030129-1.c [deleted file]
gcc/testsuite/gcc.dg/20040305-1.c [deleted file]
gcc/testsuite/gcc.dg/20041109-1.c [deleted file]
gcc/testsuite/gcc.dg/20041216-1.c [deleted file]
gcc/testsuite/gcc.dg/20050409-1.c [deleted file]
gcc/testsuite/gcc.dg/20050524-1.c [deleted file]
gcc/testsuite/gcc.dg/20050824-1.c [deleted file]
gcc/testsuite/gcc.dg/pr20927.c [deleted file]
gcc/testsuite/gcc.dg/pr24624.c [deleted file]
gcc/testsuite/gcc.dg/pr27661.c [deleted file]
gcc/testsuite/gcc.target/s390/20020926-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20030123-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20030129-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20040305-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20041109-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20041216-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20050409-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20050524-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/20050824-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/pr20927.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/pr24624.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/pr27661.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/s390.exp [new file with mode: 0644]

index 9b17200f3ae25958707111aaa4d1b76b2e2f0477..1fb55d54516029df0ef0b903731296ee553875c3 100644 (file)
@@ -1,3 +1,13 @@
+2007-08-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.target/s390: New directory.
+       * gcc.target/s390/s390.exp: New file.
+       * gcc.dg/20020926-1.c, gcc.dg/20030123-1.c, gcc.dg/20030129-1.c,
+       gcc.dg/20040305-1.c, gcc.dg/20041109-1.c, gcc.dg/20041216-1.c,
+       gcc.dg/20050409-1.c, gcc.dg/20050524-1.c, gcc.dg/20050824-1.c,
+       gcc.dg/pr20927.c, gcc.dg/pr24624.c, gcc.dg/pr27661.c: Move to
+       gcc.target/s390 directory.
+
 2007-08-23  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/32328
 
 2007-03-20  Pawel Sikora  <pluto@pld-linux.org>
 
-        * g++.dg/warn/Wnvdtor-2.C: New testcase.
+       * g++.dg/warn/Wnvdtor-2.C: New testcase.
 
 2007-08-20  Dorit Nuzman  <dorit@il.ibm.com>
 
        * gcc.dg/vect/vect-outer-6.c: New test.
        * gcc.dg/vect/vect-outer-fir.c: New test.
        * gcc.dg/vect/vect-outer-fir-lb.c: New test.
-       * gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: New test.       
+       * gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c: New test.
 
 2007-08-19  Dorit Nuzman  <dorit@il.ibm.com>
 
        versioning for aliasing).
        * testsuite/gcc.dg/vect/vect-35.c: Likewise.
 
-       * testsuite/gcc.dg/vect/vect-iv-6.c: Fix test for vect_no_align targets.
+       * testsuite/gcc.dg/vect/vect-iv-6.c: Fix test for vect_no_align
+       targets.
        * testsuite/gcc.dg/vect/vect-multitypes-11.c: Likewise.
 
 2007-08-18  Tom Tromey  <tromey@redhat.com>
 
        PR middle-end/32813
        * gfortran.fortran-torture/compile/emptyif-1.f90: New test.
-       * lib/fortran-torture.exp (fortran-torture): Use TORTURE_OPTIONS instead
-       of just -O.
+       * lib/fortran-torture.exp (fortran-torture): Use TORTURE_OPTIONS
+       instead of just -O.
 
 2007-08-08  Richard Sandiford  <richard@codesourcery.com>
 
        * gfortran.dg/vect-5.f90: Likewise.
        * lib/target-supports.exp (check_effective_target_natural_alignment): 
        Return false for darwin. 
-       (check_effective_target_vector_alignment_reachable_for_double): New.    
+       (check_effective_target_vector_alignment_reachable_for_double): New.
 
 2007-08-07  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        * gfortran.dg/isnan_1.f90: New test.
 
 2007-08-05  Vladimir Yanovsky  <yanov@il.ibm.com>
-            Revital Eres <eres@il.ibm.com>
+           Revital Eres <eres@il.ibm.com>
 
        * gcc.dg/sms-antideps.c: New test.
 
        * gfortran.dg/entry_11.f90: New test.
 
 2007-07-29  Vladimir Yanovsky  <yanov@il.ibm.com>
-            Revital Eres  <eres@il.ibm.com>
+           Revital Eres  <eres@il.ibm.com>
 
        * gfortran.dg/sms-1.f90: New test.
 
 2007-07-16  Sandra Loosemore  <sandra@codesourcery.com>
            David Ung  <davidu@mips.com>
 
-        * gcc.target/mips/mips-sched-madd.c: New test case.
+       * gcc.target/mips/mips-sched-madd.c: New test case.
 
 2007-07-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
diff --git a/gcc/testsuite/gcc.dg/20020926-1.c b/gcc/testsuite/gcc.dg/20020926-1.c
deleted file mode 100644 (file)
index 7a8c716..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Make sure that LEGITIMIZE_ADDRESS is called to handle
-   negative displacements.  */
-
-/* { dg-do compile { target s390-*-* } } */
-/* { dg-options "-O2 -mesa" } */
-
-int test (int *addr)
-{
-  return *(addr - 1);
-}
-
-/* { dg-final { scan-assembler "-4096" } } */
-/* { dg-final { scan-assembler-not "ahi" } } */
-
diff --git a/gcc/testsuite/gcc.dg/20030123-1.c b/gcc/testsuite/gcc.dg/20030123-1.c
deleted file mode 100644 (file)
index 319e452..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* This used to ICE due to a reload bug on s390*.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O2 -fno-omit-frame-pointer" } */
-
-extern void *alloca (__SIZE_TYPE__);
-
-void func (char *p);
-
-void test (void)
-{
-   char *p = alloca (4096);
-   long idx;
-
-   asm ("" : "=r" (idx) : : "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12");
-
-   func (p + idx + 1);
-}
-
diff --git a/gcc/testsuite/gcc.dg/20030129-1.c b/gcc/testsuite/gcc.dg/20030129-1.c
deleted file mode 100644 (file)
index 0b745a9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This used to ICE due to a reload bug on s390*.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O2" } */
-
-int f (unsigned int);
-void g (void *);
-
-void test (void *p, void *dummy)
-{
-  unsigned int flags = 0;
-
-  if (dummy)
-    g (dummy);
-
-  if (p)
-    flags |= 0x80000000;
-
-  asm volatile ("" : : : "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
-
-  if (dummy)
-    g (dummy);
-
-  if (p) 
-    {
-      flags |= 0x20000000|0x80000000;
-
-      if (!f (0))
-        flags &= ~0x80000000;
-    }
-
-  f (flags);
-
-  if (dummy)
-    g (dummy);
-}
-
diff --git a/gcc/testsuite/gcc.dg/20040305-1.c b/gcc/testsuite/gcc.dg/20040305-1.c
deleted file mode 100644 (file)
index d2c4da4..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/* The testcase failed due to corrupted alias information.
-   During the crossjump analyzing step the mem alias info of the
-   st instructions are merged and get copied during basic block
-   reordering which leads to an insn with wrong alias info.
-   The scheduler afterwards exchanges the mvc and st instructions 
-   not recognizing the anti dependence.  */
-/* { dg-do run { target s390-*-* } } */
-/* { dg-options "-O3 -mtune=z990 -fno-inline" } */
-
-extern void exit (int);
-extern void abort (void);
-
-int f;
-int g;
-int h;
-
-int* x  = &f;
-int* p1 = &g;
-int* p2 = &h;
-
-int
-foo(void)
-{
-
-  if (*x == 0)
-    {
-      x = p1;         /* mvc - memory to memory */
-      p1 = (int*)0;   /* st  - register to memory */
-      return 1;
-    }
-  if (*x == 5)
-    {
-      f = 1;
-      g = 2;
-
-      p2 = (int*)0;   /* st */   
-      return 1;
-    }
-}
-
-int
-main (int argc, char** argv)
-{
-  foo ();
-
-  /* If the scheduler has exchanged the mvc and st instructions,
-     x is 0. The expected result is &g.  */
-  if (x == &g)
-    exit (0);
-  else
-    abort ();
-}
diff --git a/gcc/testsuite/gcc.dg/20041109-1.c b/gcc/testsuite/gcc.dg/20041109-1.c
deleted file mode 100644 (file)
index 8b07233..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* This used to ICE due to a literal pool handling bug on s390x.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O2 -fno-omit-frame-pointer" } */
-
-static struct table { int x; } table[3];
-
-int test (void)
-{
-  struct table *t;
-
-  for (t = table; t < &table[3]; t++)
-    asm volatile ("" : : : "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12");
-
-  for (t = table; t < &table[3]; t++)
-    if (t->x)
-      return 1;
-
-  return 0;
-}
-
diff --git a/gcc/testsuite/gcc.dg/20041216-1.c b/gcc/testsuite/gcc.dg/20041216-1.c
deleted file mode 100644 (file)
index 3f892a2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This test case would get an unresolved symbol during link
-   because stabs referred to an optimized-away literal pool
-   entry.  */
-
-/* { dg-do run { target s390*-*-* } } */
-/* { dg-options "-O2 -fno-omit-frame-pointer -gstabs" } */
-
-int main (void)
-{
-  static char buf[4096];
-  char *p;
-
-  do
-    {
-      p = buf;
-      asm volatile ("" : : : "memory", "0", "1", "2", "3", "4", "5", "6",
-                                      "7", "8", "9", "10", "12");
-    }
-  while (*p);
-
-  return 0;
-}
-
diff --git a/gcc/testsuite/gcc.dg/20050409-1.c b/gcc/testsuite/gcc.dg/20050409-1.c
deleted file mode 100644 (file)
index be85f71..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This used to ICE due to a regmove problem on s390.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O2" } */
-
-
-extern void abort (void);
-extern void **alloc (void);
-
-void *test (void)
-{
-  void **p = alloc ();
-  if (!p) abort ();
-
-  __builtin_set_thread_pointer (p);
-  return *p;
-}
-
diff --git a/gcc/testsuite/gcc.dg/20050524-1.c b/gcc/testsuite/gcc.dg/20050524-1.c
deleted file mode 100644 (file)
index f15c51d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This test case used to abort due to a reload bug with
-   elimination offsets.  */
-
-/* { dg-do run { target s390*-*-* } } */
-/* { dg-options "-O2 -mpacked-stack" } */
-
-extern void abort (void);
-
-double bar (double) __attribute__ ((noinline));
-double bar (double x) { return x; }
-
-double
-foo (int j, double f0, double f2, double f4, double f6, double x) __attribute__ ((noinline));
-
-double
-foo (int j, double f0, double f2, double f4, double f6, double x)
-{
-  if (j)
-    return bar (x) + 4.0;
-  else
-    return bar (x);
-}
-
-int
-main (void)
-{
-  if (foo (0, 0, 0, 0, 0, 10) != 10)
-    abort ();
-  if (foo (1, 0, 0, 0, 0, 10) != 14)
-    abort ();
-
-  return 0;
-}
-
diff --git a/gcc/testsuite/gcc.dg/20050824-1.c b/gcc/testsuite/gcc.dg/20050824-1.c
deleted file mode 100644 (file)
index 4df79fb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Make sure that the S/390 specific shift_count_operand
-   predicate work properly.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O3" } */
-
-unsigned long long
-f (unsigned long long a, unsigned long b)
-{
-  asm ("" : : : 
-#ifdef __s390x__
-               "r13", "r14",
-#endif
-               "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", 
-                "r8", "r9", "r10", "r11", "r12");
-
-  return a << ((b + 3) & 63);
-}
-
-unsigned long long
-g (unsigned long long a, char **b , int c, int d, int e, int f)
-{
-  char buffer [4096];
-
-  *b = &buffer[0];
-
-  return a << ((unsigned long)&f & 63);
-}
-
-unsigned long long
-h (unsigned long long a, int b, int c, int d, int e, int f)
-{
-  return a << (((unsigned long)&f + 3));
-}
diff --git a/gcc/testsuite/gcc.dg/pr20927.c b/gcc/testsuite/gcc.dg/pr20927.c
deleted file mode 100644 (file)
index 55cda33..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This caused an ICE on s390x due to a reload inheritance bug.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O2" } */
-
-struct point { double x, y; };
-extern void use (struct point);
-
-void test (struct point *pc, struct point p1)
-{
-  struct point p0 = *pc;
-
-  if (p0.x == p1.x && p0.y == p1.y)
-    use (p0);
-
-  asm ("" : : : "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10");
-
-  p1.y -= p0.y;
-
-  use (p0);
-  use (p1);
-}
-
diff --git a/gcc/testsuite/gcc.dg/pr24624.c b/gcc/testsuite/gcc.dg/pr24624.c
deleted file mode 100644 (file)
index fbfab0a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This used to ICE due to a backend problem on s390.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O1 -mpacked-stack" } */
-
-typedef unsigned int __u32;
-typedef struct
-{
-  volatile int counter;
-} __attribute__ ((aligned (4))) atomic_t;
-static __inline__ __attribute__ ((always_inline))
-     void atomic_inc (volatile atomic_t * v)
-{
-  (
-    {
-    typeof (v->counter) old_val, new_val;
-  __asm__ __volatile__ (
-       "   l     %0,0(%3)\n" 
-       "0: lr    %1,%0\n" 
-       "   ar    %1,%4\n" 
-       "   cs    %0,%1,0(%3)\n" 
-       "   jl    0b": 
-       "=&d" (old_val), "=&d" (new_val), "=m" (((atomic_t *) (v))->counter): 
-       "a" (v), "d" (1), "m" (((atomic_t *) (v))->counter):
-       "cc", "memory");
-    });
-}
-extern unsigned long volatile __attribute__ ((section (".data"))) jiffies;
-struct inet_peer
-{
-  unsigned long dtime;
-  atomic_t refcnt;
-};
-static volatile int peer_total;
-int inet_peer_threshold = 65536 + 128;
-int inet_peer_minttl = 120 * 100;
-int inet_peer_maxttl = 10 * 60 * 100;
-static int
-cleanup_once (unsigned long ttl)
-{
-  struct inet_peer *p;
-  if (p != ((void *) 0))
-    {
-      if (((
-            {
-            1;}
-          ) && ((long) (jiffies) - (long) (p->dtime + ttl) < 0)))
-       {
-         return -1;
-       }
-      atomic_inc (&p->refcnt);
-    }
-}
-struct inet_peer *
-inet_getpeer (__u32 daddr, int create)
-{
-  int i;
-  int ttl;
-  if (peer_total >= inet_peer_threshold)
-    ttl = inet_peer_minttl;
-  else
-    ttl =
-      inet_peer_maxttl - (inet_peer_maxttl -
-                         inet_peer_minttl) / 100 * peer_total /
-      inet_peer_threshold * 100;
-  for (i = 0; i < 30 && !cleanup_once (ttl); i++);
-}
diff --git a/gcc/testsuite/gcc.dg/pr27661.c b/gcc/testsuite/gcc.dg/pr27661.c
deleted file mode 100644 (file)
index 7660c82..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* This used to ICE on s390 due to a reload bug.  */
-
-/* { dg-do compile { target s390*-*-* } } */
-/* { dg-options "-O2 -march=z990 -ftracer" } */
-
-extern int memcmp (const void *s1, const void *s2, unsigned long n);
-extern int printf (__const char *__restrict __format, ...);
-
-struct test
-{
-  char tmp[4096];
-  char msgtype[2];
-};
-
-void test (struct test *testtb)
-{
-  if (testtb)
-    printf ("a");
-
-  if (memcmp(testtb->msgtype, "a", 2))
-    printf ("a");
-
-  printf ("b");
-}
-
diff --git a/gcc/testsuite/gcc.target/s390/20020926-1.c b/gcc/testsuite/gcc.target/s390/20020926-1.c
new file mode 100644 (file)
index 0000000..07106a6
--- /dev/null
@@ -0,0 +1,14 @@
+/* Make sure that LEGITIMIZE_ADDRESS is called to handle
+   negative displacements.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -mesa" } */
+
+int test (int *addr)
+{
+  return *(addr - 1);
+}
+
+/* { dg-final { scan-assembler "-4096" } } */
+/* { dg-final { scan-assembler-not "ahi" } } */
+
diff --git a/gcc/testsuite/gcc.target/s390/20030123-1.c b/gcc/testsuite/gcc.target/s390/20030123-1.c
new file mode 100644 (file)
index 0000000..96ac6f7
--- /dev/null
@@ -0,0 +1,19 @@
+/* This used to ICE due to a reload bug on s390*.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-omit-frame-pointer" } */
+
+extern void *alloca (__SIZE_TYPE__);
+
+void func (char *p);
+
+void test (void)
+{
+   char *p = alloca (4096);
+   long idx;
+
+   asm ("" : "=r" (idx) : : "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12");
+
+   func (p + idx + 1);
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/20030129-1.c b/gcc/testsuite/gcc.target/s390/20030129-1.c
new file mode 100644 (file)
index 0000000..1cbd8b4
--- /dev/null
@@ -0,0 +1,37 @@
+/* This used to ICE due to a reload bug on s390*.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int f (unsigned int);
+void g (void *);
+
+void test (void *p, void *dummy)
+{
+  unsigned int flags = 0;
+
+  if (dummy)
+    g (dummy);
+
+  if (p)
+    flags |= 0x80000000;
+
+  asm volatile ("" : : : "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
+
+  if (dummy)
+    g (dummy);
+
+  if (p) 
+    {
+      flags |= 0x20000000|0x80000000;
+
+      if (!f (0))
+        flags &= ~0x80000000;
+    }
+
+  f (flags);
+
+  if (dummy)
+    g (dummy);
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/20040305-1.c b/gcc/testsuite/gcc.target/s390/20040305-1.c
new file mode 100644 (file)
index 0000000..a241f04
--- /dev/null
@@ -0,0 +1,53 @@
+
+/* The testcase failed due to corrupted alias information.
+   During the crossjump analyzing step the mem alias info of the
+   st instructions are merged and get copied during basic block
+   reordering which leads to an insn with wrong alias info.
+   The scheduler afterwards exchanges the mvc and st instructions 
+   not recognizing the anti dependence.  */
+/* { dg-do run } */
+/* { dg-options "-O3 -mtune=z990 -fno-inline" } */
+
+extern void exit (int);
+extern void abort (void);
+
+int f;
+int g;
+int h;
+
+int* x  = &f;
+int* p1 = &g;
+int* p2 = &h;
+
+int
+foo(void)
+{
+
+  if (*x == 0)
+    {
+      x = p1;         /* mvc - memory to memory */
+      p1 = (int*)0;   /* st  - register to memory */
+      return 1;
+    }
+  if (*x == 5)
+    {
+      f = 1;
+      g = 2;
+
+      p2 = (int*)0;   /* st */   
+      return 1;
+    }
+}
+
+int
+main (int argc, char** argv)
+{
+  foo ();
+
+  /* If the scheduler has exchanged the mvc and st instructions,
+     x is 0. The expected result is &g.  */
+  if (x == &g)
+    exit (0);
+  else
+    abort ();
+}
diff --git a/gcc/testsuite/gcc.target/s390/20041109-1.c b/gcc/testsuite/gcc.target/s390/20041109-1.c
new file mode 100644 (file)
index 0000000..bf76843
--- /dev/null
@@ -0,0 +1,21 @@
+/* This used to ICE due to a literal pool handling bug on s390x.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-omit-frame-pointer" } */
+
+static struct table { int x; } table[3];
+
+int test (void)
+{
+  struct table *t;
+
+  for (t = table; t < &table[3]; t++)
+    asm volatile ("" : : : "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "12");
+
+  for (t = table; t < &table[3]; t++)
+    if (t->x)
+      return 1;
+
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/20041216-1.c b/gcc/testsuite/gcc.target/s390/20041216-1.c
new file mode 100644 (file)
index 0000000..492ee6c
--- /dev/null
@@ -0,0 +1,23 @@
+/* This test case would get an unresolved symbol during link
+   because stabs referred to an optimized-away literal pool
+   entry.  */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-omit-frame-pointer -gstabs" } */
+
+int main (void)
+{
+  static char buf[4096];
+  char *p;
+
+  do
+    {
+      p = buf;
+      asm volatile ("" : : : "memory", "0", "1", "2", "3", "4", "5", "6",
+                                      "7", "8", "9", "10", "12");
+    }
+  while (*p);
+
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/20050409-1.c b/gcc/testsuite/gcc.target/s390/20050409-1.c
new file mode 100644 (file)
index 0000000..4763afa
--- /dev/null
@@ -0,0 +1,18 @@
+/* This used to ICE due to a regmove problem on s390.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+
+extern void abort (void);
+extern void **alloc (void);
+
+void *test (void)
+{
+  void **p = alloc ();
+  if (!p) abort ();
+
+  __builtin_set_thread_pointer (p);
+  return *p;
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/20050524-1.c b/gcc/testsuite/gcc.target/s390/20050524-1.c
new file mode 100644 (file)
index 0000000..7b94fd0
--- /dev/null
@@ -0,0 +1,34 @@
+/* This test case used to abort due to a reload bug with
+   elimination offsets.  */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -mpacked-stack" } */
+
+extern void abort (void);
+
+double bar (double) __attribute__ ((noinline));
+double bar (double x) { return x; }
+
+double
+foo (int j, double f0, double f2, double f4, double f6, double x) __attribute__ ((noinline));
+
+double
+foo (int j, double f0, double f2, double f4, double f6, double x)
+{
+  if (j)
+    return bar (x) + 4.0;
+  else
+    return bar (x);
+}
+
+int
+main (void)
+{
+  if (foo (0, 0, 0, 0, 0, 10) != 10)
+    abort ();
+  if (foo (1, 0, 0, 0, 0, 10) != 14)
+    abort ();
+
+  return 0;
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/20050824-1.c b/gcc/testsuite/gcc.target/s390/20050824-1.c
new file mode 100644 (file)
index 0000000..c24e1e2
--- /dev/null
@@ -0,0 +1,34 @@
+/* Make sure that the S/390 specific shift_count_operand
+   predicate work properly.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+unsigned long long
+f (unsigned long long a, unsigned long b)
+{
+  asm ("" : : : 
+#ifdef __s390x__
+               "r13", "r14",
+#endif
+               "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", 
+                "r8", "r9", "r10", "r11", "r12");
+
+  return a << ((b + 3) & 63);
+}
+
+unsigned long long
+g (unsigned long long a, char **b , int c, int d, int e, int f)
+{
+  char buffer [4096];
+
+  *b = &buffer[0];
+
+  return a << ((unsigned long)&f & 63);
+}
+
+unsigned long long
+h (unsigned long long a, int b, int c, int d, int e, int f)
+{
+  return a << (((unsigned long)&f + 3));
+}
diff --git a/gcc/testsuite/gcc.target/s390/pr20927.c b/gcc/testsuite/gcc.target/s390/pr20927.c
new file mode 100644 (file)
index 0000000..dbc990f
--- /dev/null
@@ -0,0 +1,23 @@
+/* This caused an ICE on s390x due to a reload inheritance bug.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct point { double x, y; };
+extern void use (struct point);
+
+void test (struct point *pc, struct point p1)
+{
+  struct point p0 = *pc;
+
+  if (p0.x == p1.x && p0.y == p1.y)
+    use (p0);
+
+  asm ("" : : : "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10");
+
+  p1.y -= p0.y;
+
+  use (p0);
+  use (p1);
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/pr24624.c b/gcc/testsuite/gcc.target/s390/pr24624.c
new file mode 100644 (file)
index 0000000..bc2070c
--- /dev/null
@@ -0,0 +1,67 @@
+/* This used to ICE due to a backend problem on s390.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -mpacked-stack" } */
+
+typedef unsigned int __u32;
+typedef struct
+{
+  volatile int counter;
+} __attribute__ ((aligned (4))) atomic_t;
+static __inline__ __attribute__ ((always_inline))
+     void atomic_inc (volatile atomic_t * v)
+{
+  (
+    {
+    typeof (v->counter) old_val, new_val;
+  __asm__ __volatile__ (
+       "   l     %0,0(%3)\n" 
+       "0: lr    %1,%0\n" 
+       "   ar    %1,%4\n" 
+       "   cs    %0,%1,0(%3)\n" 
+       "   jl    0b": 
+       "=&d" (old_val), "=&d" (new_val), "=m" (((atomic_t *) (v))->counter): 
+       "a" (v), "d" (1), "m" (((atomic_t *) (v))->counter):
+       "cc", "memory");
+    });
+}
+extern unsigned long volatile __attribute__ ((section (".data"))) jiffies;
+struct inet_peer
+{
+  unsigned long dtime;
+  atomic_t refcnt;
+};
+static volatile int peer_total;
+int inet_peer_threshold = 65536 + 128;
+int inet_peer_minttl = 120 * 100;
+int inet_peer_maxttl = 10 * 60 * 100;
+static int
+cleanup_once (unsigned long ttl)
+{
+  struct inet_peer *p;
+  if (p != ((void *) 0))
+    {
+      if (((
+            {
+            1;}
+          ) && ((long) (jiffies) - (long) (p->dtime + ttl) < 0)))
+       {
+         return -1;
+       }
+      atomic_inc (&p->refcnt);
+    }
+}
+struct inet_peer *
+inet_getpeer (__u32 daddr, int create)
+{
+  int i;
+  int ttl;
+  if (peer_total >= inet_peer_threshold)
+    ttl = inet_peer_minttl;
+  else
+    ttl =
+      inet_peer_maxttl - (inet_peer_maxttl -
+                         inet_peer_minttl) / 100 * peer_total /
+      inet_peer_threshold * 100;
+  for (i = 0; i < 30 && !cleanup_once (ttl); i++);
+}
diff --git a/gcc/testsuite/gcc.target/s390/pr27661.c b/gcc/testsuite/gcc.target/s390/pr27661.c
new file mode 100644 (file)
index 0000000..1ff6dcc
--- /dev/null
@@ -0,0 +1,25 @@
+/* This used to ICE on s390 due to a reload bug.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=z990 -ftracer" } */
+
+extern int memcmp (const void *s1, const void *s2, unsigned long n);
+extern int printf (__const char *__restrict __format, ...);
+
+struct test
+{
+  char tmp[4096];
+  char msgtype[2];
+};
+
+void test (struct test *testtb)
+{
+  if (testtb)
+    printf ("a");
+
+  if (memcmp(testtb->msgtype, "a", 2))
+    printf ("a");
+
+  printf ("b");
+}
+
diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp
new file mode 100644 (file)
index 0000000..d693309
--- /dev/null
@@ -0,0 +1,41 @@
+# 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 3 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 GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a s390 target.
+if ![istarget s390*-*-*] then {
+  return
+}
+
+# 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