diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/m68k/pr36134.c')
-rw-r--r-- | gcc/testsuite/gcc.target/m68k/pr36134.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/m68k/pr36134.c b/gcc/testsuite/gcc.target/m68k/pr36134.c new file mode 100644 index 000000000..d8d65c16c --- /dev/null +++ b/gcc/testsuite/gcc.target/m68k/pr36134.c @@ -0,0 +1,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++; + } +} |