| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mcpu=fidoa" } */ |
| 3 |
|
| 4 |
/* Check that an error is issued for using more than one |
| 5 |
interrupt_attribute at the same time. */ |
| 6 |
|
| 7 |
/* If the current mutilib is, say, -mcpu=5485, the compiler gets |
| 8 |
-mcpu=fidoa -mcpu=5485, where -mcpu=fidoa is overridden. In that |
| 9 |
case, we just use two interrupt_handler attributes and expect the |
| 10 |
same error. */ |
| 11 |
#ifdef __mfido___ |
| 12 |
#define IH interrupt_thread |
| 13 |
#else |
| 14 |
#define IH interrupt_handler |
| 15 |
#endif |
| 16 |
|
| 17 |
extern void f1 (void) __attribute__((interrupt_handler, interrupt_handler)); /* { dg-error "multiple interrupt attributes not allowed" } */ |
| 18 |
|
| 19 |
extern void f2 (void) __attribute__((interrupt_handler, IH)); /* { dg-error "multiple interrupt attributes not allowed" } */ |
| 20 |
|
| 21 |
extern void f3 (void) __attribute__((IH, interrupt_handler)); /* { dg-error "multiple interrupt attributes not allowed" } */ |
| 22 |
|
| 23 |
extern void f4 (void) __attribute__((IH, IH)); /* { dg-error "multiple interrupt attributes not allowed" } */ |