aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-1-v10.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-1-v32.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-2i.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-2s.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-3i.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-3s.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-4i.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-4s.c1
-rw-r--r--gcc/testsuite/gcc.target/cris/sync-xchg-1.c21
10 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c6506ab..1d00a62 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.target/cris/sync-1-v10.c b/gcc/testsuite/gcc.target/cris/sync-1-v10.c
index 640098a..6c8dd1a 100644
--- a/gcc/testsuite/gcc.target/cris/sync-1-v10.c
+++ b/gcc/testsuite/gcc.target/cris/sync-1-v10.c
@@ -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"
diff --git a/gcc/testsuite/gcc.target/cris/sync-1-v32.c b/gcc/testsuite/gcc.target/cris/sync-1-v32.c
index 644d922..3c1d076 100644
--- a/gcc/testsuite/gcc.target/cris/sync-1-v32.c
+++ b/gcc/testsuite/gcc.target/cris/sync-1-v32.c
@@ -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"
diff --git a/gcc/testsuite/gcc.target/cris/sync-2i.c b/gcc/testsuite/gcc.target/cris/sync-2i.c
index e43aa53..d491d3c 100644
--- a/gcc/testsuite/gcc.target/cris/sync-2i.c
+++ b/gcc/testsuite/gcc.target/cris/sync-2i.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-2s.c b/gcc/testsuite/gcc.target/cris/sync-2s.c
index 9be7dc6..06ff98a 100644
--- a/gcc/testsuite/gcc.target/cris/sync-2s.c
+++ b/gcc/testsuite/gcc.target/cris/sync-2s.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-3i.c b/gcc/testsuite/gcc.target/cris/sync-3i.c
index 114e0a8..9e67d61c 100644
--- a/gcc/testsuite/gcc.target/cris/sync-3i.c
+++ b/gcc/testsuite/gcc.target/cris/sync-3i.c
@@ -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 *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-3s.c b/gcc/testsuite/gcc.target/cris/sync-3s.c
index facbb39..8e87a3b 100644
--- a/gcc/testsuite/gcc.target/cris/sync-3s.c
+++ b/gcc/testsuite/gcc.target/cris/sync-3s.c
@@ -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 *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-4i.c b/gcc/testsuite/gcc.target/cris/sync-4i.c
index 9756c69..78a7012 100644
--- a/gcc/testsuite/gcc.target/cris/sync-4i.c
+++ b/gcc/testsuite/gcc.target/cris/sync-4i.c
@@ -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" } } */
diff --git a/gcc/testsuite/gcc.target/cris/sync-4s.c b/gcc/testsuite/gcc.target/cris/sync-4s.c
index 2d644303..6691a48 100644
--- a/gcc/testsuite/gcc.target/cris/sync-4s.c
+++ b/gcc/testsuite/gcc.target/cris/sync-4s.c
@@ -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
index 0000000..21bb7d4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/cris/sync-xchg-1.c
@@ -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);
+}