PR rtl-optimization/87918
[official-gcc.git] / gcc / testsuite / gcc.target / m68k / pr36134.c
blobc91956b5c33147848f78d3656a0590b5edb8d997
1 /* pr36134.c
3 This test ensures that the shorter LEA instruction is used in preference
4 to the longer ADD instruction.
6 This preference is applicable to ColdFire only. On CPU32, we can
7 use a sequence of two ADDQ instructions, which is faster than the
8 LEA instruction. */
10 /* { dg-do compile } */
11 /* { dg-skip-if "" { *-*-* } { "-mcpu=*" } { "-mcpu=5208" } } */
12 /* { dg-options "-O2 -mcpu=5208" } */
13 /* { dg-final { scan-assembler "lea" } } */
14 /* { dg-final { scan-assembler-not "add" } } */
16 int *a, *b;
18 void
19 f ()
21 while (a > b)
23 *a++ = *b++;
24 *a++ = *b++;
25 *a++ = *b++;
26 *a++ = *b++;