]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/testsuite/
authorolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Dec 2014 18:53:44 +0000 (18:53 +0000)
committerolegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Dec 2014 18:53:44 +0000 (18:53 +0000)
PR target/58314
* gcc.target/sh/torture/pr58314-2.c: New.
* gcc.target/sh/torture/pr58314.c: Don't set -Os option.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219030 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/torture/pr58314-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/sh/torture/pr58314.c

index e756a1738f055e621c1fd3421e0e4f20b86938ce..525937517fdb8e6b0c333f77f1b227114c5264d3 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-22  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/58314
+       * gcc.target/sh/torture/pr58314-2.c: New.
+       * gcc.target/sh/torture/pr58314.c: Don't set -Os option.
+
 2014-12-22  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/63363
        * gcc.dg/attr-isr.c: Move SH specific test to ...
        * gcc.target/sh/attr-isr.c: ... here.
 
->>>>>>> .r217525
 2014-10-17  Marek Polacek  <polacek@redhat.com>
 
        PR c/63567
diff --git a/gcc/testsuite/gcc.target/sh/torture/pr58314-2.c b/gcc/testsuite/gcc.target/sh/torture/pr58314-2.c
new file mode 100644 (file)
index 0000000..a617c6e
--- /dev/null
@@ -0,0 +1,160 @@
+/* { dg-do compile }  */
+
+struct unipair 
+{
+  unsigned short unicode;
+  unsigned short fontpos;
+};
+
+struct __large_struct
+{
+  unsigned long buf[100];
+};
+
+struct vc_data
+{
+  unsigned long *vc_uni_pagedir_loc;
+};
+
+struct uni_pagedir 
+{
+  unsigned short **uni_pgdir[32];
+};
+
+void con_get_unimap (struct vc_data *vc, unsigned short ct, unsigned short *uct,
+                    struct unipair *list)
+{
+  int i, j, k, ect;
+  unsigned short **p1, *p2;
+  struct uni_pagedir *p;
+
+  ect = 0;
+
+  if (*vc->vc_uni_pagedir_loc)
+  {
+    p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
+    for (i = 0; i < 32; i++)
+    if ((p1 = p->uni_pgdir[i]))
+    for (j = 0; j < 32; j++)
+    if ((p2 = *(p1++)))
+    for (k = 0; k < 64; k++)
+    {
+      if (*p2 < 512 && ect++ < ct)
+      {
+       {
+         long __pu_err;
+         __typeof__(*((&list->unicode))) *__pu_addr = ((&list->unicode));
+         __typeof__(*((&list->unicode))) __pu_val =
+               ((unsigned short)((i<<11)+(j<<6)+k));
+         __pu_err = 0;
+         switch ((sizeof(*(&list->unicode))))
+         {
+           case 1:
+               __asm__ __volatile__ (
+               "1:\n\t"
+                       "mov." "b" "    %1, %2\n\t"
+               "2:\n"
+               ".section       .fixup,\"ax\"\n"
+               "3:\n\t"
+                       "mov.l  4f, %0\n\t"
+                       "jmp    @%0\n\t"
+                       " mov   %3, %0\n\t"
+                       ".balign        4\n"
+               "4:     .long   2b\n\t"
+                       ".previous\n"
+               ".section       __ex_table,\"a\"\n\t"
+                       ".long  1b, 3b\n\t"
+                       ".previous"
+               : "=&r" (__pu_err)
+               : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))),
+                 "i" (-14), "0" (__pu_err) : "memory" );
+
+             break;
+
+           case 2:
+               __asm__ __volatile__ (
+               "1:\n\t"
+                       "mov." "w" "    %1, %2\n\t"
+               "2:\n"
+               ".section       .fixup,\"ax\"\n"
+               "3:\n\t"
+                       "mov.l  4f, %0\n\t"
+                       "jmp    @%0\n\t"
+                       " mov   %3, %0\n\t"
+                       ".balign        4\n"
+                       "4:     .long   2b\n\t"
+                       ".previous\n"
+               ".section       __ex_table,\"a\"\n\t"
+                       ".long  1b, 3b\n\t"
+                       ".previous"
+               : "=&r" (__pu_err)
+               : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))),
+                 "i" (-14), "0" (__pu_err) : "memory" );
+             break;
+
+           default:
+             break;
+         }
+       }
+
+
+       {
+         long __pu_err;
+         __typeof__(*((&list->fontpos))) *__pu_addr = ((&list->fontpos));
+         __typeof__(*((&list->fontpos))) __pu_val = ((unsigned short) *p2);
+         __pu_err = 0;
+         switch ((sizeof(*(&list->fontpos))))
+         {
+           case 1:
+               __asm__ __volatile__ (
+               "1:\n\t"
+                       "mov." "b" "    %1, %2\n\t"
+               "2:\n"
+               ".section       .fixup,\"ax\"\n"
+               "3:\n\t"
+                       "mov.l  4f, %0\n\t"
+                       "jmp    @%0\n\t"
+                       " mov   %3, %0\n\t"
+                       ".balign        4\n"
+                       "4:     .long   2b\n\t"
+                       ".previous\n"
+               ".section       __ex_table,\"a\"\n\t"
+                       ".long  1b, 3b\n\t"
+                       ".previous"
+               : "=&r" (__pu_err)
+               : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))),
+                 "i" (-14), "0" (__pu_err) : "memory" );
+             break;
+
+           case 2:
+             __asm__ __volatile__ (
+               "1:\n\t"
+                       "mov." "w" "    %1, %2\n\t"
+               "2:\n"
+                       ".section       .fixup,\"ax\"\n"
+               "3:\n\t"
+                       "mov.l  4f, %0\n\t"
+                       "jmp    @%0\n\t"
+                       " mov   %3, %0\n\t"
+               ".balign        4\n"
+                       "4:     .long   2b\n\t"
+               ".previous\n"
+               ".section       __ex_table,\"a\"\n\t"
+                       ".long  1b, 3b\n\t"
+                       ".previous"
+               : "=&r" (__pu_err)
+               : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))),
+                 "i" (-14), "0" (__pu_err) : "memory" );
+             break;
+
+           default:
+             break;
+         }
+       }
+
+        list++;
+      }
+      p2++;
+    }
+  }
+}
index 5f76b6af5c228b86c7d509b3ed0fd871dc5e6f59..88505467a233f643f59dcc568b5710b83a145982 100644 (file)
@@ -1,13 +1,15 @@
+/* { dg-additional-options "-std=gnu99" }  */
 /* { dg-do compile }  */
-/* { dg-options "-Os" } */
 
 typedef unsigned short __u16;
 typedef unsigned int __u32;
-
 typedef signed short s16;
 
 
-static inline __attribute__((always_inline)) __attribute__((__const__)) __u16 __arch_swab16(__u16 x)
+static inline 
+__attribute__((always_inline))
+__attribute__((__const__))
+__u16 __arch_swab16(__u16 x)
 {
  __asm__(
   "swap.b              %1, %0"