Commit 37239ce6 by Hans-Peter Nilsson Committed by Hans-Peter Nilsson

asm-v8.S, [...]: New tests.

	* gcc.target/cris/asm-v8.S, gcc.target/cris/asm-v10.S,
	gcc.target/cris/asm-other.S, gcc.target/cris/inasm-v8.c,
	gcc.target/cris/inasm-v10.c, gcc.target/cris/inasm-other.c:
	New tests.

From-SVN: r188052
parent e8baa9bc
2012-05-31 Hans-Peter Nilsson <hp@axis.com>
* gcc.target/cris/asm-v8.S, gcc.target/cris/asm-v10.S,
gcc.target/cris/asm-other.S, gcc.target/cris/inasm-v8.c,
gcc.target/cris/inasm-v10.c, gcc.target/cris/inasm-other.c:
New tests.
2012-05-30 Jason Merrill <jason@redhat.com>
PR c++/53356
......
/* { dg-do assemble } */
/* { dg-options "-DOTHER_ISA=0 -march=v0" { target crisv32-*-* } } */
/* { dg-options "-DOTHER_ISA=32 -march=v32" { target cris-*-* } } */
/* Make sure we can assemble for the "other" variant, with the twist
that the gcc option -march=v0 isn't valid for the assembler. */
.text
#if OTHER_ISA == 32
addoq 42,$r1,$acr
#else
0:
move.d [$r2=$r0+42],$r1
bwf 0b
nop
#endif
/* { dg-do assemble } */
/* { dg-options "-DOTHER_ISA=10 -march=v10" } */
/* Check that -march=v10 is also recognized. */
#include "asm-other.S"
/* { dg-do assemble } */
/* { dg-options "-DOTHER_ISA=8 -march=v8" } */
/* Check that -march=v8 is also recognized. */
#include "asm-other.S"
/* { dg-do assemble } */
/* { dg-options "-DOTHER_ISA=0 -march=v0" { target crisv32-*-* } } */
/* { dg-options "-DOTHER_ISA=32 -march=v32" { target cris-*-* } } */
/* Make sure we can (generate code and) assemble for the "other"
variant, with the twist that the gcc option -march=v0 isn't
valid for the assembler. We don't check that the generated code
is for the other variant; other tests cover that already, but they
don't *assemble* the result. We can't trust the prologue and
epilogue to contain incompatible insns (they actually deliberately
don't, usually and it'd be brittle to tweak the function signature
to make it so), so we force some with inline asm. */
void f(void)
{
#if OTHER_ISA == 32
asm volatile ("addoq 42,$r11,$acr");
#else
asm volatile ("0: move.d [$r12=$sp+42],$r10\n\t"
"bwf 0b\n\t"
"nop");
#endif
}
/* { dg-do assemble } */
/* { dg-options "-DOTHER_ISA=10 -march=v10" } */
/* Check that -march=v10 is also recognized. */
#include "inasm-other.c"
/* { dg-do assemble } */
/* { dg-options "-DOTHER_ISA=8 -march=v8" } */
/* Check that -march=v8 is also recognized. */
#include "inasm-other.c"
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