| 1 |
/* { dg-do compile } */ |
| 2 |
/* Check that the foo interrupt vectors aren't actually removed. */ |
| 3 |
/* { dg-final { scan-assembler-times "__interrupt_vector_foo" 2 } } */ |
| 4 |
/* Check that the out-of-range interrupt vectors aren't actually removed. */ |
| 5 |
/* { dg-final { scan-assembler "__interrupt_vector_65" } } */ |
| 6 |
/* { dg-final { scan-assembler "__interrupt_vector_100" } } */ |
| 7 |
|
| 8 |
/* Check that warnings are emitted when attributes are used incorrectly and |
| 9 |
that attributes are interpreted correctly whether leading and trailing |
| 10 |
underscores are used or not. */ |
| 11 |
|
| 12 |
void __attribute__((__naked__,__reentrant__)) |
| 13 |
fn1(void) |
| 14 |
{ /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'naked'" } */ |
| 15 |
} |
| 16 |
|
| 17 |
void __attribute__((naked,reentrant)) |
| 18 |
fn2(void) |
| 19 |
{ /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'naked'" } */ |
| 20 |
} |
| 21 |
|
| 22 |
void __attribute__((__reentrant__,__naked__)) |
| 23 |
fn3(void) |
| 24 |
{ /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'reentrant'" } */ |
| 25 |
} |
| 26 |
|
| 27 |
void __attribute__((reentrant,naked)) |
| 28 |
fn4(void) |
| 29 |
{ /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'reentrant'" } */ |
| 30 |
} |
| 31 |
|
| 32 |
void __attribute__((__critical__,__reentrant__)) |
| 33 |
fn5(void) |
| 34 |
{ /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'critical'" } */ |
| 35 |
} |
| 36 |
|
| 37 |
void __attribute__((critical,reentrant)) |
| 38 |
fn6(void) |
| 39 |
{ /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'critical'" } */ |
| 40 |
} |
| 41 |
|
| 42 |
void __attribute__((__reentrant__,__critical__)) |
| 43 |
fn7(void) |
| 44 |
{ /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'reentrant'" } */ |
| 45 |
} |
| 46 |
|
| 47 |
void __attribute__((reentrant,critical)) |
| 48 |
fn8(void) |
| 49 |
{ /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'reentrant'" } */ |
| 50 |
} |
| 51 |
|
| 52 |
void __attribute__((__critical__,__naked__)) |
| 53 |
fn9(void) |
| 54 |
{ /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'critical'" } */ |
| 55 |
} |
| 56 |
|
| 57 |
void __attribute__((critical,naked)) |
| 58 |
fn10(void) |
| 59 |
{ /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'critical'" } */ |
| 60 |
} |
| 61 |
|
| 62 |
void __attribute__((__naked__,__critical__)) |
| 63 |
fn11(void) |
| 64 |
{ /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'naked'" } */ |
| 65 |
} |
| 66 |
|
| 67 |
void __attribute__((naked,critical)) |
| 68 |
fn12(void) |
| 69 |
{ /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'naked'" } */ |
| 70 |
} |
| 71 |
|
| 72 |
int __attribute__((interrupt)) |
| 73 |
isr1 (void) |
| 74 |
{ /* { dg-warning "interrupt handlers must be void" } */ |
| 75 |
} |
| 76 |
|
| 77 |
int __attribute__((__interrupt__)) |
| 78 |
isr2 (void) |
| 79 |
{ /* { dg-warning "interrupt handlers must be void" } */ |
| 80 |
} |
| 81 |
|
| 82 |
void __attribute__((interrupt("foo1"))) |
| 83 |
isr3 (void) |
| 84 |
{ /* { dg-warning "unrecognized interrupt vector argument" } */ |
| 85 |
} |
| 86 |
|
| 87 |
void __attribute__((__interrupt__("foo2"))) |
| 88 |
isr4 (void) |
| 89 |
{ /* { dg-warning "unrecognized.*interrupt vector argument" } */ |
| 90 |
} |
| 91 |
|
| 92 |
void __attribute__((interrupt(65))) |
| 93 |
isr5 (void) |
| 94 |
{ /* { dg-warning "numeric argument of 'interrupt' attribute must be in range 0..63" } */ |
| 95 |
} |
| 96 |
|
| 97 |
void __attribute__((__interrupt__(100))) |
| 98 |
isr6 (void) |
| 99 |
{ /* { dg-warning "numeric argument of 'interrupt' attribute must be in range 0..63" } */ |
| 100 |
} |
| 101 |
|
| 102 |
void __attribute__((interrupt(0.5))) |
| 103 |
isr7 (void) |
| 104 |
{ /* { dg-warning "argument of 'interrupt' attribute is not a string constant or number" } */ |
| 105 |
volatile int __attribute__((__naked__)) |
| 106 |
a; /* { dg-warning "'naked' attribute only applies to functions" } */ |
| 107 |
} |
| 108 |
|
| 109 |
void __attribute__((__interrupt__(1.5))) |
| 110 |
isr8 (void) |
| 111 |
{ /* { dg-warning "argument of 'interrupt' attribute is not a string constant or number" } */ |
| 112 |
volatile int __attribute__((naked)) |
| 113 |
a; /* { dg-warning "'naked' attribute only applies to functions" } */ |
| 114 |
} |