sync-1-v10.c, [...]: New tests.
authorHans-Peter Nilsson <hp@axis.com>
Fri, 1 Jun 2012 05:51:07 +0000 (05:51 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Fri, 1 Jun 2012 05:51:07 +0000 (05:51 +0000)
* gcc.target/cris/sync-1-v10.c,
gcc.target/cris/sync-1-v32.c, gcc.target/cris/sync-1.c,
gcc.target/cris/sync-2c.c, gcc.target/cris/sync-2i.c,
gcc.target/cris/sync-2s.c, gcc.target/cris/sync-3i.c,
gcc.target/cris/sync-3s.c, gcc.target/cris/sync-4c.c,
gcc.target/cris/sync-4i.c, gcc.target/cris/sync-4s.c,
gcc.target/cris/torture/sync-mis-op-i-1.c,
gcc.target/cris/torture/sync-mis-op-i-1a.c,
gcc.target/cris/torture/sync-mis-op-i-2.c,
gcc.target/cris/torture/sync-mis-op-i-2a.c,
gcc.target/cris/torture/sync-mis-op-i-3.c,
gcc.target/cris/torture/sync-mis-op-i-3a.c,
gcc.target/cris/torture/sync-mis-op-s-1.c,
gcc.target/cris/torture/sync-mis-op-s-1a.c,
gcc.target/cris/torture/sync-mis-xchg-i-1.c,
gcc.target/cris/torture/sync-mis-xchg-i-1a.c,
gcc.target/cris/torture/sync-mis-xchg-i-2.c,
gcc.target/cris/torture/sync-mis-xchg-i-2a.c,
gcc.target/cris/torture/sync-mis-xchg-i-3.c,
gcc.target/cris/torture/sync-mis-xchg-i-3a.c,
gcc.target/cris/torture/sync-mis-xchg-s-1.c,
gcc.target/cris/torture/sync-mis-xchg-s-1a.c: New tests.

From-SVN: r188097

28 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/cris/sync-1-v10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-1-v32.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-2c.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-2i.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-2s.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-3i.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-3s.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-4c.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-4i.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/sync-4s.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c [new file with mode: 0644]

index 29ed833df4c247c29aef670dd64363d93f81caaa..c06dfd1670bf2107b77fca356eed0998cf49aa71 100644 (file)
@@ -1,3 +1,28 @@
+2012-06-01  Hans-Peter Nilsson  <hp@axis.com>
+
+       * gcc.target/cris/sync-1-v10.c,
+       gcc.target/cris/sync-1-v32.c, gcc.target/cris/sync-1.c,
+       gcc.target/cris/sync-2c.c, gcc.target/cris/sync-2i.c,
+       gcc.target/cris/sync-2s.c, gcc.target/cris/sync-3i.c,
+       gcc.target/cris/sync-3s.c, gcc.target/cris/sync-4c.c,
+       gcc.target/cris/sync-4i.c, gcc.target/cris/sync-4s.c,
+       gcc.target/cris/torture/sync-mis-op-i-1.c,
+       gcc.target/cris/torture/sync-mis-op-i-1a.c,
+       gcc.target/cris/torture/sync-mis-op-i-2.c,
+       gcc.target/cris/torture/sync-mis-op-i-2a.c,
+       gcc.target/cris/torture/sync-mis-op-i-3.c,
+       gcc.target/cris/torture/sync-mis-op-i-3a.c,
+       gcc.target/cris/torture/sync-mis-op-s-1.c,
+       gcc.target/cris/torture/sync-mis-op-s-1a.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-1.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-1a.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-2.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-2a.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-3.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-3a.c,
+       gcc.target/cris/torture/sync-mis-xchg-s-1.c,
+       gcc.target/cris/torture/sync-mis-xchg-s-1a.c: New tests.
+
 2012-05-31  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/ldist-pr45948-2.c: New testcase copy of
diff --git a/gcc/testsuite/gcc.target/cris/sync-1-v10.c b/gcc/testsuite/gcc.target/cris/sync-1-v10.c
new file mode 100644 (file)
index 0000000..640098a
--- /dev/null
@@ -0,0 +1,4 @@
+/* Check that we can assemble both base atomic variants.  */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -march=v10" } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-1-v32.c b/gcc/testsuite/gcc.target/cris/sync-1-v32.c
new file mode 100644 (file)
index 0000000..644d922
--- /dev/null
@@ -0,0 +1,4 @@
+/* Check that we can assemble both base atomic variants.  */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -march=v32" } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-1.c b/gcc/testsuite/gcc.target/cris/sync-1.c
new file mode 100644 (file)
index 0000000..1bc9a67
--- /dev/null
@@ -0,0 +1,35 @@
+/* Check that we can assemble both base atomic variants, for v0.  */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -march=v0" } */
+
+#ifndef type
+#define type char
+#endif
+
+#if !defined(op) && !defined(xchg)
+#define op 1
+#define xchg 1
+#endif
+
+#ifndef op
+#define op 0
+#endif
+
+#ifndef xchg
+#define xchg 0
+#endif
+
+#if op
+int sfa (type *p, type *q, int a)
+{
+  return __atomic_fetch_nand (p, a, __ATOMIC_ACQ_REL)
+    + __atomic_fetch_add (q, a, __ATOMIC_SEQ_CST);
+}
+#endif
+
+#if xchg
+void acen (type *ptr, type *val, type *ret)
+{
+  __atomic_exchange (ptr, val, ret, __ATOMIC_SEQ_CST);
+}
+#endif
diff --git a/gcc/testsuite/gcc.target/cris/sync-2c.c b/gcc/testsuite/gcc.target/cris/sync-2c.c
new file mode 100644 (file)
index 0000000..80e646c
--- /dev/null
@@ -0,0 +1,8 @@
+/* Check that we don't get alignment-checking code, char.  */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
+/* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-2i.c b/gcc/testsuite/gcc.target/cris/sync-2i.c
new file mode 100644 (file)
index 0000000..e43aa53
--- /dev/null
@@ -0,0 +1,9 @@
+/* Check that we get the expected alignment-checking code, op variant, int.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Dop -Dtype=int" } */
+/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-final { scan-assembler "\tbreak 8" } } */
+/* { dg-final { scan-assembler "\tbtstq \\(2-1\\)," } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-2s.c b/gcc/testsuite/gcc.target/cris/sync-2s.c
new file mode 100644 (file)
index 0000000..9be7dc6
--- /dev/null
@@ -0,0 +1,9 @@
+/* Check that we get the expected alignment-checking code, op variant, short.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Dop -Dtype=short" } */
+/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-final { scan-assembler "\tbreak 8" } } */
+/* { dg-final { scan-assembler "\tbtstq \\(1-1\\)," } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-3i.c b/gcc/testsuite/gcc.target/cris/sync-3i.c
new file mode 100644 (file)
index 0000000..114e0a8
--- /dev/null
@@ -0,0 +1,11 @@
+/* Check that we get the expected alignment-checking code, xchg variant, int.
+   Unfortunately, PRE moves the "and" to a different BB, so combine doesn't
+   see it with the compare to make it a btstq.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Dxchg -Dtype=int" } */
+/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-final { scan-assembler "\tbreak 8" } } */
+/* { dg-final { scan-assembler "\tbtstq \\(2-1\\)," { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "\tand" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-3s.c b/gcc/testsuite/gcc.target/cris/sync-3s.c
new file mode 100644 (file)
index 0000000..facbb39
--- /dev/null
@@ -0,0 +1,11 @@
+/* Check that we get the expected alignment-checking code, xchg variant, short.
+   Unfortunately, PRE moves the "and" to a different BB, so combine doesn't
+   see it with the compare to make it a btstq.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Dxchg -Dtype=short" } */
+/* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-final { scan-assembler "\tbreak 8" } } */
+/* { dg-final { scan-assembler "\tbtstq \\(1-1\\)," { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "\tand" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-4c.c b/gcc/testsuite/gcc.target/cris/sync-4c.c
new file mode 100644 (file)
index 0000000..e8cb692
--- /dev/null
@@ -0,0 +1,8 @@
+/* Check that we get don't alignment-checking code, xchg variant, char.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-trap-unaligned-atomic" } */
+/* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
+/* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-4i.c b/gcc/testsuite/gcc.target/cris/sync-4i.c
new file mode 100644 (file)
index 0000000..9756c69
--- /dev/null
@@ -0,0 +1,8 @@
+/* Check that we don't get alignment-checking code, int.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Dtype=int -mno-trap-unaligned-atomic" } */
+/* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
+/* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/sync-4s.c b/gcc/testsuite/gcc.target/cris/sync-4s.c
new file mode 100644 (file)
index 0000000..2d64430
--- /dev/null
@@ -0,0 +1,8 @@
+/* Check that we don't get alignment-checking code, short.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Dtype=short -mno-trap-unaligned-atomic" } */
+/* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
+/* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\t\[jb\]sr" } } */
+#include "sync-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1.c
new file mode 100644 (file)
index 0000000..733ec4b
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1a.c
new file mode 100644 (file)
index 0000000..4cd2333
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2.c
new file mode 100644 (file)
index 0000000..97d0bf0
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=2" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2a.c
new file mode 100644 (file)
index 0000000..3596e9e
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3.c
new file mode 100644 (file)
index 0000000..0747946
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=3" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3a.c
new file mode 100644 (file)
index 0000000..46a04f4
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1.c
new file mode 100644 (file)
index 0000000..21b5269
--- /dev/null
@@ -0,0 +1,111 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=short" } */
+
+/* Make sure we get a SIGTRAP or equivalent when passing unaligned
+   but otherwise valid pointers to the atomic builtins.  */
+
+#include <signal.h>
+#include <stdlib.h>
+
+#ifndef type
+#error type not defined
+#endif
+
+#ifndef op
+#define op 0
+#endif
+
+#ifndef xchg
+#define xchg 0
+#endif
+
+#if op
+int sfa (type *p, type *q, int a);
+#endif
+
+#if xchg
+void acen (type *ptr, type *val, type *ret);
+#endif
+
+#ifndef misalignment
+#define misalignment 1
+#endif
+
+volatile int trap_expected = 0;
+
+struct { char x[misalignment]; type i; } s __attribute__ ((__aligned__ (4)))
+  = { {0}, (type) 0xdeadbeef };
+type x = 2;
+type ret = 42;
+
+#ifdef TRAP_USING_ABORT
+#define SYMSTR(x) STR1(__USER_LABEL_PREFIX__, x)
+#define STR1(x,y) STR2(x, y)
+#define STR2(x,y) #x #y
+/* LTO requires marking seemingly-unused-but-used global functions.  */
+void my_abort (void) __asm__ (SYMSTR (abort)) __attribute__ ((__used__));
+void my_abort (void)
+#else
+#ifdef __gnu_linux__
+void trap_handler(int signum)
+#else
+#error "can't catch break 8"
+#endif
+#endif
+{
+  if (1
+#ifndef TRAP_USING_ABORT
+      && signum == SIGTRAP
+#endif
+      && trap_expected
+      && s.i == (type) 0xdeadbeef
+      && x == 2 && ret == 42)
+    exit (0);
+
+#ifdef TRAP_USING_ABORT
+  /* We might be able to trust the exit-value getting through, but add
+     a NULL-dereference SEGV just in case.  Make sure gcc doesn't
+     understand the NULL.  */
+  *({ int *p; asm ("" : "=rm" (p) : "0" (0)); p; }) = 0xdead;
+  exit (2);
+#else
+  abort ();
+#endif
+}
+
+int main(void)
+{
+  type x = 0;
+  type ret;
+
+#ifndef TRAP_USING_ABORT
+#ifdef __gnu_linux__
+  if (signal (SIGTRAP, trap_handler) == SIG_ERR)
+    abort ();
+#endif
+#endif
+
+  trap_expected = 1;
+
+#if op
+  sfa (&s.i, &s.i, 42);
+
+  /* We should have fallen into the trap now.  But don't call abort
+     yet: if the trap is implemented as a call to abort, we have to
+     tell the difference.  Set a global variable *and* make sure the
+     setting isn't eliminated by optimizers: another call to sfa
+     should do it.  */
+  trap_expected = 0;
+
+  sfa (&x, &x, 1);
+#else
+  acen (&s.i, &x, &ret);
+
+  trap_expected = 0;
+
+  acen (&x, &x, &ret);
+#endif
+
+  abort ();
+}
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1a.c
new file mode 100644 (file)
index 0000000..fc91e7c
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=short -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1.c
new file mode 100644 (file)
index 0000000..1072cac
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1a.c
new file mode 100644 (file)
index 0000000..af6ef8a
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2.c
new file mode 100644 (file)
index 0000000..b02f487
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2a.c
new file mode 100644 (file)
index 0000000..8c79184
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3.c
new file mode 100644 (file)
index 0000000..637aecf
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3a.c
new file mode 100644 (file)
index 0000000..e7c90a3
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1.c
new file mode 100644 (file)
index 0000000..7374285
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=short" } */
+#include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1a.c
new file mode 100644 (file)
index 0000000..5dcef52
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=short -DTRAP_USING_ABORT -mno-trap-using-break8" } */
+/* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */
+#include "sync-mis-op-s-1.c"