aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/attr-isr-nosave_low_regs.c
blob: 2f1d5180140ccc9e2a879b658b1fd3f11fe5b47b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* A call will clobber all call-saved registers.
   If #pragma nosave_low_regs is specified, do not save/restore r0..r7.
   (On SH3* and SH4* r0..r7 are banked)
   One of these registers will also do fine to hold the function address.
   Call-saved registers r8..r13 also don't need to be restored.  */
/* { dg-do compile { target { { "sh*-*-*" } && nonpic } } }  */
/* { dg-skip-if "" { "sh*-*-*" } { "-m1*" "-m2*" "-m5*" } { "" } }  */
/* { dg-options "-O" }  */
/* { dg-final { scan-assembler-times "rte" 1 } }  */
/* { dg-final { scan-assembler-not "\[^f\]r\[0-9\]\[ \t\]*," } }  */
/* { dg-final { scan-assembler-not "\[^f\]r\[89\]" } }  */
/* { dg-final { scan-assembler-not "\[^f\]r1\[,0-3\]" } }  */
/* { dg-final { scan-assembler-times "macl" 2 } }  */

extern void bar (void);

void
foo (void)
{
}

#pragma interrupt
void
( __attribute__ ((nosave_low_regs)) isr) (void)
{
  bar ();
}

void
delay (int a)
{
}