aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/m68k/interrupt_thread-2.c
blob: 1518bece55ba1ded58df477886f5a5cd84bb5afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-mcpu=fidoa" } */

/* Check that an error is issued for using more than one
   interrupt_attribute at the same time.  */

/* If the current mutilib is, say, -mcpu=5485, the compiler gets
   -mcpu=fidoa -mcpu=5485, where -mcpu=fidoa is overridden.  In that
   case, we just use two interrupt_handler attributes and expect the
   same error.  */
#ifdef __mfido___
#define IH interrupt_thread
#else
#define IH interrupt_handler
#endif

extern void f1 (void) __attribute__((interrupt_handler, interrupt_handler)); /* { dg-error "multiple interrupt attributes not allowed" } */

extern void f2 (void) __attribute__((interrupt_handler, IH)); /* { dg-error "multiple interrupt attributes not allowed" } */

extern void f3 (void) __attribute__((IH, interrupt_handler)); /* { dg-error "multiple interrupt attributes not allowed" } */

extern void f4 (void) __attribute__((IH, IH)); /* { dg-error "multiple interrupt attributes not allowed" } */