Changeset 49510db for tests/attributes.cfa
- Timestamp:
- Jan 29, 2025, 9:09:20 AM (8 months ago)
- Branches:
- master
- Children:
- a22e8b4
- Parents:
- a950021 (diff), c699602 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/attributes.cfa
ra950021 r49510db 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 3 // 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 -- 8 // 6 // 7 // attributes.cfa -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Mon Feb 6 16:07:02 2017 … … 12 12 // Last Modified On : Fri Dec 20 15:32:21 2024 13 13 // Update Count : 53 14 // 14 // 15 15 16 #pragma GCC diagnostic ignored "-Wattributes" 16 17 17 18 // label attribute 18 19 int la() { 19 20 L: __attribute__(( unused )) 1; 21 return 1; 20 22 } 21 23 … … 64 66 // function_declarator 65 67 __attribute__(( unused )) int f1() __attribute__(( used )); 66 __attribute__(( unused )) int f1() { }68 __attribute__(( unused )) int f1() { return 1; } 67 69 __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() __attribute__(( used )); 68 __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() { }70 __attribute__(( unused )) int * __attribute__(( unused )) * const __attribute__(( unused )) f2() { return 0p; } 69 71 __attribute__(( unused )) int (* __attribute__(( unused )) f3(int))[] __attribute__(( used )); 70 72 __attribute__(( unused )) int ( __attribute__(( unused )) * __attribute__(( unused )) f4(int))[] __attribute__(( used )); 71 __attribute__(( unused )) int (* __attribute__(( unused )) f5(int p))[] { }72 __attribute__(( unused )) int ( __attribute__(( unused )) * (f6)(int p))[] { }73 __attribute__(( unused )) int (* __attribute__(( unused )) f5(int p))[] { (void)p; return 0p; } 74 __attribute__(( unused )) int ( __attribute__(( unused )) * (f6)(int p))[] { (void)p; return 0p; } 73 75 __attribute__(( unused )) int (* __attribute__(( unused )) f7())(int) __attribute__(( used )); 74 __attribute__(( unused )) int (* __attribute__(( unused )) f8())(int) { }75 __attribute__(( unused )) int ( __attribute__(( unused )) * f9())(int) { }76 __attribute__(( unused )) int ( __attribute__(( unused )) * (f10)())(int) { }76 __attribute__(( unused )) int (* __attribute__(( unused )) f8())(int) { return 0p; } 77 __attribute__(( unused )) int ( __attribute__(( unused )) * f9())(int) { return 0p; } 78 __attribute__(( unused )) int ( __attribute__(( unused )) * (f10)())(int) { return 0p; } 77 79 78 80 79 81 // variable_type_redeclarator 80 82 typedef int t1, t2, t3, t4, t5, t6, t7, t8; 81 intvtr() {83 void vtr() { 82 84 // redefine typedef name in new scope 83 85 __attribute__(( unused )) int __attribute__(( unused )) t1 __attribute__(( used )); … … 92 94 93 95 // identifier_parameter_declarator 94 intipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),96 void ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )), 95 97 __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) ); 96 intipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )),98 void ipd1( __attribute__(( unused )) int __attribute__(( unused )) p __attribute__(( unused )), 97 99 __attribute__(( unused )) int __attribute__(( unused )) q __attribute__(( unused )) ) {} 98 intipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),100 void ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )), 99 101 __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) ); 100 intipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )),102 void ipd2( __attribute__(( unused )) int __attribute__(( unused )) * __attribute__(( unused )) p __attribute__(( unused )), 101 103 __attribute__(( unused )) int __attribute__(( unused )) (* (q)) __attribute__(( unused )) ) {} 102 intipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),104 void ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )), 103 105 __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) ); 104 intipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )),106 void ipd3( __attribute__(( unused )) int __attribute__(( unused )) p[] __attribute__(( unused )), 105 107 __attribute__(( unused )) int __attribute__(( unused )) ((q)[]) __attribute__(( unused )) ) {} 106 intipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),108 void ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )), 107 109 __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) ); 108 intipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )),110 void ipd4( __attribute__(( unused )) int __attribute__(( unused )) p() __attribute__(( unused )), 109 111 __attribute__(( unused )) int __attribute__(( unused )) ((q)()) __attribute__(( unused )) ) {} 110 112 … … 122 124 123 125 // abstract_declarator 124 intad() {126 void ad() { 125 127 typeof( int __attribute__(( used )) ) ad1 __attribute__(( unused )); 126 128 typeof( int __attribute__(( unused )) * __attribute__(( unused )) ) ad2 __attribute__(( unused )); … … 157 159 // variable_abstract_declarator 158 160 struct Vad { 159 int __attribute__(( unused )) ;161 int __attribute__(( unused )) x; 160 162 int __attribute__(( unused )) :4; 161 163 int __attribute__(( unused )) :4, __attribute__(( unused )) :6; … … 174 176 3; 175 177 } 178 abort(); 176 179 } 177 180 178 181 @[ noreturn ] void mary() { 179 @[aligned( 64)] struct S { int i; };182 @[aligned(16)] struct S { int i; }; 180 183 int @[unused] i; 181 184 switch ( 3 ) { … … 187 190 3; 188 191 } 192 abort(); 189 193 } 190 194
Note:
See TracChangeset
for help on using the changeset viewer.