| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -mgeneral-regs-only -mno-cld" } */ |
| 3 |
|
| 4 |
typedef unsigned int uword_t __attribute__ ((mode (__word__))); |
| 5 |
|
| 6 |
extern int error; |
| 7 |
|
| 8 |
__attribute__((interrupt)) |
| 9 |
void |
| 10 |
fn1 (void *p, short error_code) |
| 11 |
{ /* { dg-error "interrupt service routine should have 'unsigned \(long long |long |\)int' as the second argument" } */ |
| 12 |
} |
| 13 |
|
| 14 |
__attribute__((interrupt)) |
| 15 |
void |
| 16 |
fn2 (void) |
| 17 |
{ /* { dg-error "interrupt service routine can only have a pointer argument and an optional integer argument" } */ |
| 18 |
} |
| 19 |
|
| 20 |
__attribute__((interrupt)) |
| 21 |
void |
| 22 |
fn3 (uword_t error_code) |
| 23 |
{ /* { dg-error "interrupt service routine should have a pointer as the first argument" } */ |
| 24 |
error = error_code; |
| 25 |
} |
| 26 |
|
| 27 |
__attribute__((interrupt)) |
| 28 |
void |
| 29 |
fn4 (uword_t error_code, void *frame) |
| 30 |
{ /* { dg-error "interrupt service routine should have .* the .* argument" } */ |
| 31 |
error = error_code; |
| 32 |
} |
| 33 |
|
| 34 |
extern int fn5 (void *) __attribute__ ((interrupt)); /* { dg-error "interrupt service routine must return 'void'" } */ |
| 35 |
|
| 36 |
int |
| 37 |
fn5 (void *frame) |
| 38 |
{ |
| 39 |
return 0; |
| 40 |
} |