]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Handle recent changes in default atomics for cris*-*-linux*.
authorHans-Peter Nilsson <hp@axis.com>
Sun, 22 Jul 2012 15:45:07 +0000 (15:45 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sun, 22 Jul 2012 15:45:07 +0000 (15:45 +0000)
* gcc.target/cris/torture/sync-mis-xchg-i-1ml.c,
gcc.target/cris/torture/sync-mis-xchg-i-2ml.c,
gcc.target/cris/torture/sync-mis-xchg-i-3ml.c,
gcc.target/cris/torture/sync-mis-xchg-s-1ml.c,
gcc.target/cris/torture/sync-mis-op-i-1ml.c,
gcc.target/cris/torture/sync-mis-op-i-2ml.c,
gcc.target/cris/torture/sync-mis-op-i-3ml.c,
gcc.target/cris/torture/sync-mis-op-s-1ml.c: New tests.
* gcc.target/cris/torture/sync-mis-op-i-2a.c: Make sure
-mno-unaligned-atomic-may-use-library is in effect for
cris*-*-linux*.
* gcc.target/cris/torture/sync-mis-xchg-i-1.c,
gcc.target/cris/torture/sync-mis-xchg-i-2.c,
gcc.target/cris/torture/sync-mis-xchg-i-3.c,
gcc.target/cris/torture/sync-mis-xchg-i-2a.c,
gcc.target/cris/torture/sync-mis-xchg-s-1.c,
gcc.target/cris/torture/sync-mis-op-i-1.c,
gcc.target/cris/torture/sync-mis-op-i-2.c,
gcc.target/cris/torture/sync-mis-op-i-1a.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-1a.c,
gcc.target/cris/torture/sync-mis-xchg-i-1a.c,
gcc.target/cris/torture/sync-mis-xchg-i-3a.c,
gcc.target/cris/torture/sync-mis-xchg-s-1a.c: Similar.
* gcc.target/cris/torture/sync-mis-op-s-1.c: Ditto.
(main): Remove local variable x.
[mis_ok]: Check that atomics don't fail.

From-SVN: r189757

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

index 2731f8d26e3ebdd95aa3ca967bbbfdd38c5621aa..f2bb333adbea3328bff4b1e942b11b67915ccd28 100644 (file)
@@ -1,3 +1,35 @@
+2012-07-22  Hans-Peter Nilsson  <hp@axis.com>
+
+       Handle recent changes in default atomics for cris*-*-linux*.
+       * gcc.target/cris/torture/sync-mis-xchg-i-1ml.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-2ml.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-3ml.c,
+       gcc.target/cris/torture/sync-mis-xchg-s-1ml.c,
+       gcc.target/cris/torture/sync-mis-op-i-1ml.c,
+       gcc.target/cris/torture/sync-mis-op-i-2ml.c,
+       gcc.target/cris/torture/sync-mis-op-i-3ml.c,
+       gcc.target/cris/torture/sync-mis-op-s-1ml.c: New tests.
+       * gcc.target/cris/torture/sync-mis-op-i-2a.c: Make sure
+       -mno-unaligned-atomic-may-use-library is in effect for
+       cris*-*-linux*.
+       * gcc.target/cris/torture/sync-mis-xchg-i-1.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-2.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-3.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-2a.c,
+       gcc.target/cris/torture/sync-mis-xchg-s-1.c,
+       gcc.target/cris/torture/sync-mis-op-i-1.c,
+       gcc.target/cris/torture/sync-mis-op-i-2.c,
+       gcc.target/cris/torture/sync-mis-op-i-1a.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-1a.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-1a.c,
+       gcc.target/cris/torture/sync-mis-xchg-i-3a.c,
+       gcc.target/cris/torture/sync-mis-xchg-s-1a.c: Similar.
+       * gcc.target/cris/torture/sync-mis-op-s-1.c: Ditto.
+       (main): Remove local variable x.
+       [mis_ok]: Check that atomics don't fail.
+
 2012-07-21  Andrew Pinski  <apinski@cavium.com>
 
        *  gcc.dg/tree-ssa/vrp72.c: New test.
index 733ec4bac57b4df5e05892ad0b2af749e0a5af05..dd8704cc92dc4fdafc49cc1783fc0e9317d2085f 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int" } */
+/* { dg-options "-Dop -Dtype=int -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index 4cd233316e265e82fe09e56e77908fdb1e6e4e29..8055fd380e9f16e0a7452d2ca4bc9e6b1127e976 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-1ml.c
new file mode 100644 (file)
index 0000000..c8cef18
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index 97d0bf067b0ebe6cb47a72502194fbb005cdbd50..3c162e96a4df25b56d5b08d9f7280b637a548d2b 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmisalignment=2" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index 3596e9ea5b188762b0991bfc48b33509838973cc..61e1c2047b40bcb441b300a6a577d6a7dffe1b0c 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-2ml.c
new file mode 100644 (file)
index 0000000..0d78e90
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index 07479469f49d4ad56a5d64e3abfcda0f79dd527b..626a3d5cba42bb9349342d36b4fbc95cd6726ffc 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=int -Dmisalignment=3" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index 46a04f42c0ea5988663a3a5a36fa240c0a338132..339e74cd86c6519eddbfc284edd37eee05ef81c8 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-i-3ml.c
new file mode 100644 (file)
index 0000000..17c6d34
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index 21b5269eced5cc6fd97517416d4f187a1c5ffed4..f2835aa06c11c1eb086a598a5bb29f2b68cd6cf3 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dop -Dtype=short" } */
+/* { dg-options "-Dop -Dtype=short -mno-unaligned-atomic-may-use-library" } */
 
 /* Make sure we get a SIGTRAP or equivalent when passing unaligned
    but otherwise valid pointers to the atomic builtins.  */
@@ -76,7 +76,6 @@ void trap_handler(int signum)
 
 int main(void)
 {
-  type x = 0;
   type ret;
 
 #ifndef TRAP_USING_ABORT
@@ -86,7 +85,9 @@ int main(void)
 #endif
 #endif
 
+#ifndef mis_ok
   trap_expected = 1;
+#endif
 
 #if op
   sfa (&s.i, &s.i, 42);
@@ -98,10 +99,24 @@ int main(void)
      should do it.  */
   trap_expected = 0;
 
+#ifdef mis_ok
+  /* We're missing a sequence point, but we shouldn't have the initial
+     value.  */
+  if (s.i == (type) 0xdeadbeef)
+    abort ();
+  exit (0);
+#endif
+
   sfa (&x, &x, 1);
 #else
   acen (&s.i, &x, &ret);
 
+#ifdef mis_ok
+  if (s.i != 2 || x != 2 || ret != (type) 0xdeadbeef)
+    abort ();
+  exit (0);
+#endif
+
   trap_expected = 0;
 
   acen (&x, &x, &ret);
index fc91e7c9a8a015a454e014714c21d0aa7c0731e1..ba639172ba9372c8f247b25f3605c1fee837e374 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-op-s-1ml.c
new file mode 100644 (file)
index 0000000..3685c50
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dop -Dtype=short -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index 1072caca9ca29f419e6e7ff6dfafe7449b136230..da25614e23b66355f9b116ac6a77a32c6ac6b5ad 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int" } */
+/* { dg-options "-Dxchg -Dtype=int -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index af6ef8ac748d6c0014d981de1493a25c30f6f755..09a7a9ea3a0d91107f12694a479814b49d3dd71e 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-1ml.c
new file mode 100644 (file)
index 0000000..d757a68
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index b02f4875b02555bdc084944a15dcc717a7ec319d..e8a425328eb2c9ed5477abd25b7091407dc98600 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index 8c7918470c64b234c4591ed2a3c387e5d8d8acdc..2b97613de3ce568e2e41954d1d3e3476400508b8 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-2ml.c
new file mode 100644 (file)
index 0000000..fb711e0
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index 637aecfd288c8c12ed058feb720076dbc061fc09..4a3511bf2fbd9eaba6bc42c987af7bcea59c1586 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index e7c90a360d3928d34555ede10b380628ef166dbe..94a25e37f0448b7407a0a372fe407c09265ae143 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-i-3ml.c
new file mode 100644 (file)
index 0000000..32f8ebb
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"
index 73742854ed5d957eab39d8899fe75e59accc582a..d8dede9c1f61de04704f04785793ce96128f9b5b 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do run { target *-*-linux* } } */
 /* { dg-additional-sources "../sync-1.c" } */
-/* { dg-options "-Dxchg -Dtype=short" } */
+/* { dg-options "-Dxchg -Dtype=short -mno-unaligned-atomic-may-use-library" } */
 #include "sync-mis-op-s-1.c"
index 5dcef52207d3394682b87b5690d145b1c8c7553d..6f5eb02afeddb8598892a087422c480b4689b5a1 100644 (file)
@@ -2,4 +2,5 @@
 /* { 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 } } */
+/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */
 #include "sync-mis-op-s-1.c"
diff --git a/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1ml.c b/gcc/testsuite/gcc.target/cris/torture/sync-mis-xchg-s-1ml.c
new file mode 100644 (file)
index 0000000..a6f501c
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do run { target *-*-linux* } } */
+/* { dg-additional-sources "../sync-1.c" } */
+/* { dg-options "-Dxchg -Dtype=short -Dmis_ok" } */
+#include "sync-mis-op-s-1.c"