1 | //
|
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
|
---|
3 | //
|
---|
4 | // The contents of this file are covered under the licence agreement in the
|
---|
5 | // file "LICENCE" distributed with Cforall.
|
---|
6 | //
|
---|
7 | // attributes.c --
|
---|
8 | //
|
---|
9 | // Author : Peter A. Buhr
|
---|
10 | // Created On : Mon Feb 6 16:07:02 2017
|
---|
11 | // Last Modified By : Peter A. Buhr
|
---|
12 | // Last Modified On : Fri Jul 21 23:05:52 2017
|
---|
13 | // Update Count : 3
|
---|
14 | //
|
---|
15 |
|
---|
16 |
|
---|
17 | // label attribute
|
---|
18 | int la() {
|
---|
19 | L: __attribute__(( unused )) 1;
|
---|
20 | }
|
---|
21 |
|
---|
22 |
|
---|
23 | // aggregate_name
|
---|
24 | struct __attribute__(( unused )) {};
|
---|
25 | struct __attribute__(( unused )) Agn1;
|
---|
26 | struct __attribute__(( unused )) Agn2 {};
|
---|
27 | enum __attribute__(( unused )) { E1 };
|
---|
28 | enum __attribute__(( unused )) Agn3;
|
---|
29 | enum __attribute__(( packed )) Agn3 { E2 };
|
---|
30 | #ifdef __CFA__
|
---|
31 | struct __attribute__(( unused )) ( int ) {};
|
---|
32 | struct __attribute__(( unused )) ( int ) {};
|
---|
33 | #endif // __CFA__
|
---|
34 |
|
---|
35 |
|
---|
36 | // field_declaring_list
|
---|
37 | struct Fdl {
|
---|
38 | int f1 __attribute__(( unused ));
|
---|
39 | int __attribute__(( unused )) f2;
|
---|
40 | int __attribute__(( unused )) f3 __attribute__(( unused ));
|
---|
41 | __attribute__(( unused )) int f4;
|
---|
42 | __attribute__(( unused )) int f5 __attribute__(( unused ));
|
---|
43 | __attribute__(( used )) int f6 __attribute__(( packed )), f7 __attribute__(( unused )) __attribute__(( unused )), __attribute__(( used )) f8 __attribute__(( unused ));
|
---|
44 | int __attribute__(( unused ));
|
---|
45 | int ( ( * (f9) __attribute__(( unused )) ) __attribute__(( unused )) );
|
---|
46 | };
|
---|
47 |
|
---|
48 |
|
---|
49 | // asm_name_opt
|
---|
50 | int f() asm( "xyz" ) __attribute__(( unused ));
|
---|
51 |
|
---|
52 |
|
---|
53 | // variable_declarator
|
---|
54 | const __attribute__(( used )) int vd1 __attribute__(( used )), __attribute__(( unused )) vd2;
|
---|
55 | const __attribute__(( used )) int __attribute__(( used )) * __attribute__(( used )) vd3 __attribute__(( used )), __attribute__(( unused )) (* __attribute__(( unused )) (vd4)) __attribute__(( used ));
|
---|
56 | const __attribute__(( used )) int __attribute__(( used )) vd5[5] __attribute__(( used )), __attribute__(( unused )) ((vd6)[5]) __attribute__(( used ));
|
---|
57 | const __attribute__(( used )) int __attribute__(( used )) (* __attribute__(( used )) vd7)() __attribute__(( used )), __attribute__(( unused )) ((* __attribute__(( used )) vd8)()) __attribute__(( used ));
|
---|
58 |
|
---|
59 |
|
---|
60 | // function_declarator
|
---|
61 | __attribute__(( unused )) int f1() __attribute__(( used ));
|
---|
62 | __attribute__(( unused )) int f1() {}
|
---|
63 | __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() __attribute__(( used ));
|
---|
64 | __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() {}
|
---|
65 | __attribute__(( unused )) int (* __attribute__(( unused )) f3(int))[] __attribute__(( used ));
|
---|
66 | __attribute__(( unused )) int (* __attribute__(( unused )) f3(int p))[] {}
|
---|
67 | __attribute__(( unused )) int (* __attribute__(( unused )) f4())(int) __attribute__(( used ));
|
---|
68 | __attribute__(( unused )) int (* __attribute__(( unused )) f4())(int) {}
|
---|
69 |
|
---|
70 |
|
---|
71 | // variable_type_redeclarator
|
---|
72 | typedef int t1, t2, t3, t4, t5, t6, t7, t8;
|
---|
73 | int vtr() {
|
---|
74 | // redefine typedef name in new scope
|
---|
75 | __attribute__(( unused )) int __attribute__(( unused )) t1 __attribute__(( used ));
|
---|
76 | __attribute__(( unused )) int __attribute__(( unused )) (* (* t2 __attribute__(( unused )) ) __attribute__(( unused )) ) __attribute__(( unused ));
|
---|
77 | __attribute__(( unused )) int __attribute__(( unused )) t3[5] __attribute__(( unused ));
|
---|
78 | __attribute__(( unused )) int __attribute__(( unused )) (* (* __attribute__(( unused )) t4[5]) __attribute__(( unused )) ) __attribute__(( unused ));
|
---|
79 | __attribute__(( unused )) int __attribute__(( unused )) t5() __attribute__(( unused ));
|
---|
80 | __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) ((t6))() __attribute__(( unused ));
|
---|
81 | }
|
---|
82 |
|
---|
83 |
|
---|
84 | // identifier_parameter_declarator
|
---|
85 | int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
|
---|
86 | __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) );
|
---|
87 | int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
|
---|
88 | __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) ) {}
|
---|
89 | int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
|
---|
90 | __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) );
|
---|
91 | int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
|
---|
92 | __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) ) {}
|
---|
93 | int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
|
---|
94 | __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) );
|
---|
95 | int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
|
---|
96 | __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) ) {}
|
---|
97 | int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
|
---|
98 | __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) );
|
---|
99 | int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
|
---|
100 | __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) ) {}
|
---|
101 |
|
---|
102 |
|
---|
103 | // type_parameter_redeclarator
|
---|
104 | typedef int Foo;
|
---|
105 | int tpr1( __attribute__(( unused )) int __attribute__(( unused )) Foo __attribute__(( unused )) );
|
---|
106 | int tpr2( __attribute__(( unused )) int __attribute__(( unused )) (* __attribute__(( unused )) (* __attribute__(( unused )) Foo) __attribute__(( unused )) ) __attribute__(( unused )) );
|
---|
107 | int tpr3( __attribute__(( unused )) int __attribute__(( unused )) Foo[] __attribute__(( unused )));
|
---|
108 | int tpr4( __attribute__(( unused )) int __attribute__(( unused )) ( __attribute__(( unused )) Foo[5] __attribute__(( unused )) ) );
|
---|
109 | int tpr5( __attribute__(( unused )) int __attribute__(( unused )) (*Foo)() __attribute__(( unused )) );
|
---|
110 | int tpr6( __attribute__(( unused )) int __attribute__(( unused )) Foo() __attribute__(( unused )) );
|
---|
111 | int tpr7( __attribute__(( unused )) int __attribute__(( unused )) ( __attribute__(( unused )) Foo( __attribute__(( unused )) int __attribute__(( unused )) ) ) );
|
---|
112 |
|
---|
113 |
|
---|
114 | // abstract_declarator
|
---|
115 | int ad() {
|
---|
116 | typeof( int __attribute__(( used )) ) ad1 __attribute__(( unused ));
|
---|
117 | typeof( int __attribute__(( unused )) * __attribute__(( unused )) ) ad2 __attribute__(( unused ));
|
---|
118 | typeof( int __attribute__(( unused )) [5] ) __attribute__(( unused )) ad3 __attribute__(( unused ));
|
---|
119 | typeof( __attribute__(( unused )) int __attribute__(( unused )) (*)[10] __attribute__(( unused )) ) __attribute__(( unused )) ad4 __attribute__(( unused )), ad5 __attribute__(( used ));
|
---|
120 | typeof( __attribute__(( unused )) int __attribute__(( unused )) () __attribute__(( unused )) ) __attribute__(( unused )) ad6 __attribute__(( unused ));
|
---|
121 | sizeof( __attribute__(( unused )) int __attribute__(( unused )) );
|
---|
122 | sizeof( __attribute__(( unused )) int __attribute__(( unused )) (* __attribute__(( unused )) (* __attribute__(( unused )) ) ) );
|
---|
123 | sizeof( __attribute__(( unused )) int __attribute__(( unused )) [5] __attribute__(( unused )) );
|
---|
124 | sizeof( __attribute__(( unused )) int __attribute__(( unused )) (*)[10] __attribute__(( unused )) );
|
---|
125 | sizeof( __attribute__(( unused )) int __attribute__(( unused )) () __attribute__(( unused )) );
|
---|
126 | sizeof( struct { int i; } __attribute__(( unused )) );
|
---|
127 | sizeof( enum { R } __attribute__(( unused )) );
|
---|
128 | }
|
---|
129 |
|
---|
130 |
|
---|
131 | // abstract_parameter_declarator
|
---|
132 | int apd1( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )),
|
---|
133 | __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) );
|
---|
134 | int apd2( __attribute__(( unused )) int __attribute__(( unused )) (* (* __attribute__(( unused )) ) __attribute__(( unused )) ),
|
---|
135 | __attribute__(( unused )) int __attribute__(( unused )) (* (* __attribute__(( unused )) ) __attribute__(( unused )) ) );
|
---|
136 | int apd3( __attribute__(( unused )) int __attribute__(( unused )) ([]) __attribute__(( unused )),
|
---|
137 | __attribute__(( unused )) int __attribute__(( unused )) ([]) __attribute__(( unused )) );
|
---|
138 | int apd4( __attribute__(( unused )) int __attribute__(( unused )) () __attribute__(( unused )),
|
---|
139 | __attribute__(( unused )) int __attribute__(( unused )) () __attribute__(( unused )) );
|
---|
140 | int apd5( __attribute__(( unused )) int __attribute__(( unused )) (( __attribute__(( unused )) int )) __attribute__(( unused )),
|
---|
141 | __attribute__(( unused )) int __attribute__(( unused )) ( __attribute__(( unused )) int ) __attribute__(( unused )) );
|
---|
142 | int apd6( __attribute__(( unused )) int __attribute__(( unused )) (*)() __attribute__(( unused )),
|
---|
143 | __attribute__(( unused )) int __attribute__(( unused )) (*)() __attribute__(( unused )) );
|
---|
144 | int apd7( __attribute__(( unused )) int __attribute__(( unused )) ((*)( __attribute__(( unused )) int ) ) __attribute__(( unused )),
|
---|
145 | __attribute__(( unused )) int __attribute__(( unused )) ((*)( __attribute__(( unused )) int ) ) __attribute__(( unused )) );
|
---|
146 |
|
---|
147 |
|
---|
148 | // variable_abstract_declarator
|
---|
149 | struct Vad {
|
---|
150 | int __attribute__(( unused ));
|
---|
151 | int __attribute__(( unused )) * __attribute__(( unused ));
|
---|
152 | int __attribute__(( unused )) [10] __attribute__(( unused ));
|
---|
153 | int __attribute__(( unused )) (*)() __attribute__(( unused ));
|
---|
154 | };
|
---|
155 |
|
---|
156 | // Local Variables: //
|
---|
157 | // tab-width: 4 //
|
---|
158 | // compile-command: "cfa attributes.c" //
|
---|
159 | // End: //
|
---|