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__))
fn1(void)13 fn1(void)
14 { /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'naked'" } */
15 }
16 
17 void __attribute__((naked,reentrant))
fn2(void)18 fn2(void)
19 { /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'naked'" } */
20 }
21 
22 void __attribute__((__reentrant__,__naked__))
fn3(void)23 fn3(void)
24 { /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'reentrant'" } */
25 }
26 
27 void __attribute__((reentrant,naked))
fn4(void)28 fn4(void)
29 { /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'reentrant'" } */
30 }
31 
32 void __attribute__((__critical__,__reentrant__))
fn5(void)33 fn5(void)
34 { /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'critical'" } */
35 }
36 
37 void __attribute__((critical,reentrant))
fn6(void)38 fn6(void)
39 { /* { dg-warning "ignoring attribute 'reentrant' because it conflicts with attribute 'critical'" } */
40 }
41 
42 void __attribute__((__reentrant__,__critical__))
fn7(void)43 fn7(void)
44 { /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'reentrant'" } */
45 }
46 
47 void __attribute__((reentrant,critical))
fn8(void)48 fn8(void)
49 { /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'reentrant'" } */
50 }
51 
52 void __attribute__((__critical__,__naked__))
fn9(void)53 fn9(void)
54 { /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'critical'" } */
55 }
56 
57 void __attribute__((critical,naked))
fn10(void)58 fn10(void)
59 { /* { dg-warning "ignoring attribute 'naked' because it conflicts with attribute 'critical'" } */
60 }
61 
62 void __attribute__((__naked__,__critical__))
fn11(void)63 fn11(void)
64 { /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'naked'" } */
65 }
66 
67 void __attribute__((naked,critical))
fn12(void)68 fn12(void)
69 { /* { dg-warning "ignoring attribute 'critical' because it conflicts with attribute 'naked'" } */
70 }
71 
72 int __attribute__((interrupt))
isr1(void)73 isr1 (void)
74 { /* { dg-warning "interrupt handlers must be void" } */
75 }
76 
77 int __attribute__((__interrupt__))
isr2(void)78 isr2 (void)
79 { /* { dg-warning "interrupt handlers must be void" } */
80 }
81 
82 void __attribute__((interrupt("foo1")))
isr3(void)83 isr3 (void)
84 { /* { dg-warning "unrecognized interrupt vector argument" } */
85 }
86 
87 void __attribute__((__interrupt__("foo2")))
isr4(void)88 isr4 (void)
89 { /* { dg-warning "unrecognized.*interrupt vector argument" } */
90 }
91 
92 void __attribute__((interrupt(65)))
isr5(void)93 isr5 (void)
94 { /* { dg-warning "numeric argument of 'interrupt' attribute must be in range 0..63" } */
95 }
96 
97 void __attribute__((__interrupt__(100)))
isr6(void)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)))
isr7(void)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)))
isr8(void)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 }
115