aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/arm-scd42-3.c
blob: 80a4ba8dbf1123538019fcf3c88bf8b863597e52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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\[ 	].*" } } */