OSDN Git Service

* gcc.dg/vect/vect-116.c: Add vect_int target requirement.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20051215-1.c
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 { target arm*-*-* } } */
5 /* { dg-options "-O2 -fno-omit-frame-pointer" } */
6 extern void abort (void);
7 typedef void (*callback) (void);
8
9 static void
10 foo (callback *first, callback *p)
11 {
12   while (p > first)
13     {
14       (*--p) ();
15 #ifndef __thumb__
16       asm ("" : "=r" (p) : "0" (p)
17            : "r4", "r5", "r6", "r7", "r8", "r9", "r10");
18 #endif
19     }   
20 }
21
22 static void
23 dummy (void)
24 {
25   static int count;
26   if (count++ == 1)
27     abort ();
28 }
29
30 int
31 main (void)
32 {
33   callback list[1] = { dummy };
34   foo (&list[0], &list[1]);
35   return 0;
36 }