]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sync-2i.c, [...]: For cris*-*-linux*, also pass -mno-unaligned-atomic-may-use-library.
authorHans-Peter Nilsson <hp@axis.com>
Mon, 16 Jul 2012 03:21:47 +0000 (03:21 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 16 Jul 2012 03:21:47 +0000 (03:21 +0000)
* 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-4i.c, gcc.target/cris/sync-4s.c,
gcc.target/cris/sync-1-v10.c,
gcc.target/cris/sync-1-v32.c: For cris*-*-linux*, also
pass -mno-unaligned-atomic-may-use-library.
* gcc.target/cris/sync-xchg-1.c: New test.

From-SVN: r189505

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/cris/sync-1-v10.c
gcc/testsuite/gcc.target/cris/sync-1-v32.c
gcc/testsuite/gcc.target/cris/sync-2i.c
gcc/testsuite/gcc.target/cris/sync-2s.c
gcc/testsuite/gcc.target/cris/sync-3i.c
gcc/testsuite/gcc.target/cris/sync-3s.c
gcc/testsuite/gcc.target/cris/sync-4i.c
gcc/testsuite/gcc.target/cris/sync-4s.c
gcc/testsuite/gcc.target/cris/sync-xchg-1.c [new file with mode: 0644]

index c6506abd66fd37fac0d0378fb885be3b265cb972..1d00a6269c264162fe474e7a216310b46123d540 100644 (file)
@@ -1,5 +1,12 @@
 2012-07-16  Hans-Peter Nilsson  <hp@axis.com>
 
+       * 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-4i.c, gcc.target/cris/sync-4s.c,
+       gcc.target/cris/sync-1-v10.c,
+       gcc.target/cris/sync-1-v32.c: For cris*-*-linux*, also
+       pass -mno-unaligned-atomic-may-use-library.
+       * gcc.target/cris/sync-xchg-1.c: New test.
        * gcc.target/cris/20011127-1.c: Adjust to %P being a
        valid register operand output modifier.
 
index 640098a96db77fb6a0ae013974a411c4b1c489e6..6c8dd1a407dce69d8de0d6a5606bd1b4d049df46 100644 (file)
@@ -1,4 +1,5 @@
 /* Check that we can assemble both base atomic variants.  */
 /* { dg-do assemble } */
 /* { dg-options "-O2 -march=v10" } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-1.c"
index 644d922a3dbf2aa276ca168d67e0f9636cd6b608..3c1d076ab7843d42c99abbd29cb7c5a1e873dccc 100644 (file)
@@ -1,4 +1,5 @@
 /* Check that we can assemble both base atomic variants.  */
 /* { dg-do assemble } */
 /* { dg-options "-O2 -march=v32" } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-1.c"
index e43aa5356f5400ae0bb5d833338b6446265b0ea8..d491d3c08696fb2e83aa05aeb1dc4596c8f927ad 100644 (file)
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Dop -Dtype=int" } */
 /* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 /* { dg-final { scan-assembler "\tbreak 8" } } */
 /* { dg-final { scan-assembler "\tbtstq \\(2-1\\)," } } */
 /* { dg-final { scan-assembler-not "\tand" } } */
index 9be7dc6bcb54f466246bb02bda995638b530145b..06ff98a2769a7538b960e733cdf828a34dd6d726 100644 (file)
@@ -2,6 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Dop -Dtype=short" } */
 /* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 /* { dg-final { scan-assembler "\tbreak 8" } } */
 /* { dg-final { scan-assembler "\tbtstq \\(1-1\\)," } } */
 /* { dg-final { scan-assembler-not "\tand" } } */
index 114e0a846e8055b7d80ed3d6abf2ab91b58b02ba..9e67d61cb35440e6c8fcd798c809a6ed398a0743 100644 (file)
@@ -4,6 +4,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Dxchg -Dtype=int" } */
 /* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 /* { dg-final { scan-assembler "\tbreak 8" } } */
 /* { dg-final { scan-assembler "\tbtstq \\(2-1\\)," { xfail *-*-* } } } */
 /* { dg-final { scan-assembler-not "\tand" { xfail *-*-* } } } */
index facbb39ed945f969f846d78a5ebb818759951699..8e87a3b62216e62bb54efb6f9244c8fd4c2e6243 100644 (file)
@@ -4,6 +4,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Dxchg -Dtype=short" } */
 /* { dg-additional-options "-mtrap-using-break8 -mtrap-unaligned-atomic" { target cris-*-elf } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 /* { dg-final { scan-assembler "\tbreak 8" } } */
 /* { dg-final { scan-assembler "\tbtstq \\(1-1\\)," { xfail *-*-* } } } */
 /* { dg-final { scan-assembler-not "\tand" { xfail *-*-* } } } */
index 9756c6963864ba51b89cdea3200cbd533684c9f1..78a7012ccdb2ecc39749246b348c0b1f52217753 100644 (file)
@@ -1,6 +1,7 @@
 /* Check that we don't get alignment-checking code, int.  */
 /* { dg-do compile } */
 /* { dg-options "-O2 -Dtype=int -mno-trap-unaligned-atomic" } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 /* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
 /* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
 /* { dg-final { scan-assembler-not "\tand" } } */
index 2d644303a791e5725719d3a01ffd25c14285161f..6691a48283f6c55c73a936e2ccd3ef30f62a8408 100644 (file)
@@ -1,6 +1,7 @@
 /* Check that we don't get alignment-checking code, short.  */
 /* { dg-do compile } */
 /* { dg-options "-O2 -Dtype=short -mno-trap-unaligned-atomic" } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 /* { dg-final { scan-assembler-not "\tbreak\[ \t\]" } } */
 /* { dg-final { scan-assembler-not "\tbtstq\[ \t\]\[^5\]" } } */
 /* { dg-final { scan-assembler-not "\tand" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-xchg-1.c b/gcc/testsuite/gcc.target/cris/sync-xchg-1.c
new file mode 100644 (file)
index 0000000..21bb7d4
--- /dev/null
@@ -0,0 +1,21 @@
+/* Check that the basic library call variant is sane; no other calls, no
+   checks compares or branches.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -munaligned-atomic-may-use-library" } */
+/* { dg-final { scan-assembler-not "\tdi" } } */
+/* { dg-final { scan-assembler-not "\tbtstq" } } */
+/* { dg-final { scan-assembler-not "\tand" } } */
+/* { dg-final { scan-assembler-not "\tclearf" } } */
+/* { dg-final { scan-assembler-not "\tmove.d" } } */
+/* { dg-final { scan-assembler-not "\tcmp" } } */
+/* { dg-final { scan-assembler-not "\tb\[^s\]" } } */
+/* { dg-final { scan-assembler-times "\t\[JjBb\]sr" 1 } } */
+
+#ifndef type
+#define type int
+#endif
+
+type svcsw (type *ptr, type oldval, type newval)
+{
+  return __sync_val_compare_and_swap (ptr, oldval, newval);
+}