aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/scd42-2.c
blob: a263c1fbff92f35f36c5b1cc7854845c6a5a7d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Verify that mov is preferred on XScale for loading a 2 byte constant. */
/* { dg-do compile } */
/* { dg-require-effective-target arm_cpu_xscale_arm_ok } */
/* { dg-options "-O" } */
/* { dg-add-options arm_cpu_xscale_arm } */

unsigned load2(void) __attribute__ ((naked));
unsigned load2(void)
{
    /* Best code would be:
       mov r0, =272
       add r0, r0, =1
       mov pc, lr */

    return 273;
}

/* { dg-final { scan-assembler "mov\[ 	].*272" } } */