source: tests/attributes.cfa @ d2de1be9

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since d2de1be9 was dc8511c, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

first attempt at updating suffixes for test programs

  • Property mode set to 100644
File size: 9.1 KB
Line 
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.cfa --
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 : Tue Nov  6 17:51:12 2018
13// Update Count     : 17
14//
15
16
17// label attribute
18int la() {
19  L: __attribute__(( unused )) 1;
20}
21
22
23// aggregate_name
24struct __attribute__(( unused )) {};
25struct __attribute__(( unused )) Agn1;
26struct __attribute__(( unused )) Agn2 {};
27enum __attribute__(( unused )) { E1 };
28enum __attribute__(( unused )) Agn3;
29enum __attribute__(( packed )) Agn3 { E2 };
30#ifdef __CFA__
31struct __attribute__(( unused )) {} ( int );
32struct __attribute__(( unused )) Agn4 {} ( int );
33#endif // __CFA__
34
35
36// field_declaring_list
37struct 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 ( ( * (f9) __attribute__(( unused )) ) __attribute__(( unused )) );
45};
46
47
48// asm_name_opt
49int f() asm( "xyz" ) __attribute__(( unused ));
50
51
52// variable_declarator
53const __attribute__(( used )) int vd1 __attribute__(( used )), __attribute__(( unused )) vd2;
54const __attribute__(( used )) int __attribute__(( used )) * __attribute__(( used )) vd3 __attribute__(( used )), __attribute__(( unused )) (* __attribute__(( unused )) (vd4)) __attribute__(( used ));
55const __attribute__(( used )) int __attribute__(( used )) vd5[5] __attribute__(( used )), __attribute__(( unused )) ((vd6)[5]) __attribute__(( used ));
56const __attribute__(( used )) int __attribute__(( used )) (* __attribute__(( used )) vd7)() __attribute__(( used )), __attribute__(( unused )) ((* __attribute__(( used )) vd8)()) __attribute__(( used ));
57
58
59// function_declarator
60__attribute__(( unused )) int f1() __attribute__(( used ));
61__attribute__(( unused )) int f1() {}
62__attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() __attribute__(( used ));
63__attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() {}
64__attribute__(( unused )) int (* __attribute__(( unused )) f3(int))[] __attribute__(( used ));
65__attribute__(( unused )) int (* __attribute__(( unused )) f3(int p))[] {}
66__attribute__(( unused )) int (* __attribute__(( unused )) f4())(int) __attribute__(( used ));
67__attribute__(( unused )) int (* __attribute__(( unused )) f4())(int) {}
68
69
70// variable_type_redeclarator
71typedef int t1, t2, t3, t4, t5, t6, t7, t8;
72int vtr() {
73    // redefine typedef name in new scope
74    __attribute__(( unused )) int __attribute__(( unused )) t1 __attribute__(( used ));
75    __attribute__(( unused )) int __attribute__(( unused )) (* (* t2 __attribute__(( unused )) ) __attribute__(( unused )) ) __attribute__(( unused ));
76    __attribute__(( unused )) int __attribute__(( unused )) t3[5] __attribute__(( unused ));
77    __attribute__(( unused )) int __attribute__(( unused )) (* (* __attribute__(( unused )) t4[5]) __attribute__(( unused )) ) __attribute__(( unused ));
78    __attribute__(( unused )) int __attribute__(( unused )) t5() __attribute__(( unused ));
79    __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) ((t6))() __attribute__(( unused ));
80}
81
82
83// identifier_parameter_declarator
84int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
85          __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) );
86int ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),
87          __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) ) {}
88int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
89          __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) );
90int ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),
91          __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) ) {}
92int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
93          __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) );
94int ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),
95          __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) ) {}
96int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
97          __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) );
98int ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),
99          __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) ) {}
100
101
102// type_parameter_redeclarator
103typedef int Foo;
104int tpr1( __attribute__(( unused )) int __attribute__(( unused )) Foo __attribute__(( unused )) );
105int tpr2( __attribute__(( unused )) int __attribute__(( unused )) (* __attribute__(( unused )) (* __attribute__(( unused )) Foo) __attribute__(( unused )) ) __attribute__(( unused )) );
106int tpr3( __attribute__(( unused )) int __attribute__(( unused )) Foo[]  __attribute__(( unused )));
107int tpr4( __attribute__(( unused )) int __attribute__(( unused )) ( __attribute__(( unused )) Foo[5] __attribute__(( unused )) ) );
108int tpr5( __attribute__(( unused )) int __attribute__(( unused )) (*Foo)() __attribute__(( unused )) );
109int tpr6( __attribute__(( unused )) int __attribute__(( unused )) Foo() __attribute__(( unused )) );
110int tpr7( __attribute__(( unused )) int __attribute__(( unused )) ( __attribute__(( unused )) Foo( __attribute__(( unused )) int __attribute__(( unused )) ) ) );
111
112
113// abstract_declarator
114int ad() {
115    typeof( int __attribute__(( used )) ) ad1 __attribute__(( unused ));
116    typeof( int __attribute__(( unused )) * __attribute__(( unused )) ) ad2 __attribute__(( unused ));
117    typeof( int __attribute__(( unused )) [5] ) __attribute__(( unused )) ad3 __attribute__(( unused ));
118    typeof( __attribute__(( unused )) int __attribute__(( unused )) (*)[10] __attribute__(( unused )) ) __attribute__(( unused )) ad4 __attribute__(( unused )), ad5 __attribute__(( used ));
119    typeof( __attribute__(( unused )) int __attribute__(( unused )) () __attribute__(( unused )) ) __attribute__(( unused )) ad6 __attribute__(( unused ));
120    sizeof( __attribute__(( unused )) int __attribute__(( unused )) );
121    sizeof( __attribute__(( unused )) int __attribute__(( unused )) (* __attribute__(( unused )) (* __attribute__(( unused )) ) ) );
122    sizeof( __attribute__(( unused )) int __attribute__(( unused )) [5] __attribute__(( unused )) );
123    sizeof( __attribute__(( unused )) int __attribute__(( unused )) (*)[10] __attribute__(( unused )) );
124    sizeof( __attribute__(( unused )) int __attribute__(( unused )) () __attribute__(( unused )) );
125    sizeof( struct { int i; } __attribute__(( unused )) );
126    sizeof( enum { R } __attribute__(( unused )) );
127}
128
129
130// abstract_parameter_declarator
131int apd1( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )),
132        __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) );
133int apd2( __attribute__(( unused )) int __attribute__(( unused )) (* (* __attribute__(( unused )) ) __attribute__(( unused )) ),
134        __attribute__(( unused )) int __attribute__(( unused )) (* (* __attribute__(( unused )) ) __attribute__(( unused )) ) );
135int apd3( __attribute__(( unused )) int __attribute__(( unused )) ([]) __attribute__(( unused )),
136        __attribute__(( unused )) int __attribute__(( unused )) ([]) __attribute__(( unused )) );
137int apd4( __attribute__(( unused )) int __attribute__(( unused )) ()  __attribute__(( unused )),
138        __attribute__(( unused )) int __attribute__(( unused )) ()  __attribute__(( unused )) );
139int apd5( __attribute__(( unused )) int __attribute__(( unused )) (( __attribute__(( unused )) int )) __attribute__(( unused )),
140        __attribute__(( unused )) int __attribute__(( unused )) ( __attribute__(( unused )) int ) __attribute__(( unused )) );
141int apd6( __attribute__(( unused )) int __attribute__(( unused )) (*)()  __attribute__(( unused )),
142        __attribute__(( unused )) int __attribute__(( unused )) (*)()  __attribute__(( unused )) );
143int apd7( __attribute__(( unused )) int __attribute__(( unused )) ((*)( __attribute__(( unused )) int ) ) __attribute__(( unused )),
144        __attribute__(( unused )) int __attribute__(( unused )) ((*)( __attribute__(( unused )) int ) ) __attribute__(( unused )) );
145
146
147// variable_abstract_declarator
148struct Vad {
149    int __attribute__(( unused ));
150    int __attribute__(( unused )) :4;
151    int __attribute__(( unused )) :4, __attribute__(( unused )) :6;
152};
153
154// Local Variables: //
155// tab-width: 4 //
156// compile-command: "cfa attributes.cfa" //
157// End: //
Note: See TracBrowser for help on using the repository browser.