xscale testcases from James Lemke

xscale testcases from James Lemke
	* gcc.dg/arm-scd42-[123].c: New tests.

From-SVN: r74712
This commit is contained in:
James Lemke 2003-12-16 22:38:58 +00:00 committed by Jim Wilson
parent 9e129d901c
commit 6d43c524dd
4 changed files with 51 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-12-16 James Lemke <jim@wasabisystems.com>
* gcc.dg/arm-scd42-[123].c: New tests.
2003-12-16 Nathan Sidwell <nathan@codesourcery.com> 2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9043 PR c++/9043

View File

@ -0,0 +1,15 @@
/* Verify that mov is preferred on XScale for loading a 1 byte constant. */
/* { dg-do compile { target xscale-*-* } } */
/* { dg-options "-mcpu=xscale -O" } */
unsigned load1(void) __attribute__ ((naked));
unsigned load1(void)
{
/* Best code would be:
mov r0, =17
mov pc, lr */
return 17;
}
/* { dg-final { scan-assembler "mov\[ ].*17" } } */

View File

@ -0,0 +1,17 @@
/* Verify that mov is preferred on XScale for loading a 2 byte constant. */
/* { dg-do compile { target xscale-*-* } } */
/* { dg-options "-mcpu=xscale -O" } */
unsigned load2(void) __attribute__ ((naked));
unsigned load2(void)
{
/* Best code would be:
mov r0, =272
add r0, r0, =1
mov pc, lr */
return 273;
}
/* We want to suppress running for -mthumb but not for -mthumb-interwork. */
/* { dg-final { global compiler_flags; if ![string match "*-mthumb *" $compiler_flags] { scan-assembler "mov\[ ].*272" } } } */

View File

@ -0,0 +1,15 @@
/* Verify that ldr is preferred on XScale for loading a 3 or 4 byte constant. */
/* { dg-do compile { target xscale-*-* } } */
/* { dg-options "-mcpu=xscale -O" } */
unsigned load4(void) __attribute__ ((naked));
unsigned load4(void)
{
/* Best code would be:
ldr r0, =65809
mov pc, lr */
return 65809;
}
/* { dg-final { scan-assembler "ldr\[ ].*" } } */