summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/arm-scd42-1.c
blob: 9f1e4b4a065a6342fe67a71c9ede980e24a455eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Verify that mov is preferred on XScale for loading a 1 byte constant. */
/* { dg-do compile { target arm*-*-* } } */
/* { 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" } } */
OpenPOWER on IntegriCloud