1/* { dg-do compile } */
2/* { dg-options "-mcpu=fidoa -O2 -fomit-frame-pointer" } */
3
4/* Check that interrupt_thread attribute works.  */
5
6#ifdef __mfido__
7extern void foo (void) __attribute__ ((interrupt_thread));
8
9int a, b, c, d;
10
11void bar (void);
12
13void
14foo (void)
15{
16  int w, x, y, z;
17
18  w = a;
19  x = b;
20  y = c;
21  z = d;
22
23  bar ();
24
25  a = w;
26  b = x;
27  c = y;
28  d = z;
29}
30#else
31/* If the current mutilib is, say, -mcpu=5485, the compiler gets
32   -mcpu=fidoa -mcpu=5485, where -mcpu=fidoa is overridden.  In that
33   case, we just print out "sleep" in the assembly file and pretend
34   that everything is all right.  */
35asm ("sleep");
36#endif
37
38/* "sleep" should be generated in place of "rts".  */
39/* { dg-final { scan-assembler-times "sleep" 1 } } */
40/* { dg-final { scan-assembler-times "rts" 0 } } */
41
42/* There should be no stack adjustment.  */
43/* { dg-final { scan-assembler-times "sp" 0 } } */
44