OSDN Git Service

Index: gcc/ChangeLog
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / arm-mmx-1.c
1 /* Verify that if IP is saved to ensure stack alignment, we don't load
2    it into sp.  */
3 /* { dg-do compile { target arm*-*-* strongarm*-*-* xscale*-*-*} } */
4 /* { dg-options "-O -mno-apcs-frame -mcpu=iwmmxt -mabi=iwmmxt" } */
5 /* { dg-final { global compiler_flags; if ![string match "*-mthumb *" $compiler_flags] { scan-assembler "ldmfd\[        ]sp!.*ip,\[ ]*pc" } } } */
6
7 /* This function uses all the call-saved registers, namely r4, r5, r6,
8    r7, r8, r9, sl, fp.  Since we also save lr, that leaves an odd
9    number of registers, and the compiler will push ip to align the
10    stack.  Make sure that we restore ip into ip, not into sp as is
11    done when using a frame pointer.  The -mno-apcs-frame option
12    permits the frame pointer to be used as an ordinary register.  */
13
14 void
15 foo(void)
16 {
17   __asm volatile ("" : : :
18                   "r4", "r5", "r6", "r7", "r8", "r9", "sl", "fp", "lr");
19 }