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 fn1(void * p,short error_code)10fn1 (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 fn2(void)16fn2 (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 fn3(uword_t error_code)22fn3 (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 fn4(uword_t error_code,void * frame)29fn4 (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 can't have non-void return value" } */ 35 36 int fn5(void * frame)37fn5 (void *frame) 38 { 39 return 0; 40 } 41