* dbxout.c (current_file): Also wrap inside DBX_DEBUGGING_INFO ||
[official-gcc.git] / gcc / testsuite / gcc.misc-tests / arm-isr.c
blobf79e241633deca1785400c547a1d98d1cffbb3d9
1 #ifndef __thumb__
2 /* There used to be a couple of bugs in the ARM's prologue and epilogue
3 generation for ISR routines. The wrong epilogue instruction would be
4 generated to restore the IP register if it had to be pushed onto the
5 stack, and the wrong offset was being computed for local variables if
6 r0 - r3 had to be saved. This tests for both of these cases. */
8 int z = 9;
10 int
11 bar (void)
13 return z;
16 int
17 foo (int a, int b, int c, int d, int e, int f, int g, int h)
19 volatile int i = (a + b) - (g + h) + bar ();
20 volatile int j = (e + f) - (c + d);
22 return a + b + c + d + e + f + g + h + i + j;
25 int foo1 (int a, int b, int c, int d, int e, int f, int g, int h) __attribute__ ((interrupt ("IRQ")));
27 int
28 foo1 (int a, int b, int c, int d, int e, int f, int g, int h)
30 volatile int i = (a + b) - (g + h) + bar ();
31 volatile int j = (e + f) - (c + d);
33 return a + b + c + d + e + f + g + h + i + j;
35 #endif
37 int
38 main (void)
40 #ifndef __thumb__
41 if (foo (1, 2, 3, 4, 5, 6, 7, 8) != 32)
42 abort ();
44 if (foo1 (1, 2, 3, 4, 5, 6, 7, 8) != 32)
45 abort ();
46 #endif
47 exit (0);