Changeset 641707d
- Timestamp:
- Jan 31, 2025, 1:52:18 PM (4 weeks ago)
- Branches:
- master
- Children:
- bbbff10
- Parents:
- 372d33c
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/collections/vector.hfa ¶
r372d33c r641707d 97 97 static inline void reserve(vector(T, allocator_t)* this, size_t size) 98 98 { 99 realloc_storage(&this->storage, this->size+1);99 realloc_storage(&this->storage, size); 100 100 } 101 101 -
TabularUnified tests/.expect/attributes.x86.txt ¶
r372d33c r641707d 1177 1177 __attribute__ ((unused)) signed int **const _X10_retval_f2KPPi_1; 1178 1178 { 1179 ((void)((*((signed int ***)(&_X10_retval_f2KPPi_1)))=((void*)((unsigned longint )0))) /* ?{} */);1179 ((void)((*((signed int ***)(&_X10_retval_f2KPPi_1)))=((void*)((unsigned int )0))) /* ?{} */); 1180 1180 } 1181 1181 … … 1191 1191 1192 1192 { 1193 ((void)(_X10_retval_f5PA0i_1=((void*)((unsigned longint )0))) /* ?{} */);1193 ((void)(_X10_retval_f5PA0i_1=((void*)((unsigned int )0))) /* ?{} */); 1194 1194 } 1195 1195 … … 1203 1203 1204 1204 { 1205 ((void)(_X10_retval_f6PA0i_1=((void*)((unsigned longint )0))) /* ?{} */);1205 ((void)(_X10_retval_f6PA0i_1=((void*)((unsigned int )0))) /* ?{} */); 1206 1206 } 1207 1207 … … 1212 1212 __attribute__ ((unused)) signed int (*_X10_retval_f8Fi_i__1)(signed int __param_0); 1213 1213 { 1214 ((void)(_X10_retval_f8Fi_i__1=((void*)((unsigned longint )0))) /* ?{} */);1214 ((void)(_X10_retval_f8Fi_i__1=((void*)((unsigned int )0))) /* ?{} */); 1215 1215 } 1216 1216 … … 1220 1220 __attribute__ ((unused)) signed int (*_X10_retval_f9Fi_i__1)(signed int __param_0); 1221 1221 { 1222 ((void)(_X10_retval_f9Fi_i__1=((void*)((unsigned longint )0))) /* ?{} */);1222 ((void)(_X10_retval_f9Fi_i__1=((void*)((unsigned int )0))) /* ?{} */); 1223 1223 } 1224 1224 … … 1228 1228 __attribute__ ((unused)) signed int (*_X11_retval_f10Fi_i__1)(signed int __param_0); 1229 1229 { 1230 ((void)(_X11_retval_f10Fi_i__1=((void*)((unsigned longint )0))) /* ?{} */);1230 ((void)(_X11_retval_f10Fi_i__1=((void*)((unsigned int )0))) /* ?{} */); 1231 1231 } 1232 1232 -
TabularUnified tests/Makefile.am ¶
r372d33c r641707d 109 109 io/manipulatorsInput-uchunk \ 110 110 io/many_read \ 111 math \112 minmax \113 operators \114 poly-many-arsz \115 polymorphism \116 111 raii/ctor-autogen \ 117 112 raii/dtor-early-exit \ 118 113 raii/init_once \ 119 114 references \ 120 shortCircuit \121 sum \122 switch \123 115 tuple/tupleCast \ 124 tuple/tupleMember \ 125 userLiterals \ 126 vector 116 tuple/tupleMember 127 117 128 118 WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}} -
TabularUnified tests/math.cfa ¶
r372d33c r641707d 55 55 56 56 struct S { int i; }; 57 double ?*?( double d, S s ) { return d * s.i; }58 double ?/?( double d, S s ) { return d / s.i; }59 57 S ?\?( S s, unsigned long y ) { return (S){ s.i \ y }; } 60 58 ofstream & ?|?( ofstream & os, S s ) { return os | s.i; } -
TabularUnified tests/minmax.cfa ¶
r372d33c r641707d 18 18 19 19 int main( void ) { 20 // char does not have less or greater than.21 int ?<?( char op1, char op2 ) { return (int)op1 < (int)op2; }22 int ?>?( char op1, char op2 ) { return (int)op1 > (int)op2; }23 24 20 sout | "char\t\t\t" | 'z' | ' ' | 'a' | "\tmin " | min( 'z', 'a' ); 25 21 sout | "signed int\t\t" | 4 | -3 | "\tmin" | min( 4, -3 ); -
TabularUnified tests/operators.cfa ¶
r372d33c r641707d 1 int ?*?( int a, int b) {1 int ?*?( int, int ) { 2 2 return 0; 3 3 } … … 7 7 } 8 8 9 int ?+?( int a, int b) {9 int ?+?( int, int ) { 10 10 return 0; 11 11 } 12 12 13 int ?=?( int & a, int b) {13 int ?=?( int &, int ) { 14 14 return 0; 15 15 } … … 18 18 }; 19 19 20 char ?()( struct accumulator a, char number1, char number2) {20 char ?()( struct accumulator, char, char ) { 21 21 return 'a'; 22 22 } 23 23 24 24 void f( void ) { 25 char a , b;25 char a = 0, b = 0; 26 26 ?()( a, b ); 27 27 a(b); … … 29 29 } 30 30 31 int main( int argc, char const *argv[]) {31 int main() { 32 32 /* code */ 33 33 printf( "done\n" ); // non-empty .expect file -
TabularUnified tests/poly-many-arsz.cfa ¶
r372d33c r641707d 29 29 30 30 mypair(char[2], char) y @= {}; 31 printf("|y| = % ld\n", sizeof(y)); // 331 printf("|y| = %zd\n", sizeof(y)); // 3 32 32 33 33 y.second = 0; … … 43 43 // adding this declaration of x ... 44 44 mypair(char[1], char) x @= {}; 45 printf("|x| = %ld\n", sizeof(x)); // 2 45 printf("|x| = %zd\n", sizeof(x)); // 2 46 47 // ... even if it isn't really used ... 48 (void)x; 46 49 47 50 // ... must not affect the observed facts of y: 48 51 49 52 mypair(char[2], char) y @= {}; 50 printf("|y| = % ld\n", sizeof(y)); // 353 printf("|y| = %zd\n", sizeof(y)); // 3 51 54 52 55 y.second = 0; -
TabularUnified tests/polymorphism.cfa ¶
r372d33c r641707d 29 29 30 30 forall( T, U ) 31 size_t struct_size( T i, U j) {31 size_t struct_size( T, U ) { 32 32 struct S { T i; U j; }; 33 33 return sizeof(S); … … 35 35 36 36 forall( T, U ) 37 size_t union_size( T i, U j) {37 size_t union_size( T, U ) { 38 38 union B { T i; U j; }; 39 39 return sizeof(B); … … 42 42 // perform some simple operations on aggregates of T and U 43 43 forall( T | { void print(T); int ?==?(T, T); }, U | { void print(U); U ?=?(U&, zero_t); } ) 44 U foo(T i, U j) {44 U foo(T i, U) { 45 45 struct S { T i; U j; }; 46 46 union B { T i; U j; }; … … 68 68 double & x_inner_double = x; \ 69 69 float & x_inner_float = x; \ 70 printf(" offset of inner double: % ld\n", ((char *) & x_inner_double) - ((char *) & x) ); \71 printf(" offset of inner float: % ld\n", ((char *) & x_inner_float ) - ((char *) & x) );70 printf(" offset of inner double: %zd\n", ((char *) & x_inner_double) - ((char *) & x) ); \ 71 printf(" offset of inner float: %zd\n", ((char *) & x_inner_float ) - ((char *) & x) ); 72 72 73 73 void showStatic( thing(long long int) & x ) { -
TabularUnified tests/shortCircuit.cfa ¶
r372d33c r641707d 1 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 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 // shortCircuit.cfa -- 8 // 6 // 7 // shortCircuit.cfa -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Thu Jan 28 18:26:16 2016 … … 12 12 // Last Modified On : Tue Dec 4 18:26:05 2018 13 13 // Update Count : 4 14 // 14 // 15 15 16 void g( float f) {}17 void g( int i) {}16 void g( float ) {} 17 void g( int ) {} 18 18 19 19 void f( int a ) { 20 int b ;21 float c ;20 int b = 0; 21 float c = 0; 22 22 g( a ? b : c ); 23 23 g( a && c ); … … 26 26 27 27 void g() { 28 int a ;29 struct { int b; } a;28 int a = 1; 29 struct Int { int b; } a = { 0 }; 30 30 if ( a ) { 31 31 while ( a ) { … … 35 35 } 36 36 } 37 // This should never be resolved to. 38 (void)(Int)a; 37 39 } 38 40 … … 43 45 }; 44 46 45 int ?!=?( test_t lhs, int rhs) {47 int ?!=?( test_t lhs, zero_t ) { 46 48 sout | lhs.x | " "; 47 49 return lhs.x != 0; 48 50 } 49 51 50 int main( int argc, char const *argv[]) {52 int main() { 51 53 sout | nlOff; 52 54 test_t true_val, false_val; -
TabularUnified tests/sum.cfa ¶
r372d33c r641707d 87 87 struct S { int i, j; }; 88 88 void ?{}( S & s ) { s.[i, j] = 0; } 89 void ?{}( S & s, int i ) { s.[i, j] = [i, 0]; }90 89 void ?{}( S & s, int i, int j ) { s.[i, j] = [i, j]; } 91 90 void ?{}( S & s, zero_t ) { s.[i, j] = 0; } -
TabularUnified tests/switch.cfa ¶
r372d33c r641707d 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // switch.cfa -- 7 // switch.cfa -- 8 8 // 9 9 // Author : Peter A. Buhr … … 12 12 // Last Modified On : Fri Jan 17 14:10:12 2025 13 13 // Update Count : 45 14 // 14 // 15 15 16 16 int f( int i ) { return i; } … … 57 57 default: 58 58 i = 3; 59 s = (S){ -7 }; 60 fallthrough; 59 61 case 19: 60 62 case 'A' ... 'Z': … … 63 65 j = 3; 64 66 f( 3 ); 67 k = 5; 65 68 break; 66 69 } // switch … … 92 95 i = 3; 93 96 f( 3 ); 97 s = (S){ -7 }; 94 98 default: 95 99 j = 3; … … 98 102 fallthrough; 99 103 case 'd': 100 j= 5;104 k = 5; 101 105 } // choose 102 106 -
TabularUnified tests/userLiterals.cfa ¶
r372d33c r641707d 15 15 16 16 #include <fstream.hfa> 17 #include <uchar.h> 18 19 // Warning triggered by the standard header, we can't fix that. 20 #pragma GCC diagnostic push 21 #pragma GCC diagnostic ignored "-Wtype-limits" 17 22 #include <wchar.h> 18 # include <uchar.h>23 #pragma GCC diagnostic pop 19 24 20 25 int ?`s( int s ) { sout | "secs" | s; return s; }
Note: See TracChangeset
for help on using the changeset viewer.