OSDN Git Service

PR middle-end/20256
[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 } */
4 /* { dg-options "-O -mno-apcs-frame -mcpu=iwmmxt -mabi=iwmmxt" } */
5 /* { dg-require-effective-target arm32 } */
6 /* { dg-final { scan-assembler "ldmfd\[         ]sp!.*ip,\[ ]*pc" } } */
7
8 /* This function uses all the call-saved registers, namely r4, r5, r6,
9    r7, r8, r9, sl, fp.  Since we also save lr, that leaves an odd
10    number of registers, and the compiler will push ip to align the
11    stack.  Make sure that we restore ip into ip, not into sp as is
12    done when using a frame pointer.  The -mno-apcs-frame option
13    permits the frame pointer to be used as an ordinary register.  */
14
15 void
16 foo(void)
17 {
18   __asm volatile ("" : : :
19                   "r4", "r5", "r6", "r7", "r8", "r9", "sl", "fp", "lr");
20 }