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:
parent
9e129d901c
commit
6d43c524dd
@ -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>
|
||||
|
||||
PR c++/9043
|
||||
|
15
gcc/testsuite/gcc.dg/arm-scd42-1.c
Normal file
15
gcc/testsuite/gcc.dg/arm-scd42-1.c
Normal 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" } } */
|
17
gcc/testsuite/gcc.dg/arm-scd42-2.c
Normal file
17
gcc/testsuite/gcc.dg/arm-scd42-2.c
Normal 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" } } } */
|
15
gcc/testsuite/gcc.dg/arm-scd42-3.c
Normal file
15
gcc/testsuite/gcc.dg/arm-scd42-3.c
Normal 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\[ ].*" } } */
|
Loading…
Reference in New Issue
Block a user