]>
gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.misc-tests/arm-isr.c
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. */
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")));
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
;
41 if (foo (1, 2, 3, 4, 5, 6, 7, 8) != 32)
44 if (foo1 (1, 2, 3, 4, 5, 6, 7, 8) != 32)
This page took 0.040375 seconds and 5 git commands to generate.