PR c++/67273
[official-gcc.git] / gcc / testsuite / gcc.target / arm / 20051215-1.c
blob0519dc7ce475981563ad87ca5c84f677e58043bd
1 /* ARM's load-and-call patterns used to allow automodified addresses.
2 This was wrong, because if the modified register were spilled,
3 the call would need an output reload. */
4 /* { dg-do run } */
5 /* { dg-options "-O2 -fno-omit-frame-pointer" } */
6 extern void abort (void);
7 typedef void (*callback) (void);
9 static void
10 foo (callback *first, callback *p)
12 while (p > first)
14 (*--p) ();
15 #ifndef __thumb__
16 asm ("" : "=r" (p) : "0" (p)
17 : "r4", "r5", "r6", "r7", "r8", "r9", "r10");
18 #endif
22 static void
23 dummy (void)
25 static int count;
26 if (count++ == 1)
27 abort ();
30 int
31 main (void)
33 callback list[1] = { dummy };
34 foo (&list[0], &list[1]);
35 return 0;