- Timestamp:
- Feb 20, 2020, 4:15:51 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6a490b2
- Parents:
- dca5802 (diff), 2cbfe92 (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:
-
- 13 added
- 3 deleted
- 31 edited
- 20 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/alloc-ERROR.txt
rdca5802 rb7d6a36 1 alloc.cfa:31 1:1 error: No reasonable alternatives for expression Applying untyped:1 alloc.cfa:310:1 error: No reasonable alternatives for expression Applying untyped: 2 2 Name: ?=? 3 3 ...to: … … 19 19 20 20 21 alloc.cfa:31 2:1 error: No reasonable alternatives for expression Applying untyped:21 alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped: 22 22 Name: ?=? 23 23 ...to: … … 39 39 40 40 41 alloc.cfa:31 3:1 error: No reasonable alternatives for expression Applying untyped:41 alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped: 42 42 Name: ?=? 43 43 ...to: … … 50 50 51 51 52 alloc.cfa:31 4:1 error: No reasonable alternatives for expression Applying untyped:52 alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped: 53 53 Name: ?=? 54 54 ...to: -
tests/.expect/alloc.txt
rdca5802 rb7d6a36 2 2 CFA malloc 0xdeadbeef 3 3 CFA alloc 0xdeadbeef 4 CFA array alloc, fill 0xde5 4 CFA alloc, fill dededede 6 5 CFA alloc, fill 3 -
tests/.expect/loopctrl.txt
rdca5802 rb7d6a36 6 6 A 7 7 A A A A A A A A A A 8 A A A A A A A A A A A 8 9 B B B B B 9 10 C C C C C … … 12 13 13 14 0 1 2 3 4 5 6 7 8 9 15 0 1 2 3 4 5 6 7 8 9 10 14 16 1 3 5 7 9 15 17 10 8 6 4 2 … … 28 30 N N N N N N N N N N 29 31 0 1 2 3 4 5 6 7 8 9 32 0 1 2 3 4 5 6 7 8 9 10 30 33 10 9 8 7 6 5 4 3 2 1 31 34 -
tests/.expect/nested-types-ERR1.txt
rdca5802 rb7d6a36 1 nested-types.cfa: 70:1 error: Use of undefined type T1 nested-types.cfa:83:1 error: Use of undefined type T -
tests/.expect/nested-types-ERR2.txt
rdca5802 rb7d6a36 1 nested-types.cfa: 73:1 error: Use of undefined global type Z2 nested-types.cfa: 74:1 error: Qualified type requires an aggregate on the left, but has: signed int3 nested-types.cfa: 75:1 error: Undefined type in qualified type: Qualified Type:1 nested-types.cfa:86:1 error: Use of undefined global type Z 2 nested-types.cfa:87:1 error: Qualified type requires an aggregate on the left, but has: signed int 3 nested-types.cfa:88:1 error: Undefined type in qualified type: Qualified Type: 4 4 instance of struct S with body 1 5 5 instance of type Z (not function type) -
tests/.expect/rational.txt
rdca5802 rb7d6a36 1 1 constructor 2 3/1 4/1 0/1 2 3/1 4/1 0/1 0/1 1/1 3 3 1/2 5/7 4 4 2/3 -3/2 -
tests/.expect/time.txt
rdca5802 rb7d6a36 18 18 Dividing that by 2 gives 2403.5 seconds 19 19 4807 seconds is 1 hours, 20 minutes, 7 seconds 20 2020 Jan 5 14:01:40 (GMT) 21 1970 Jan 5 14:00:00 (GMT) 22 1973 Jan 2 06:59:00 (GMT) -
tests/Makefile.in
rdca5802 rb7d6a36 364 364 am__v_CFA_0 = @echo " CFA " $@; 365 365 am__v_CFA_1 = 366 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@)367 am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@)368 am__v_JAVAC_0 = @echo " JAVAC " $@;369 am__v_JAVAC_1 =370 AM_V_GOC = $(am__v_GOC_@AM_V@)371 am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@)372 am__v_GOC_0 = @echo " GOC " $@;373 am__v_GOC_1 =374 366 UPPCC = u++ 375 367 UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS) … … 378 370 am__v_UPP_0 = @echo " UPP " $@; 379 371 am__v_UPP_1 = 372 AM_V_GOC = $(am__v_GOC_@AM_V@) 373 am__v_GOC_ = $(am__v_GOC_@AM_DEFAULT_V@) 374 am__v_GOC_0 = @echo " GOC " $@; 375 am__v_GOC_1 = 376 AM_V_PY = $(am__v_PY_@AM_V@) 377 am__v_PY_ = $(am__v_PY_@AM_DEFAULT_V@) 378 am__v_PY_0 = @echo " PYTHON " $@; 379 am__v_PY_1 = 380 AM_V_RUST = $(am__v_RUST_@AM_V@) 381 am__v_RUST_ = $(am__v_RUST_@AM_DEFAULT_V@) 382 am__v_RUST_0 = @echo " RUST " $@; 383 am__v_RUST_1 = 384 AM_V_NODEJS = $(am__v_NODEJS_@AM_V@) 385 am__v_NODEJS_ = $(am__v_NODEJS_@AM_DEFAULT_V@) 386 am__v_NODEJS_0 = @echo " NODEJS " $@; 387 am__v_NODEJS_1 = 388 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@) 389 am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@) 390 am__v_JAVAC_0 = @echo " JAVAC " $@; 391 am__v_JAVAC_1 = 380 392 debug = yes 381 393 installed = no -
tests/alloc.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 22 15:34:19 201913 // Update Count : 40 412 // Last Modified On : Sun Feb 16 09:21:13 2020 13 // Update Count : 405 14 14 // 15 15 … … 48 48 49 49 p = alloc_set( fill ); // CFA alloc, fill 50 printf( "CFA array alloc, fill %#hhx\n", fill );51 50 printf( "CFA alloc, fill %08x\n", *p ); 52 51 free( p ); -
tests/concurrent/examples/boundedBufferEXT.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Apr 18 22:52:12 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 08:19:20 201913 // Update Count : 1 412 // Last Modified On : Thu Jan 16 22:36:34 2020 13 // Update Count : 15 14 14 // 15 15 … … 37 37 38 38 void insert( Buffer(T) & mutex buffer, T elem ) with( buffer ) { 39 if ( count == BufferSize ) waitfor( remove ,buffer );39 if ( count == BufferSize ) waitfor( remove : buffer ); 40 40 elements[back] = elem; 41 41 back = ( back + 1 ) % BufferSize; … … 44 44 45 45 T remove( Buffer(T) & mutex buffer ) with( buffer ) { 46 if ( count == 0 ) waitfor( insert ,buffer );46 if ( count == 0 ) waitfor( insert : buffer ); 47 47 T elem = elements[front]; 48 48 front = ( front + 1 ) % BufferSize; -
tests/concurrent/examples/boundedBufferTHREAD.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Apr 18 22:52:12 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 11:50:12 201913 // Update Count : 2 412 // Last Modified On : Thu Jan 16 23:09:43 2020 13 // Update Count : 25 14 14 // 15 15 … … 44 44 void main( Buffer & buffer ) with( buffer ) { 45 45 for () { 46 waitfor( ^?{} ,buffer ) {46 waitfor( ^?{} : buffer ) { 47 47 break; 48 } or when ( count != 20 ) waitfor( insert ,buffer ) {48 } or when ( count != 20 ) waitfor( insert : buffer ) { 49 49 back = (back + 1) % 20; 50 50 count += 1; 51 } or when ( count != 0 ) waitfor( remove ,buffer ) {51 } or when ( count != 0 ) waitfor( remove : buffer ) { 52 52 front = (front + 1) % 20; 53 53 count -= 1; -
tests/concurrent/examples/gortn.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Feb 20 08:02:37 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 21 08:25:03 201913 // Update Count : 412 // Last Modified On : Thu Jan 16 22:43:40 2020 13 // Update Count : 5 14 14 // 15 15 … … 26 26 void main( GoRtn & gortn ) with( gortn ) { 27 27 for () { 28 waitfor( mem1 ,gortn ) sout | i;29 or waitfor( mem2 ,gortn ) sout | f;30 or waitfor( mem3 ,gortn ) sout | m.i | m.j;31 or waitfor( ^?{} ,gortn ) break;28 waitfor( mem1 : gortn ) sout | i; 29 or waitfor( mem2 : gortn ) sout | f; 30 or waitfor( mem3 : gortn ) sout | m.i | m.j; 31 or waitfor( ^?{} : gortn ) break; 32 32 } 33 33 } -
tests/concurrent/examples/quickSort.cfa
rdca5802 rb7d6a36 11 11 // Created On : Wed Dec 6 12:15:52 2017 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Thu Oct 10 13:58:18 201914 // Update Count : 17 613 // Last Modified On : Wed Feb 12 18:24:47 2020 14 // Update Count : 177 15 15 // 16 16 … … 27 27 28 28 void ?{}( Quicksort & qs, int values[], int size, int depth ) { 29 qs. values = values; qs.low = 0; qs.high = size; qs.depth = depth;29 qs.[values, low, high, depth] = [values, 0, size, depth]; 30 30 } // Quicksort 31 31 … … 167 167 values[counter] = size - counter; // descending values 168 168 } // for 169 for ( i nt i = 0; i < 200; i +=1 ) {// random shuffle a few values169 for ( i; 200 ) { // random shuffle a few values 170 170 swap( values[rand() % size], values[rand() % size] ); 171 171 } // for -
tests/concurrent/waitfor/barge.cfa
rdca5802 rb7d6a36 65 65 yield(random( 10 )); 66 66 this.state = WAITFOR; 67 waitfor(do_call ,this) {67 waitfor(do_call : this) { 68 68 sout | i; 69 69 } -
tests/concurrent/waitfor/dtor.cfa
rdca5802 rb7d6a36 47 47 yield(random( 10 )); 48 48 set_state( this, MAIN ); 49 waitfor( ^?{} ,this ) {49 waitfor( ^?{} : this ) { 50 50 set_state( this, AFTER ); 51 51 } -
tests/concurrent/waitfor/else.cfa
rdca5802 rb7d6a36 14 14 sout | "Starting"; 15 15 16 when( false ) waitfor( notcalled ,m );16 when( false ) waitfor( notcalled : m ); 17 17 18 18 sout | "Step" | i++; 19 19 20 waitfor( notcalled ,m ); or else {20 waitfor( notcalled : m ); or else { 21 21 sout | "else called"; 22 22 } … … 24 24 sout | "Step" | i++; 25 25 26 when( true ) waitfor( notcalled ,m ); or when( true ) else {26 when( true ) waitfor( notcalled : m ); or when( true ) else { 27 27 sout | "else called"; 28 28 } … … 30 30 sout | "Step" | i++; 31 31 32 when( false ) waitfor( notcalled ,m ); or when( true ) else {32 when( false ) waitfor( notcalled : m ); or when( true ) else { 33 33 sout | "else called"; 34 34 } … … 36 36 sout | "Step" | i++; 37 37 38 when( false ) waitfor( notcalled ,m ); or when( false ) else {38 when( false ) waitfor( notcalled : m ); or when( false ) else { 39 39 sout | "else called"; 40 40 } -
tests/concurrent/waitfor/parse.cfa
rdca5802 rb7d6a36 24 24 25 25 //--------------------------------------- 26 waitfor( f1 ,a ) {26 waitfor( f1 : a ) { 27 27 1; 28 28 } 29 29 30 30 //--------------------------------------- 31 waitfor( f1 ,a ) {31 waitfor( f1 : a ) { 32 32 2; 33 33 } 34 waitfor( f2 ,a ) {34 waitfor( f2 : a ) { 35 35 3; 36 36 } 37 37 38 38 //--------------------------------------- 39 when( 1 < 3 ) waitfor( f2 ,a, a ) {39 when( 1 < 3 ) waitfor( f2 : a, a ) { 40 40 4; 41 41 } … … 45 45 46 46 //--------------------------------------- 47 when( 2 < 3 ) waitfor( f3 ,a ) {47 when( 2 < 3 ) waitfor( f3 : a ) { 48 48 5; 49 49 } … … 53 53 54 54 //--------------------------------------- 55 when( 3 < 3 ) waitfor( f3 ,a, a ) {55 when( 3 < 3 ) waitfor( f3 : a, a ) { 56 56 7; 57 57 } … … 64 64 65 65 //--------------------------------------- 66 when( 6 < 3 ) waitfor( f3 ,a, a, a ) {66 when( 6 < 3 ) waitfor( f3 : a, a, a ) { 67 67 10; 68 68 } 69 or when( 7 < 3 ) waitfor( f1 ,a ) {69 or when( 7 < 3 ) waitfor( f1 : a ) { 70 70 11; 71 71 } … … 75 75 76 76 //--------------------------------------- 77 when( 8 < 3 ) waitfor( f3 ,a, a ) {77 when( 8 < 3 ) waitfor( f3 : a, a ) { 78 78 13; 79 79 } 80 or waitfor( f1 ,a ) {80 or waitfor( f1 : a ) { 81 81 14; 82 82 } … … 86 86 87 87 //--------------------------------------- 88 when( 10 < 3 ) waitfor( f1 ,a ) {88 when( 10 < 3 ) waitfor( f1 : a ) { 89 89 16; 90 90 } 91 or waitfor( f2 ,a, a ) {91 or waitfor( f2 : a, a ) { 92 92 17; 93 93 } … … 100 100 } 101 101 102 int main() { 103 104 } 102 int main() {} -
tests/concurrent/waitfor/parse2.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Aug 30 17:53:29 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 22 13:42:11 201913 // Update Count : 312 // Last Modified On : Thu Jan 16 23:13:37 2020 13 // Update Count : 6 14 14 // 15 15 … … 26 26 } 27 27 28 waitfor( x ,z ) {28 waitfor( x : z ) { 29 29 } 30 30 … … 37 37 or waitfor( y ); 38 38 39 waitfor( x ,z );39 waitfor( x : z ); 40 40 or waitfor( y ); 41 41 … … 43 43 or when( true ) waitfor( y ); 44 44 45 when( true ) waitfor( x ,z );45 when( true ) waitfor( x : z ); 46 46 or when( true ) waitfor( y ); 47 47 … … 50 50 } 51 51 52 waitfor( x ,z ) {52 waitfor( x : z ) { 53 53 } or waitfor( y ) { 54 54 } … … 80 80 or else; 81 81 82 when( true ) waitfor( x ,z );82 when( true ) waitfor( x : z ); 83 83 or else; 84 84 … … 99 99 } 100 100 101 when( true ) waitfor( x ,z );101 when( true ) waitfor( x : z ); 102 102 or else { 103 103 } … … 115 115 or when( true ) else; 116 116 117 when( true ) waitfor( x ,z );117 when( true ) waitfor( x : z ); 118 118 or when( true ) else; 119 119 … … 134 134 } 135 135 136 when( true ) waitfor( x ,z );136 when( true ) waitfor( x : z ); 137 137 or when( true ) else { 138 138 } … … 149 149 or timeout( 3 ); 150 150 151 waitfor( x ,z );151 waitfor( x : z ); 152 152 or timeout( 3 ); 153 153 … … 163 163 } 164 164 165 when( true ) waitfor( x ,z ) {165 when( true ) waitfor( x : z ) { 166 166 } or timeout( 3 ) { 167 167 } … … 171 171 } 172 172 173 when( true ) waitfor( x ,z ) {173 when( true ) waitfor( x : z ) { 174 174 } or when ( true ) timeout( 3 ) { 175 175 } … … 229 229 230 230 int or, timeout; 231 waitfor( timeout ,7 ) 3;232 waitfor( timeout , 7 ) 3; or waitfor( timeout,7 ) 3;233 when( or ) waitfor( or ,) { 4; } or timeout( 1 ) 3;234 when( 3 ) waitfor( or ,2 ) 4; or else 4;235 when( 3 ) waitfor( or ,3 ) 4; or when( or ) timeout( or ) 4; or when( or ) else timeout;236 when( 3 ) waitfor( or , or ) 3; or when( or ) waitfor( or,timeout ) 4; or else 4;237 when( 3 ) waitfor( or , or ) 3; or waitfor( or,9 ) 4; or when( or ) timeout( timeout ) 4;238 when( 3 ) waitfor( or , 3 ) 3; or waitfor( or,7 ) or; or timeout( 1 ) or; or when( 3 ) else or;231 waitfor( timeout : 7 ) 3; 232 waitfor( timeout : 7 ) 3; or waitfor( timeout : 7 ) 3; 233 when( or ) waitfor( or : ) { 4; } or timeout( 1 ) 3; 234 when( 3 ) waitfor( or : 2 ) 4; or else 4; 235 when( 3 ) waitfor( or : 3 ) 4; or when( or ) timeout( or ) 4; or when( or ) else timeout; 236 when( 3 ) waitfor( or : or ) 3; or when( or ) waitfor( or : timeout ) 4; or else 4; 237 when( 3 ) waitfor( or : or ) 3; or waitfor( or : 9 ) 4; or when( or ) timeout( timeout ) 4; 238 when( 3 ) waitfor( or : 3 ) 3; or waitfor( or : 7 ) or; or timeout( 1 ) or; or when( 3 ) else or; 239 239 240 240 // test else selection -
tests/concurrent/waitfor/recurse.cfa
rdca5802 rb7d6a36 66 66 67 67 rand_yield(); 68 waitfor( call4 ,this );68 waitfor( call4 : this ); 69 69 rand_yield(); 70 70 … … 78 78 79 79 rand_yield(); 80 waitfor( call3 ,this );80 waitfor( call3 : this ); 81 81 rand_yield(); 82 82 … … 92 92 93 93 rand_yield(); 94 waitfor( call2 ,this );94 waitfor( call2 : this ); 95 95 rand_yield(); 96 96 -
tests/concurrent/waitfor/statment.cfa
rdca5802 rb7d6a36 101 101 102 102 while( !done ) { 103 waitfor( get_index ,this );104 or waitfor( call1 ,this ) { sout | "Statement"; if( this.last_val != 1 ) { serr | "Incorrect index: expected" | 1 | "got" | this.last_val; } }105 or waitfor( call2 ,this ) { sout | "Statement"; if( this.last_val != 2 ) { serr | "Incorrect index: expected" | 2 | "got" | this.last_val; } }106 or waitfor( call3 ,this ) { sout | "Statement"; if( this.last_val != 3 ) { serr | "Incorrect index: expected" | 3 | "got" | this.last_val; } }107 or waitfor( call4 ,this ) { sout | "Statement"; if( this.last_val != 4 ) { serr | "Incorrect index: expected" | 4 | "got" | this.last_val; } }108 or waitfor( call5 ,this ) { sout | "Statement"; if( this.last_val != 5 ) { serr | "Incorrect index: expected" | 5 | "got" | this.last_val; } }109 or waitfor( call6 ,this ) { sout | "Statement"; if( this.last_val != 6 ) { serr | "Incorrect index: expected" | 6 | "got" | this.last_val; } }110 or waitfor( call7 ,this ) { sout | "Statement"; if( this.last_val != 7 ) { serr | "Incorrect index: expected" | 7 | "got" | this.last_val; } }103 waitfor( get_index : this ); 104 or waitfor( call1 : this ) { sout | "Statement"; if( this.last_val != 1 ) { serr | "Incorrect index: expected" | 1 | "got" | this.last_val; } } 105 or waitfor( call2 : this ) { sout | "Statement"; if( this.last_val != 2 ) { serr | "Incorrect index: expected" | 2 | "got" | this.last_val; } } 106 or waitfor( call3 : this ) { sout | "Statement"; if( this.last_val != 3 ) { serr | "Incorrect index: expected" | 3 | "got" | this.last_val; } } 107 or waitfor( call4 : this ) { sout | "Statement"; if( this.last_val != 4 ) { serr | "Incorrect index: expected" | 4 | "got" | this.last_val; } } 108 or waitfor( call5 : this ) { sout | "Statement"; if( this.last_val != 5 ) { serr | "Incorrect index: expected" | 5 | "got" | this.last_val; } } 109 or waitfor( call6 : this ) { sout | "Statement"; if( this.last_val != 6 ) { serr | "Incorrect index: expected" | 6 | "got" | this.last_val; } } 110 or waitfor( call7 : this ) { sout | "Statement"; if( this.last_val != 7 ) { serr | "Incorrect index: expected" | 7 | "got" | this.last_val; } } 111 111 112 112 done = true; -
tests/concurrent/waitfor/when.cfa
rdca5802 rb7d6a36 62 62 63 63 for( int i = 0; i < N; i++ ) { 64 when( this.last_call == 6 ) waitfor( call1 ,this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } }65 or when( this.last_call == 1 ) waitfor( call2 ,this ) { if( this.last_call != 2) { serr | "Expected last_call to be 2 got" | this.last_call; } }66 or when( this.last_call == 2 ) waitfor( call3 ,this ) { if( this.last_call != 3) { serr | "Expected last_call to be 3 got" | this.last_call; } }67 or when( this.last_call == 3 ) waitfor( call4 ,this ) { if( this.last_call != 4) { serr | "Expected last_call to be 4 got" | this.last_call; } }68 or when( this.last_call == 4 ) waitfor( call5 ,this ) { if( this.last_call != 5) { serr | "Expected last_call to be 5 got" | this.last_call; } }69 or when( this.last_call == 5 ) waitfor( call6 ,this ) { if( this.last_call != 6) { serr | "Expected last_call to be 6 got" | this.last_call; } }64 when( this.last_call == 6 ) waitfor( call1 : this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } } 65 or when( this.last_call == 1 ) waitfor( call2 : this ) { if( this.last_call != 2) { serr | "Expected last_call to be 2 got" | this.last_call; } } 66 or when( this.last_call == 2 ) waitfor( call3 : this ) { if( this.last_call != 3) { serr | "Expected last_call to be 3 got" | this.last_call; } } 67 or when( this.last_call == 3 ) waitfor( call4 : this ) { if( this.last_call != 4) { serr | "Expected last_call to be 4 got" | this.last_call; } } 68 or when( this.last_call == 4 ) waitfor( call5 : this ) { if( this.last_call != 5) { serr | "Expected last_call to be 5 got" | this.last_call; } } 69 or when( this.last_call == 5 ) waitfor( call6 : this ) { if( this.last_call != 6) { serr | "Expected last_call to be 6 got" | this.last_call; } } 70 70 71 71 sout | this.last_call; -
tests/errors/.expect/completeType.txt
rdca5802 rb7d6a36 1 completeTypeError.cfa:34:1 error: Cannot choose between 2 alternatives for expression1 errors/completeType.cfa:34:1 error: Cannot choose between 2 alternatives for expression 2 2 Generated Cast of: 3 3 Applying untyped: … … 10 10 Application of 11 11 Variable Expression: *?: forall 12 DT: objecttype12 DT: data type 13 13 function 14 14 ... with parameters … … 33 33 Application of 34 34 Variable Expression: *?: forall 35 DT: objecttype35 DT: data type 36 36 function 37 37 ... with parameters … … 54 54 55 55 56 completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:56 errors/completeType.cfa:35:1 error: No reasonable alternatives for expression Applying untyped: 57 57 Name: foo 58 58 ...to: 59 59 Name: v 60 60 61 completeTypeError.cfa:36:1 error: No reasonable alternatives for expression Applying untyped:61 errors/completeType.cfa:36:1 error: No reasonable alternatives for expression Applying untyped: 62 62 Name: baz 63 63 ...to: 64 64 Name: v 65 65 66 completeTypeError.cfa:37:1 error: No reasonable alternatives for expression Applying untyped:66 errors/completeType.cfa:37:1 error: No reasonable alternatives for expression Applying untyped: 67 67 Name: quux 68 68 ...to: 69 69 Name: v 70 70 71 completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:71 errors/completeType.cfa:59:1 error: No reasonable alternatives for expression Applying untyped: 72 72 Name: baz 73 73 ...to: 74 74 Name: y 75 75 76 completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:76 errors/completeType.cfa:60:1 error: No reasonable alternatives for expression Applying untyped: 77 77 Name: quux 78 78 ...to: 79 79 Name: y 80 80 81 completeTypeError.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped:81 errors/completeType.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped: 82 82 Name: baz 83 83 ...to: … … 87 87 Cost ( 0, 1, 0, 0, 1, -5, 0 ): Application of 88 88 Variable Expression: baz: forall 89 T: sized objecttype89 T: sized data type 90 90 ... with assertions 91 91 ?=?: pointer to function -
tests/exceptions/except-0.cfa
rdca5802 rb7d6a36 19 19 }; 20 20 21 void ?{}(signal_exit *this, const char * area) {22 this ->area = area;23 } 24 25 void ^?{}(signal_exit *this) {26 printf("Exiting: %s\n", this ->area);21 void ?{}(signal_exit & this, const char * area) { 22 this.area = area; 23 } 24 25 void ^?{}(signal_exit & this) { 26 printf("Exiting: %s\n", this.area); 27 27 // sout | "Exiting:" | this->area; 28 28 } … … 242 242 243 243 // Uncaught termination test. 244 /* Removed due to non-deterministic output. 244 245 printf("Throw uncaught.\n"); 245 246 yang z; 246 247 terminate(&z); 247 } 248 */ 249 } -
tests/exceptions/except-2.cfa
rdca5802 rb7d6a36 12 12 struct TABLE(BASE_EXCEPT) const * parent; 13 13 size_t size; 14 void (*copy)(num_error *this, num_error *other);15 void (*free)(num_error *this);14 void (*copy)(num_error &this, num_error & other); 15 void (*free)(num_error &this); 16 16 const char * (*msg)(num_error *this); 17 17 int (*code)(num_error *this); … … 28 28 if ( ! this->msg ) { 29 29 static const char * base = "Num Error with code: X"; 30 this->msg = malloc(22);30 this->msg = (char *)malloc(22); 31 31 for (int i = 0 ; (this->msg[i] = base[i]) ; ++i); 32 32 } … … 34 34 return this->msg; 35 35 } 36 void ?{}(num_error *this, int num) {37 this ->virtual_table = &INSTANCE(num_error);38 this ->msg = 0;39 this ->num = num;36 void ?{}(num_error & this, int num) { 37 this.virtual_table = &INSTANCE(num_error); 38 this.msg = 0; 39 this.num = num; 40 40 } 41 void ?{}(num_error * this, num_error *other) {42 this ->virtual_table = other->virtual_table;43 this ->msg = 0;44 this ->num = other->num;41 void ?{}(num_error & this, num_error & other) { 42 this.virtual_table = other.virtual_table; 43 this.msg = 0; 44 this.num = other.num; 45 45 } 46 void ^?{}(num_error *this) {47 if( this ->msg ) free( this->msg );46 void ^?{}(num_error & this) { 47 if( this.msg ) free( this.msg ); 48 48 } 49 49 int num_error_code( num_error * this ) { -
tests/expression.cfa
rdca5802 rb7d6a36 1 struct S { int i; }; 2 void ?{}( S & s, int i ) { s.i = i; } 3 int ?`mary( int ); 4 int ?`mary( S ); 5 [int] ?`mary( [int, int] ); 6 int & ?`jane( int & ); 7 int jack( int ); 8 1 9 int main() { 2 struct s { int i; } x, *p = &x; 3 int i = 3; 10 int a[3] = { 0, 0, 0 }; 11 S s = { 3 }, * ps = &s; 12 [int] t = { 3 }; 13 * [int] pt = &t; 14 int i = 1, j = 2; 4 15 5 16 // operators 6 17 7 ! 18 !i; 8 19 ~i; 9 20 +i; 10 21 -i; 11 *p ;12 ++p ;13 --p ;14 p ++;15 p --;22 *ps; 23 ++ps; 24 --ps; 25 ps++; 26 ps--; 16 27 17 i +i;18 i -i;19 i *i;28 i + j; 29 i - j; 30 i * j; 20 31 21 i /i;22 i %i;23 i ^i;24 i &i;25 i |i;26 i <i;27 i >i;28 i =i;32 i / j; 33 i % j; 34 i ^ j; 35 i & j; 36 i | j; 37 i < j; 38 i > j; 39 i = j; 29 40 30 i==i; 31 i!=i; 32 i<<i; 33 i>>i; 34 i<=i; 35 i>=i; 36 i&&i; 37 i||i; 38 p->i; 39 i*=i; 40 i/=i; 41 i%=i; 42 i+=i; 43 i-=i; 44 i&=i; 45 i|=i; 46 i^=i; 47 i<<=i; 48 i>>=i; 41 i == j; 42 i != j; 43 i << j; 44 i >> j; 45 i <= j; 46 i >= j; 47 i && j; 48 i || j; 49 ps->i; 49 50 50 i?i:i; 51 i *= j; 52 i /= j; 53 i %= j; 54 i += j; 55 i -= j; 56 i &= j; 57 i |= j; 58 i ^= j; 59 i <<= j; 60 i >>= j; 61 62 i ? i : j; 63 64 // postfix function call 65 66 (3 + 4)`mary; 67 ({3 + 4;})`mary; 68 [3, 4]`mary; 69 3`mary; 70 a[0]`mary; 71 a[0]`mary`mary; 72 s{0}`mary; 73 a[3]`jane++; 74 jack(3)`mary; 75 s.i`mary; 76 t.0`mary; 77 s.[i]`mary; 78 ps->i`mary; 79 pt->0`mary; 80 ps->[i]`mary; 81 i++`mary; 82 i--`mary; 83 (S){2}`mary; 84 (S)@{2}`mary; 51 85 } // main -
tests/labelledExit.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Aug 10 07:29:39 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Oct 25 17:41:51 201913 // Update Count : 712 // Last Modified On : Wed Feb 5 16:49:48 2020 13 // Update Count : 9 14 14 // 15 15 … … 162 162 163 163 // computed goto 164 //{165 //void *array[] = { &&foo, &&bar, &&hack };166 //foo: bar: hack:167 //&&foo;168 //&&bar;169 //goto *array[i];170 //}164 { 165 void *array[] = { &&foo, &&bar, &&hack }; 166 foo: bar: hack: 167 &&foo; 168 &&bar; 169 goto *array[i]; 170 } 171 171 172 172 Q: if ( i > 5 ) { -
tests/loopctrl.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 12 12:05:05201913 // Update Count : 10 612 // Last Modified On : Thu Dec 12 17:55:26 2019 13 // Update Count : 108 14 14 // 15 15 … … 43 43 for ( 1 ) { sout | "A"; } sout | nl; 44 44 for ( 10 ) { sout | "A"; } sout | nl; 45 for ( = 10 ) { sout | "A"; } sout | nl; 45 46 for ( 1 ~= 10 ~ 2 ) { sout | "B"; } sout | nl; 46 47 for ( 10 -~= 1 ~ 2 ) { sout | "C"; } sout | nl; … … 49 50 50 51 for ( i; 10 ) { sout | i; } sout | nl; 52 for ( i; = 10 ) { sout | i; } sout | nl; 51 53 for ( i; 1 ~= 10 ~ 2 ) { sout | i; } sout | nl; 52 54 for ( i; 10 -~= 1 ~ 2 ) { sout | i; } sout | nl; … … 87 89 for ( N ) { sout | "N"; } sout | nl; 88 90 for ( i; N ) { sout | i; } sout | nl; 91 for ( i; = N ) { sout | i; } sout | nl; 89 92 for ( i; N -~ 0 ) { sout | i; } sout | nl | nl; 90 93 -
tests/nested-types.cfa
rdca5802 rb7d6a36 10 10 // Created On : Mon Jul 9 10:20:03 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:59:40 201813 // Update Count : 212 // Last Modified On : Wed Feb 12 18:21:15 2020 13 // Update Count : 3 14 14 // 15 15 … … 50 50 // double d; 51 51 // }; 52 53 // struct S { 54 // enum C { R, G, B }; 55 // int i; 56 // struct T { 57 // int i; 58 // }; 59 // T t; 60 // }; 61 62 // S s; 63 // S.C c; 64 // S.T t; 52 65 53 66 int main() { -
tests/pybin/tools.py
rdca5802 rb7d6a36 175 175 176 176 def which(program): 177 fpath, fname = os.path.split(program) 178 if fpath: 179 if is_exe(program): 180 return program 181 else: 182 for path in os.environ["PATH"].split(os.pathsep): 183 exe_file = os.path.join(path, program) 184 if is_exe(exe_file): 185 return exe_file 186 187 return None 177 fpath, fname = os.path.split(program) 178 if fpath: 179 if is_exe(program): 180 return program 181 else: 182 for path in os.environ["PATH"].split(os.pathsep): 183 exe_file = os.path.join(path, program) 184 if is_exe(exe_file): 185 return exe_file 186 return None 188 187 189 188 @contextlib.contextmanager … … 365 364 366 365 class Timed: 367 368 369 370 371 372 373 366 def __enter__(self): 367 self.start = time.time() 368 return self 369 370 def __exit__(self, *args): 371 self.end = time.time() 372 self.duration = self.end - self.start 374 373 375 374 def timed(src, timeout): 376 375 expire = time.time() + timeout 377 376 i = iter(src) 378 while True: 379 yield i.next(max(expire - time.time(), 0)) 377 with contextlib.suppress(StopIteration): 378 while True: 379 yield i.next(max(expire - time.time(), 0)) -
tests/quotedKeyword.cfa
rdca5802 rb7d6a36 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 21:45:53 201813 // Update Count : 2 312 // Last Modified On : Fri Feb 7 19:07:07 2020 13 // Update Count : 25 14 14 // 15 15 … … 17 17 18 18 struct { 19 int ` otype`;20 int ` struct`;19 int ``otype; 20 int ``struct; 21 21 } st = { 10, 10 }; 22 22 23 typedef int ` forall`;24 ` forall`xxx = 10;23 typedef int ``forall; 24 ``forall xxx = 10; 25 25 26 int ` _Alignas`, `_Alignof`, `__alignof`, `__alignof__`, `asm`, `__asm`, `__asm__`, `_At`, `_Atomic`, `__attribute`,27 ` __attribute__`, `auto`, `_Bool`, `break`, `case`, `catch`, `catchResume`, `char`, `choose`, `_Complex`, `__complex`,28 ` __complex__`, `const`, `__const`, `__const__`, `continue`, `default`, `disable`, `do`, `double`, `dtype`, `else`,29 ` enable`, `enum`, `__extension__`, `extern`, `fallthru`, `finally`, `float`, `__float128`, `for`, `forall`, `fortran`,30 ` ftype`, `_Generic`, `goto`, `if`, `_Imaginary`, `__imag`, `__imag__`, `inline`, `__inline`, `__inline__`, `int`,31 ` __int128`, `__label__`, `long`, `lvalue`, `_Noreturn`, `__builtin_offsetof`, `otype`, `register`, `restrict`,32 ` __restrict`, `__restrict__`, `return`, `short`, `signed`, `__signed`, `__signed__`, `sizeof`, `static`,33 ` _Static_assert`, `struct`, `switch`, `_Thread_local`, `throw`, `throwResume`, `trait`, `try`, `typedef`,34 ` typeof`, `__typeof`, `__typeof__`, `union`, `unsigned`, `__builtin_va_list`, `void`, `volatile`, `__volatile`,35 ` __volatile__`, `while`;26 int ``_Alignas, ``_Alignof, ``__alignof, ``__alignof__, ``asm, ``__asm, ``__asm__, ``_At, ``_Atomic, ``__attribute, 27 ``__attribute__, ``auto, ``_Bool, ``break, ``case, ``catch, ``catchResume, ``char, ``choose, ``_Complex, ``__complex, 28 ``__complex__, ``const, ``__const, ``__const__, ``continue, ``default, ``disable, ``do, ``double, ``dtype, ``else, 29 ``enable, ``enum, ``__extension__, ``extern, ``fallthru, ``finally, ``float, ``__float128, ``for, ``forall, ``fortran, 30 ``ftype, ``_Generic, ``goto, ``if, ``_Imaginary, ``__imag, ``__imag__, ``inline, ``__inline, ``__inline__, ``int, 31 ``__int128, ``__label__, ``long, ``lvalue, ``_Noreturn, ``__builtin_offsetof, ``otype, ``register, ``restrict, 32 ``__restrict, ``__restrict__, ``return, ``short, ``signed, ``__signed, ``__signed__, ``sizeof, ``static, 33 ``_Static_assert, ``struct, ``switch, ``_Thread_local, ``throw, ``throwResume, ``trait, ``try, ``typedef, 34 ``typeof, ``__typeof, ``__typeof__, ``union, ``unsigned, ``__builtin_va_list, ``void, ``volatile, ``__volatile, 35 ``__volatile__, ``while; 36 36 37 37 int main() { 38 int ` if`= 0;39 ` catch`= 1;40 st.` otype`= 2;41 st.` struct`= 3;42 ` throw`= 4;43 sout | ` catch` + st.`otype` + st.`struct` + `throw`;38 int ``if = 0; 39 ``catch = 1; 40 st.``otype = 2; 41 st.``struct = 3; 42 ``throw = 4; 43 sout | ``catch + st.``otype + st.``struct + ``throw; 44 44 } 45 45 -
tests/rational.cfa
rdca5802 rb7d6a36 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 27 07:37:17 201913 // Update Count : 8 012 // Last Modified On : Sat Feb 8 18:46:23 2020 13 // Update Count : 86 14 14 // 15 15 … … 19 19 #include <fstream.hfa> 20 20 21 double convert( int i ) { return (double)i; } 21 typedef Rational(int) RatInt; 22 double convert( int i ) { return (double)i; } // used by narrow/widen 22 23 int convert( double d ) { return (int)d; } 23 24 24 25 int main() { 25 26 sout | "constructor"; 26 Rat ional(int) a = { 3 }, b = { 4 }, c;27 sout | a | b | c ;27 RatInt a = { 3 }, b = { 4 }, c, d = 0, e = 1; 28 sout | a | b | c | d | e; 28 29 29 a = (Rat ional(int)){ 4, 8 };30 b = (Rat ional(int)){ 5, 7 };30 a = (RatInt){ 4, 8 }; 31 b = (RatInt){ 5, 7 }; 31 32 sout | a | b; 32 a = (Rat ional(int)){ -2, -3 };33 b = (Rat ional(int)){ 3, -2 };33 a = (RatInt){ -2, -3 }; 34 b = (RatInt){ 3, -2 }; 34 35 sout | a | b; 35 a = (Rat ional(int)){ -2, 3 };36 b = (Rat ional(int)){ 3, 2 };36 a = (RatInt){ -2, 3 }; 37 b = (RatInt){ 3, 2 }; 37 38 sout | a | b; 38 39 39 40 sout | "logical"; 40 a = (Rat ional(int)){ -2 };41 b = (Rat ional(int)){ -3, 2 };41 a = (RatInt){ -2 }; 42 b = (RatInt){ -3, 2 }; 42 43 sout | a | b; 43 44 // sout | a == 1; // FIX ME … … 58 59 59 60 sout | "conversion"; 60 a = (Rat ional(int)){ 3, 4 };61 a = (RatInt){ 3, 4 }; 61 62 sout | widen( a ); 62 a = (Rat ional(int)){ 1, 7 };63 a = (RatInt){ 1, 7 }; 63 64 sout | widen( a ); 64 a = (Rat ional(int)){ 355, 113 };65 a = (RatInt){ 355, 113 }; 65 66 sout | widen( a ); 66 67 sout | narrow( 0.75, 4 ); … … 74 75 75 76 sout | "more tests"; 76 Rat ional(int)x = { 1, 2 }, y = { 2 };77 RatInt x = { 1, 2 }, y = { 2 }; 77 78 sout | x - y; 78 79 sout | x > y; … … 80 81 sout | y | denominator( y, -2 ) | y; 81 82 82 Rat ional(int)z = { 0, 5 };83 RatInt z = { 0, 5 }; 83 84 sout | z; 84 85 85 86 sout | x | numerator( x, 0 ) | x; 86 87 87 x = (Rat ional(int)){ 1, MAX } + (Rational(int)){ 1, MAX };88 x = (RatInt){ 1, MAX } + (RatInt){ 1, MAX }; 88 89 sout | x; 89 x = (Rat ional(int)){ 3, MAX } + (Rational(int)){ 2, MAX };90 x = (RatInt){ 3, MAX } + (RatInt){ 2, MAX }; 90 91 sout | x; 91 92 -
tests/test.py
rdca5802 rb7d6a36 152 152 # run everything in a temp directory to make sure core file are handled properly 153 153 with tempdir(): 154 # if the make command succe ds continue otherwise skip to diff154 # if the make command succeeds continue otherwise skip to diff 155 155 if success(make_ret): 156 156 with Timed() as run_dur: -
tests/time.cfa
rdca5802 rb7d6a36 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 29 23:05:30 201913 // Update Count : 2412 // Last Modified On : Sun Jan 5 18:27:37 2020 13 // Update Count : 34 14 14 // 15 15 … … 34 34 sout | t; 35 35 t = t + d1; 36 sout | t | t .tv;36 sout | t | t`ns; 37 37 Time t1 = (timespec){ 104_414, 10_000_000 }; 38 sout | t1 | t1 .tv;39 sout | t - t | t + d5 | t .tv;40 char buf[ 16];38 sout | t1 | t1`ns; 39 sout | t - t | t + d5 | t`ns; 40 char buf[64]; 41 41 sout | "yy/mm/dd" | [t, buf]`ymd | nonl; // shared buf => separate calls 42 42 sout | "mm/dd/yy" | mm_dd_yy( t, buf ) | nonl; … … 45 45 sout | "dd/yy/mm" | [t, buf]`dmy; 46 46 Time t2 = { 2001, 7, 4, 0, 0, 1, 0 }, t3 = (timeval){ 994_219_201 }; 47 sout | t2 | t2 .tv | nl | t3 | t3.tv;47 sout | t2 | t2`ns | nl | t3 | t3`ns; 48 48 sout | nl; 49 49 … … 62 62 sout | "Dividing that by 2 gives" | s / 2 | "seconds"; 63 63 sout | s | "seconds is" | s`h | "hours," | (s % 1`h)`m | "minutes," | (s % 1`m)`s | "seconds"; 64 65 t1 = (Time){ 2020, 1, 5, 9, 0, 0, 100000000000LL }; 66 t2 = (Time){ 1969, 13, 5, 9 }; 67 t3 = (Time){ 1970, 25, 366, 48, 120, -120, 60000000000LL }; 68 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t1 ); 69 sout | buf; 70 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t2 ); 71 sout | buf; 72 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t3 ); 73 sout | buf; 64 74 } // main 65 75 -
tests/userLiterals.cfa
rdca5802 rb7d6a36 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // user _literals.cfa --7 // userLiterals.cfa -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Sep 6 21:40:50 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 22:03:10 201813 // Update Count : 5612 // Last Modified On : Wed Feb 19 07:48:45 2020 13 // Update Count : 74 14 14 // 15 15 … … 24 24 int ?`__thingy_( int x ) { sout | "_thingy_" | x; return x; } 25 25 26 int ?`s( const char * s ) { sout | "s ecs" | s; return 0; }27 int ?`m( const char16_t * m ) { sout | "m ins" | m; return 0;}28 int ?`h( const char32_t * h ) { sout | "h ours" | h; return 0; }26 int ?`s( const char * s ) { sout | "s" | s; return 0; } 27 int ?`m( const char16_t * m ) { sout | "m" | m; return 0;} 28 int ?`h( const char32_t * h ) { sout | "h" | h; return 0; } 29 29 int ?`_A_( const wchar_t * str ) { sout | "_A_" | str; return 0; } 30 30 int ?`__thingy_( const char * str ) { sout | "_thingy_" | str; return 0; } … … 37 37 return (Weight){ l.stones + r.stones }; 38 38 } 39 ofstream & ?|?( ofstream & os, Weight w ) { return os | w.stones; } 39 ofstream & ?|?( ofstream & os, Weight w ) { return os | wd(1,1, w.stones); } 40 void ?|?( ofstream & os, Weight w ) { (ofstream)(os | w); ends( os ); } 40 41 41 42 Weight ?`st( double w ) { return (Weight){ w }; } // backquote for user literals … … 60 61 sout | w; 61 62 62 // 0`secs;63 0`s; 63 64 1`s; 64 65 23`s; … … 82 83 83 84 "abc"`s; 84 // u"abc"`m; 85 // U_"abc"`h; 86 // L"abc"`_A_; 85 // FIX ME: requires char16_t, char32_t, and wchar_t be unique types 86 // u"abc"`m; 87 // U_"abc"`h; 88 // L"abc"`_A_; 87 89 u8_"abc"`__thingy_; 88 90 } // main … … 90 92 // Local Variables: // 91 93 // tab-width: 4 // 92 // compile-command: "cfa user _literals.cfa" //94 // compile-command: "cfa userLiterals.cfa" // 93 95 // End: //
Note: See TracChangeset
for help on using the changeset viewer.