summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/m68k/pr36134.c
blob: d8d65c16c0528cd8cc826baa7f3e9e2a7cdb367a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* pr36134.c

   This test ensures that the shorter LEA instruction is used in preference
   to the longer ADD instruction.  */

/* { dg-do compile }  */
/* { dg-options "-O2" }  */
/* { dg-final { scan-assembler "lea" } } */
/* { dg-final { scan-assembler-not "add" } } */

int *a, *b;

void
f ()
{
  while (a > b)
    {
      *a++ = *b++;
      *a++ = *b++;
      *a++ = *b++;
      *a++ = *b++;
    }
}