- Timestamp:
- Dec 22, 2018, 11:19:24 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- bd07b15
- Parents:
- 760235a
- Location:
- tests
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/examples/quickSort.c
r760235a r5ea5b28 9 9 // Created On : Wed Dec 6 12:15:52 2017 10 10 // Last Modified By : Peter A. Buhr 11 // Last Modified On : Tue Dec 4 18:00:27 201812 // Update Count : 16 711 // Last Modified On : Sat Dec 22 08:44:27 2018 12 // Update Count : 168 13 13 // 14 14 … … 151 151 if ( counter < size - 1 && (counter + 1) % ValuesPerLine != 0 ) sortedfile | ' '; 152 152 } // for 153 sortedfile | nl ;153 sortedfile | nl | nl; 154 154 155 155 delete( values ); -
tests/coroutine/fmtLines.c
r760235a r5ea5b28 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 22:45:36201813 // Update Count : 4812 // Last Modified On : Sat Dec 22 18:27:00 2018 13 // Update Count : 57 14 14 // 15 15 … … 24 24 void main( Format & fmt ) with( fmt ) { 25 25 for () { // for as many characters 26 for ( g ; 5 ) {// groups of 5 blocks27 for ( b ; 4 ) {// blocks of 4 characters26 for ( g = 0; g < 5; g += 1 ) { // groups of 5 blocks 27 for ( b = 0; b < 4; b += 1 ) { // blocks of 4 characters 28 28 for () { // for newline characters 29 29 suspend(); 30 if ( ch != '\n' ) break;// ignore newline30 if ( ch != '\n' ) break; // ignore newline 31 31 } // for 32 32 sout | ch; // print character -
tests/fallthrough.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Mar 14 10:06:25 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 4 21:36:14201813 // Update Count : 1712 // Last Modified On : Thu Dec 20 22:02:38 2018 13 // Update Count : 20 14 14 // 15 15 … … 18 18 void test(int choice) { 19 19 choose ( choice ) { 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 20 case 1: 21 sout | "case 1"; 22 fallthru; 23 case 2: 24 sout | "case 2"; 25 fallthru; 26 sout | "did not fallthru"; 27 if ( 7 ) fallthru common2; 28 fallthru common1; 29 case 3: 30 sout | "case 3"; 31 fallthru default; 32 fallthru common1; 33 common1: 34 sout | "common1"; 35 35 // break 36 37 38 39 40 41 42 43 44 45 46 47 36 case 4: 37 sout | "case 4"; 38 fallthru common2; 39 case 5: 40 sout | "case 5"; 41 fallthru common2; 42 fallthru default; 43 case 6: 44 sout | "case 6"; 45 fallthru common2; 46 common2: 47 sout | "common2"; 48 48 // break 49 50 51 52 } 49 default: 50 sout | "default"; 51 fallthru; 52 } // choose 53 53 54 54 sout | nl; … … 93 93 fallthru default; 94 94 choose ( 3 ) { 95 case 2: 96 for () { 97 choose ( 2 ) { 98 case 1: 99 // ERROR: default is later, but in a different switch 100 fallthru default; 101 // ERROR: common3 is later, but not at the same level as a case clause 102 fallthru common3; 103 } 104 common3: ; 95 case 2: 96 for () { 97 choose ( 2 ) { 98 case 1: 99 // ERROR: default is later, but in a different switch 100 fallthru default; 101 // ERROR: common3 is later, but not at the same level as a case clause 102 fallthru common3; 105 103 } 106 default: 107 case 1: 108 common4: 109 // ERROR: attempt to jump up with fallthrough 110 if ( 7 ) fallthru common4; 111 // ERROR: attempt to jump up with fallthrough 112 fallthru default; 113 } 104 common3: ; 105 } // for 106 default: 107 case 1: 108 common4: 109 // ERROR: attempt to jump up with fallthrough 110 if ( 7 ) fallthru common4; 111 // ERROR: attempt to jump up with fallthrough 112 fallthru default; 113 } // choose 114 114 #endif 115 115 } -
tests/fstream_test.cfa
r760235a r5ea5b28 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:36:34 201813 // Update Count : 6 712 // Last Modified On : Sat Dec 22 09:47:44 2018 13 // Update Count : 68 14 14 // 15 15 … … 24 24 | (nombre > 0 ? "positif" : nombre == 0 ? "zéro" : "négatif"); 25 25 26 sout | "Entrez trois nombres, s'il vous plaît: 26 sout | "Entrez trois nombres, s'il vous plaît:"; 27 27 int i, j, k; 28 28 sin | i | j | k; -
tests/gmp.cfa
r760235a r5ea5b28 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 4 21:37:29201813 // Update Count : 55 812 // Last Modified On : Thu Dec 20 22:41:47 2018 13 // Update Count : 559 14 14 // 15 15 … … 76 76 sout | "x:" | x | "y:" | y; 77 77 78 sout ;78 sout | nl; 79 79 80 80 sin | x | y | z; 81 81 sout | x | y | z; 82 82 83 sout ;83 sout | nl; 84 84 85 85 sout | "Fibonacci Numbers"; … … 94 94 } // for 95 95 96 sout ;96 sout | nl; 97 97 98 98 sout | "Factorial Numbers"; -
tests/io1.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 18:23:44201813 // Update Count : 11 012 // Last Modified On : Fri Dec 21 16:02:55 2018 13 // Update Count : 114 14 14 // 15 15 … … 22 22 sout | '1' | '2' | '3'; 23 23 sout | 1 | "" | 2 | "" | 3; 24 sout ;24 sout | nl; 25 25 26 sout | "opening delimiters"; 27 sout | "x (" | 1 | nonl; 28 sout | "x [" | 2 | nonl; 29 sout | "x {" | 3 | nonl; 30 sout | "x =" | 4 | nonl; 31 sout | "x $" | 5 | nonl; 32 sout | "x £" | 6 | nonl; 33 sout | "x ¥" | 7 | nonl; 34 sout | "x ¡" | 8 | nonl; 35 sout | "x ¿" | 9 | nonl; 26 sout | nlOff; 27 sout | "opening delimiters" | nl; 28 sout | "x (" | 1; 29 sout | "x [" | 2; 30 sout | "x {" | 3; 31 sout | "x =" | 4; 32 sout | "x $" | 5; 33 sout | "x £" | 6; 34 sout | "x ¥" | 7; 35 sout | "x ¡" | 8; 36 sout | "x ¿" | 9; 36 37 sout | "x «" | 10; 38 sout | nl | nl; 37 39 38 sout | "closing delimiters" ;39 sout | 1 | ", x" | nonl;40 sout | 2 | ". x" | nonl;41 sout | 3 | "; x" | nonl;42 sout | 4 | "! x" | nonl;43 sout | 5 | "? x" | nonl;44 sout | 6 | "% x" | nonl;45 sout | 7 | "¢ x" | nonl;46 sout | 8 | "» x" | nonl;47 sout | 9 | ") x" | nonl;48 sout | 10 | "] x" | nonl;40 sout | "closing delimiters" | nl; 41 sout | 1 | ", x"; 42 sout | 2 | ". x"; 43 sout | 3 | "; x"; 44 sout | 4 | "! x"; 45 sout | 5 | "? x"; 46 sout | 6 | "% x"; 47 sout | 7 | "¢ x"; 48 sout | 8 | "» x"; 49 sout | 9 | ") x"; 50 sout | 10 | "] x"; 49 51 sout | 11 | "} x"; 52 sout | nl | nl; 50 53 51 sout | "opening/closing delimiters" ;52 sout | "x`" | 1 | "`x'" | 2 | nonl;53 sout | "'x\"" | 3 | "\"x:" | 4 | nonl;54 sout | ":x " | 5 | " x\t" | 6 | nonl;55 sout | "\tx\f" | 7 | "\fx\v" | 8 | nonl;56 sout | "\vx\n" | 9 | "\nx\r" | 10 | nonl;54 sout | "opening/closing delimiters" | nl; 55 sout | "x`" | 1 | "`x'" | 2; 56 sout | "'x\"" | 3 | "\"x:" | 4; 57 sout | ":x " | 5 | " x\t" | 6; 58 sout | "\tx\f" | 7 | "\fx\v" | 8; 59 sout | "\vx\n" | 9 | "\nx\r" | 10; 57 60 sout | "\rx"; 61 sout | nl | nl; 58 62 63 sout | nlOn; 59 64 sout | "override opening/closing delimiters"; 60 65 sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4; 61 sout ;66 sout | nl; 62 67 } 63 68 -
tests/io2.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 16:19:15201813 // Update Count : 11 012 // Last Modified On : Fri Dec 21 08:20:14 2018 13 // Update Count : 112 14 14 // 15 15 … … 96 96 sout | sepOn | 1 | 2 | 3 | sepOn; // no separator at start/end of line 97 97 sout | 1 | sepOff | 2 | 3; // locally turn off implicit separator 98 sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' ; // no separator at start/end of line99 sout | 1 | 2 | 3 | "\n\n" | sepOn ; // no separator at start of next line98 sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' | nonl; // no separator at start/end of line 99 sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl; // no separator at start of next line 100 100 sout | 1 | 2 | 3; 101 101 sout | nl; … … 133 133 // Local Variables: // 134 134 // tab-width: 4 // 135 // compile-command: "cfa io2.cfa" //135 // compile-command: "cfa -DIN_DIR=".in/" io2.cfa" // 136 136 // End: // -
tests/loopctrl.cfa
r760235a r5ea5b28 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 08:14:44201813 // Update Count : 7 612 // Last Modified On : Sat Dec 22 09:41:15 2018 13 // Update Count : 77 14 14 // 15 15 … … 38 38 while () { sout | "empty"; break; } sout | nl; 39 39 do { sout | "empty"; break; } while (); sout | nl; 40 for () { sout | "empty"; break; } sout | nl ;40 for () { sout | "empty"; break; } sout | nl | nl; 41 41 42 42 for ( 0 ) { sout | "A"; } sout | "zero" | nl; -
tests/pybin/tools.py
r760235a r5ea5b28 79 79 def diff( lhs, rhs ): 80 80 # diff the output of the files 81 diff_cmd = ("diff --ignore-all-space --text " 82 "--ignore-blank-lines " 81 diff_cmd = ("diff --text " 82 # "--ignore-all-space " 83 # "--ignore-blank-lines " 83 84 "--old-group-format='\t\tmissing lines :\n" 84 85 "%%<' \\\n" -
tests/raii/dtor-early-exit.c
r760235a r5ea5b28 10 10 // Created On : Wed Aug 17 08:26:25 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 22:05:24201813 // Update Count : 912 // Last Modified On : Fri Dec 21 08:45:19 2018 13 // Update Count : 10 14 14 // 15 15 … … 71 71 } 72 72 } 73 sout ;73 sout | nl; 74 74 for (int i = 0; i < 10; i++) { 75 75 switch(10) { -
tests/searchsort.cfa
r760235a r5ea5b28 10 10 // Created On : Thu Feb 4 18:17:50 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 5 08:18:42201813 // Update Count : 10 612 // Last Modified On : Thu Dec 20 22:49:46 2018 13 // Update Count : 108 14 14 // 15 15 … … 30 30 sout | iarr[i] | ", "; 31 31 } // for 32 sout | nl ;32 sout | nl | nl; 33 33 34 34 // ascending sort/search by changing < to > … … 54 54 sout | size - i | ':' | iarr[posn] | ", "; 55 55 } // for 56 sout | nl ;56 sout | nl | nl; 57 57 58 58 // descending sort/search by changing < to > … … 84 84 } // for 85 85 } 86 sout | nl ;86 sout | nl | nl; 87 87 88 88 double darr[size]; … … 106 106 sout | size - i + 0.5 | ':' | darr[posn] | ", "; 107 107 } // for 108 sout | nl ;108 sout | nl | nl; 109 109 110 110 struct S { int i, j; } sarr[size]; … … 133 133 sout | temp | ':' | sarr[posn] | ", "; 134 134 } // for 135 sout | nl ;135 sout | nl | nl; 136 136 { 137 137 int getKey( const S & s ) { return s.j; } … … 149 149 sout | size - i + 1 | ':' | sarr[posn] | ", "; 150 150 } // for 151 sout | nl ;151 sout | nl | nl; 152 152 } 153 153 } // main -
tests/swap.cfa
r760235a r5ea5b28 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 11 10:17:40201813 // Update Count : 7 412 // Last Modified On : Sat Dec 22 16:01:33 2018 13 // Update Count : 75 14 14 // 15 15 … … 85 85 struct S { int i, j; } s1 = { 1, 2 }, s2 = { 2, 1 }; 86 86 ofstream & ?|?( ofstream & os, S s ) { return os | s.i | s.j; } 87 void ?|?( ofstream & os, S s ) { (ofstream)(os | s.i | s.j); if ( getANL( os ) ) nl( os ); } 87 88 sout | "struct S\t\t" | s1 | "," | s2 | "\t\tswap " | nonl; 88 89 swap( s1, s2 ); -
tests/time.cfa
r760235a r5ea5b28 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 11 21:44:03201813 // Update Count : 2 212 // Last Modified On : Thu Dec 20 23:09:21 2018 13 // Update Count : 23 14 14 // 15 15 … … 30 30 sout | d1 == 7`s | d1 == d2 | d1 == 0; 31 31 sout | div( 7`s, 2`s ); 32 sout | nl; 32 33 33 34 Time t = { 1970, 1, 2, 0, 0, 0, 10_000_000 }; … … 46 47 Time t2 = { 2001, 7, 4, 0, 0, 1, 0 }, t3 = (timeval){ 994_219_201 }; 47 48 sout | t2 | t2.tv | nl | t3 | t3.tv; 49 sout | nl; 48 50 49 51 // Clock Newfoundland = { -3.5`h }, PST = { -8`h }; // distance from GMT (UTC) … … 53 55 // | "local nsec" | getTimeNsec() 54 56 // | "PST" | PST(); // getTime short form 55 // sout ;57 // sout | nl; 56 58 57 59 // http://en.cppreference.com/w/cpp/chrono/duration/operator_arith4
Note: See TracChangeset
for help on using the changeset viewer.