- Timestamp:
- Feb 4, 2020, 11:35:26 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- eef8dfb
- Parents:
- aefb247 (diff), 4f7b418 (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:
-
- 2 added
- 16 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/time.txt
raefb247 rbdfc032 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
raefb247 rbdfc032 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_RUST = $(am__v_RUST_@AM_V@) 377 am__v_RUST_ = $(am__v_RUST_@AM_DEFAULT_V@) 378 am__v_RUST_0 = @echo " RUST " $@; 379 am__v_RUST_1 = 380 AM_V_NODEJS = $(am__v_NODEJS_@AM_V@) 381 am__v_NODEJS_ = $(am__v_NODEJS_@AM_DEFAULT_V@) 382 am__v_NODEJS_0 = @echo " NODEJS " $@; 383 am__v_NODEJS_1 = 384 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@) 385 am__v_JAVAC_ = $(am__v_JAVAC_@AM_DEFAULT_V@) 386 am__v_JAVAC_0 = @echo " JAVAC " $@; 387 am__v_JAVAC_1 = 380 388 debug = yes 381 389 installed = no -
tests/concurrent/examples/boundedBufferEXT.cfa
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 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/waitfor/barge.cfa
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 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
raefb247 rbdfc032 58 58 void arbiter( global_t & mutex this ) { 59 59 for( int i = 0; i < N; i++ ) { 60 when( this.last_call == 6 ) waitfor( call1 ,this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } }61 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; } }62 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; } }63 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; } }64 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; } }65 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; } }60 when( this.last_call == 6 ) waitfor( call1 : this ) { if( this.last_call != 1) { serr | "Expected last_call to be 1 got" | this.last_call; } } 61 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; } } 62 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; } } 63 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; } } 64 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; } } 65 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; } } 66 66 67 67 sout | this.last_call; -
tests/expression.cfa
raefb247 rbdfc032 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/quotedKeyword.cfa
raefb247 rbdfc032 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 : Sat Feb 1 00:02:22 2020 13 // Update Count : 24 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/time.cfa
raefb247 rbdfc032 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
Note:
See TracChangeset
for help on using the changeset viewer.