| 1 |
/* { dg-do run } */ |
| 2 |
|
| 3 |
class IRQS |
| 4 |
{ |
| 5 |
public: |
| 6 |
void test (int x) const |
| 7 |
{ |
| 8 |
if (i != x) |
| 9 |
__builtin_abort (); |
| 10 |
} |
| 11 |
|
| 12 |
private: |
| 13 |
static volatile int i; |
| 14 |
|
| 15 |
__attribute__((signal(1,2))) |
| 16 |
static void fun12 () |
| 17 |
{ |
| 18 |
i += 1234; |
| 19 |
} |
| 20 |
}; |
| 21 |
|
| 22 |
extern void isr1 () __asm("__vector_1"); |
| 23 |
extern void isr2 () __asm("__vector_2"); |
| 24 |
extern void isr3 () __asm("__vector_3"); |
| 25 |
|
| 26 |
IRQS irqs; |
| 27 |
|
| 28 |
volatile int IRQS::i; |
| 29 |
|
| 30 |
namespace |
| 31 |
{ |
| 32 |
int j; |
| 33 |
__attribute__((signal(3))) |
| 34 |
void handle3 () |
| 35 |
{ |
| 36 |
j = 444; |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
int main (void) |
| 41 |
{ |
| 42 |
isr1(); |
| 43 |
irqs.test (1234); |
| 44 |
|
| 45 |
isr2(); |
| 46 |
irqs.test (2468); |
| 47 |
|
| 48 |
isr3 (); |
| 49 |
if (j != 444) |
| 50 |
__builtin_abort(); |
| 51 |
|
| 52 |
return 0; |
| 53 |
} |