Commit f0336342 by Hans-Peter Nilsson Committed by Hans-Peter Nilsson

sync-2i.c, [...]: For cris*-*-linux*, also pass -mno-unaligned-atomic-may-use-library.

	* 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
parent dec4306f
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.
......
/* 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"
/* 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"
......@@ -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" } } */
......
......@@ -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" } } */
......
......@@ -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 *-*-* } } } */
......
......@@ -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 *-*-* } } } */
......
/* 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" } } */
......
/* 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" } } */
......
/* 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment