- Timestamp:
- Feb 5, 2023, 11:42:15 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 8fa77eb
- Parents:
- 9ef5516 (diff), 35d1de5 (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. - Location:
- tests
- Files:
-
- 6 added
- 5 edited
-
.expect/forall.txt (modified) (1 diff)
-
Makefile.am (modified) (3 diffs)
-
concurrent/actors/.expect/dynamic.txt (added)
-
concurrent/actors/.expect/executor.txt (added)
-
concurrent/actors/.expect/static.txt (added)
-
concurrent/actors/dynamic.cfa (added)
-
concurrent/actors/executor.cfa (added)
-
concurrent/actors/matrix.cfa (modified) (1 diff)
-
concurrent/actors/static.cfa (added)
-
concurrent/actors/types.cfa (modified) (3 diffs)
-
forall.cfa (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/forall.txt
r9ef5516 r6d2af204 1 forall.cfa:244:25: warning: Compiled 1 1 2 f 3 97 4 f 5 g 6 f 7 f 8 g 9 fT 10 fT 11 fT 12 fTU 13 fTU 14 fTU 15 1 2 16 2 1 17 1, 2 18 @ 0 2 0 4 6.4 6.4 6.4 6.4+3.i 4 19 3. 3. 20 45 21 12 3 -
tests/Makefile.am
r9ef5516 r6d2af204 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Jun 5 14:49:25 202114 ## Update Count : 9 213 ## Last Modified On : Fri Feb 3 23:06:44 2023 14 ## Update Count : 94 15 15 ############################################################################### 16 16 … … 89 89 meta/fork+exec.hfa \ 90 90 concurrent/unified_locking/mutex_test.hfa \ 91 concurrent/channels/parallel_harness.hfa91 concurrent/channels/parallel_harness.hfa 92 92 93 93 dist-hook: … … 183 183 CFACOMPILE_SYNTAX = $(CFACOMPILETEST) -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o $(abspath ${@}) 184 184 185 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall\185 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \ 186 186 init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment 187 187 $(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN) -
tests/concurrent/actors/matrix.cfa
r9ef5516 r6d2af204 5 5 #include <stdio.h> 6 6 7 unsigned int xr = 100, xc = 100, yc = 100, Processors = 1; // default values7 unsigned int xr = 500, xc = 500, yc = 500, Processors = 1; // default values 8 8 9 9 struct derived_actor { -
tests/concurrent/actors/types.cfa
r9ef5516 r6d2af204 5 5 #include <stdio.h> 6 6 #include <mutex_stmt.hfa> 7 8 struct dummy_actor { actor a; }; // this won't work since the actor isn't inlined 7 9 8 10 struct derived_actor { … … 26 28 } 27 29 30 Allocation receive( derived_actor & receiver, d_msg & msg ) { 31 return receive( receiver, msg.num ); 32 } 33 28 34 struct derived_actor2 { 35 struct nested { int i; }; // testing nested before inline 29 36 inline actor; 30 37 }; 31 38 static inline void ?{}( derived_actor2 & this ) { ((actor &)this){}; } 39 40 Allocation receive( derived_actor2 & receiver, d_msg & msg ) { 41 mutex(sout) sout | msg.num; 42 return Finished; 43 } 32 44 33 45 struct derived_actor3 { … … 41 53 }; 42 54 static inline void ?{}( d_msg2 & this ) { ((message &)this){}; } 43 44 Allocation receive( derived_actor2 & receiver, d_msg & msg ) {45 mutex(sout) sout | msg.num;46 return Finished;47 }48 49 Allocation receive( derived_actor & receiver, d_msg & msg ) {50 return receive( receiver, msg.num );51 }52 55 53 56 Allocation receive( derived_actor3 & receiver, d_msg & msg ) { -
tests/forall.cfa
r9ef5516 r6d2af204 10 10 // Created On : Wed May 9 08:48:15 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 5 10:06:08 2021 13 // Update Count : 36 14 // 12 // Last Modified On : Sun Feb 5 07:54:43 2023 13 // Update Count : 90 14 // 15 16 #include <fstream.hfa> 15 17 16 18 void g1() { 17 forall( T ) T f( T ) {}; 18 void f( int ) {}; 19 void h( void (*p)(void) ) {}; 20 21 int x; 22 void (*y)(void); 23 char z; 24 float w; 19 forall( T ) T f( T p ) { sout | 'f'; return p; }; 20 void f( int p ) { sout | p; }; 21 void g( void ) { sout | 'g'; }; 22 void h( void (*p)(void) ) { p(); }; 23 24 int x = 1; 25 void (*y)(void) = g; 26 char z = 'a'; 27 float w = 3.5; 25 28 26 29 f( x ); … … 28 31 f( z ); 29 32 f( w ); 33 h( y ); 34 f( y ); 30 35 h( f( y ) ); 31 36 } 32 37 33 38 void g2() { 34 forall( T ) void f( T, T ) { }35 forall( T, U ) void f( T, U ) { }39 forall( T ) void f( T, T ) { sout | "fT"; } 40 forall( T, U ) void f( T, U ) { sout | "fTU"; } 36 41 37 42 int x; 38 43 float y; 39 int *z; 40 float *w; 41 44 int * z; 45 float * w; 46 47 f( x, x ); 48 f( y, y ); 49 f( w, w ); 42 50 f( x, y ); 43 51 f( z, w ); … … 50 58 51 59 forall( T ) 52 void swap( T left, T right ) { 53 T temp = left; 54 left = right; 55 right = temp; 56 } 57 58 trait sumable( T ) { 60 void swap( T & left, T & right ) { // by reference 61 T temp = left; 62 left = right; 63 right = temp; 64 } 65 66 forall( T ) 67 [ T, T ] swap( T i, T j ) { // by value 68 return [ j, i ]; 69 } 70 71 forall( T ) trait sumable { 59 72 void ?{}( T &, zero_t ); // 0 literal constructor 60 73 T ?+?( T, T ); // assortment of additions … … 64 77 }; // sumable 65 78 66 forall( T | sumable( T ) ) // use trait79 forall( T | sumable( T ) ) // use trait 67 80 T sum( size_t size, T a[] ) { 68 81 T total = 0; // initialize by 0 constructor … … 72 85 } // sum 73 86 74 forall( T | { T ?+?( T, T ); T ?++( T & ); [T] ?+=?( T &, T ); } )87 forall( T | { T ?+?( T, T ); T ?++( T & ); [T] ?+=?( T &, T ); } ) 75 88 T twice( T t ) { 76 89 return t + t; … … 82 95 } 83 96 84 intfred() {85 int x = 1, y = 2, a[10] ;97 void fred() { 98 int x = 1, y = 2, a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; 86 99 float f; 87 100 101 sout | x | y; 88 102 swap( x, y ); 89 twice( x ); 103 sout | x | y | nl | swap( x, y ); 104 // [ x, y ] = swap( y, x ); 105 sout | twice( ' ' ) | ' ' | twice( 0hh ) | twice( 1h ) | twice( 0n ) | twice( 2 ) 106 | twice( 3.2f ) | twice( 3.2 ) | twice( 3.2d ) | twice( 3.2+1.5i ) | twice( x ); 90 107 f = min( 4.0, 3.0 ); 91 sum( 10, a ); 108 sout | f | min( 4.0, 3.0 ); 109 sout | sum( 10, a ); 92 110 } 93 111 … … 186 204 187 205 forall( T ) { 188 extern "C" {206 // extern "C" { 189 207 struct SS { T t; }; 190 T foo( T ) {}191 }208 T foo( T p ) { return p; } 209 // } 192 210 } 193 211 … … 195 213 W(int,int) w; 196 214 197 intjane() {215 void jane() { 198 216 // int j = bar( 3, 4 ); 199 217 int k = baz( 3, 4, 5 ); 200 218 int i = foo( 3 ); 219 sout | k | i; 201 220 } 202 221 … … 211 230 T t; 212 231 T t2 = t; 232 sout | &tr | tp; 213 233 } 214 234 … … 242 262 243 263 int main( void ) { 244 #pragma GCC warning "Compiled" // force non-empty .expect file, NO TABS!!! 264 g1(); 265 g2(); 266 fred(); 267 jane(); 245 268 } 246 269
Note:
See TracChangeset
for help on using the changeset viewer.