OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [rx/] [interrupts.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-mint-register=3 -msave-acc-in-interrupts" } */
3
 
4
/* Verify that the RX specific function attributes work.  */
5
 
6
void fast_interrupt (void) __attribute__((__fast_interrupt__));
7
void interrupt (void) __attribute__((__interrupt__));
8
int naked (int) __attribute__((__naked__));
9
 
10
int flag = 0;
11
 
12
/* Fast interrupt handler.  Only uses registers marked as fixed
13
   by the -fixed-xxx gcc command line option.  Returns via RTFI.  */
14
 
15
void
16
fast_interrupt (void)
17
{
18
  flag = 1;
19
}
20
 
21
/* Interrupt handler.  Must preserve any register it uses, even
22
   call clobbered ones.  Returns via RTE.  */
23
 
24
void
25
interrupt (void)
26
{
27
  switch (flag)
28
    {
29
    case 0:
30
      flag = -1;
31
      break;
32
    case 1:
33
    case 2:
34
    case 4:
35
      flag = flag - 2;
36
      break;
37
    case 5:
38
    case 7:
39
    case 6:
40
      flag ^= 3;
41
      break;
42
    default:
43
      naked (flag * 2);
44
      break;
45
    }
46
}
47
 
48
/* Naked function.  The programmer must supply the function's
49
   prologue and epilogue instructions.  */
50
 
51
int
52
naked (int arg)
53
{
54
  flag = arg;
55
}
56
 
57
/* { dg-final { scan-assembler "rtfi" } } */
58
/* { dg-final { scan-assembler "rte" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.