]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/arc/interrupt-6.c
[ARC] Automatic context save/restore for regular interrupts.
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / arc / interrupt-6.c
1 /* { dg-do compile } */
2 /* { dg-skip-if "Not available for ARCv1" { arc700 || arc6xx } } */
3 /* { dg-options "-O2 -mirq-ctrl-saved=r0-ilink" } */
4
5 #include <alloca.h>
6
7 /* Check if ilink is recognized. Check how FP and BLINK are saved.
8 BLINK is saved last on the stack because the IRQ autosave will do
9 first r0-ilink. To avoid this ABI exception, one needs to autosave
10 always blink when using the IRQ autosave feature. */
11
12 extern int bar (void *);
13
14 void __attribute__ ((interrupt("ilink")))
15 foo(void)
16 {
17 int *p = alloca (10);
18 bar (p);
19 }
20 /* { dg-final { scan-assembler-not ".*fp,\\\[sp" } } */
21 /* { dg-final { scan-assembler "ld.*blink,\\\[sp\\\]" } } */
22 /* { dg-final { scan-assembler "push_s.*blink" } } */