Changeset cd28605 for tests/attributes.cfa
- Timestamp:
- Feb 6, 2025, 3:42:32 PM (11 months ago)
- Branches:
- master
- Children:
- eca364f7
- Parents:
- a8e2215
- File:
-
- 1 edited
-
tests/attributes.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/attributes.cfa
ra8e2215 rcd28605 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // attributes.cfa -- 6 // 7 // attributes.cfa -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Mon Feb 6 16:07:02 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 20 15:32:21 202413 // Update Count : 5312 // Last Modified On : Thu Feb 6 12:06:22 2025 13 // Update Count : 117 14 14 // 15 15 … … 37 37 38 38 // field_declaring_list 39 typedef short int shint; 39 40 struct Fdl { 40 41 int f1 __attribute__(( unused )); … … 50 51 int ( ( __attribute__(( unused )) * (f13) __attribute__(( unused )) ) __attribute__(( unused )) ); 51 52 int ( ( ( __attribute__(( unused )) * (f14) ) __attribute__(( unused )) ) __attribute__(( unused )) ); 53 // shint __attribute__(( used )) shi1; 54 // shint __attribute__(( used )) shi2 __attribute__(( used )); 55 __attribute__(( used )) shint shi3; 56 __attribute__(( used )) shint shi4 __attribute__(( used )); 57 // __attribute__(( used )) shint __attribute__(( used )) shi5 __attribute__(( used )); 52 58 }; 53 59 … … 63 69 const __attribute__(( used )) int __attribute__(( used )) (* __attribute__(( used )) vd7)() __attribute__(( used )), __attribute__(( unused )) ((* __attribute__(( used )) vd8)()) __attribute__(( used )); 64 70 const __attribute__(( used )) int __attribute__(( used )) ( __attribute__(( used )) * vd9)() __attribute__(( used )), __attribute__(( unused )) (( __attribute__(( used )) * vd10)()) __attribute__(( used )); 71 65 72 66 73 // function_declarator … … 91 98 __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) ((t6))() __attribute__(( unused )); 92 99 } 93 94 100 95 101 // identifier_parameter_declarator … … 164 170 }; 165 171 166 [[ noreturn ]] void fred() { 172 173 // statments 174 void fred() { 167 175 int [[unused]] i; 168 176 // C23 attributes are parsed but not pushed through the compiler. 169 177 // int [[gnu::xxx]] j; 170 178 switch ( 3 ) { 179 __attribute__((unused)) int ret; 171 180 case 2: 172 181 4; 173 // __attribute__(( fallthrough )) 174 // [[fallthrough]] 182 __attribute__(( fallthrough )); 183 [[fallthrough]]; 175 184 case 1: 176 185 3; 177 186 } 178 abort(); 179 } 180 181 @[ noreturn ] void mary() { 182 @[aligned(16)] struct S { int i; }; 187 L : __attribute__(( unused )) goto L; 188 L1 : [[ unused ]] L2 : [[ unused ]] goto L2; 189 __attribute__(( unused )) return; 190 [[ noreturn ]] return; 191 __attribute__(( noreturn )) return; 192 [[ GNU::fred ]] i += 1; 193 } 194 195 void mary() { 196 @[aligned(64)] struct S { int i; }; 183 197 int @[unused] i; 184 198 switch ( 3 ) { 185 199 case 2: 186 200 4; 187 // __attribute__(( fallthrough )) 188 // [[fallthrough]] 201 __attribute__(( fallthrough )); 202 @[fallthrough]; 189 203 case 1: 190 204 3; 191 205 } 192 abort(); 206 L : __attribute__(( unused )) goto L; 207 L1 : @[ unused ] L2 : @[ unused ] goto L2; 208 __attribute__(( unused )) return; 209 @[ noreturn ] return; 210 __attribute__(( noreturn )) return; 211 } 212 213 [[ noreturn ]] void jack() { 214 exit( -1 ); 193 215 } 194 216
Note:
See TracChangeset
for help on using the changeset viewer.