- Timestamp:
- Feb 21, 2020, 3:36:36 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c7a900a
- Parents:
- 8c50aed (diff), c744563a (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:
-
- 11 added
- 3 deleted
- 17 edited
- 15 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/alloc-ERROR.txt
r8c50aed ra505021 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
r8c50aed ra505021 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/nested-types-ERR1.txt
r8c50aed ra505021 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
r8c50aed ra505021 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
r8c50aed ra505021 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/Makefile.in
r8c50aed ra505021 374 374 am__v_GOC_0 = @echo " GOC " $@; 375 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 = 376 380 AM_V_RUST = $(am__v_RUST_@AM_V@) 377 381 am__v_RUST_ = $(am__v_RUST_@AM_DEFAULT_V@) 378 am__v_RUST_0 = @echo " RUST 382 am__v_RUST_0 = @echo " RUST " $@; 379 383 am__v_RUST_1 = 380 384 AM_V_NODEJS = $(am__v_NODEJS_@AM_V@) 381 385 am__v_NODEJS_ = $(am__v_NODEJS_@AM_DEFAULT_V@) 382 am__v_NODEJS_0 = @echo " NODEJS 386 am__v_NODEJS_0 = @echo " NODEJS " $@; 383 387 am__v_NODEJS_1 = 384 388 AM_V_JAVAC = $(am__v_JAVAC_@AM_V@) -
tests/alloc.cfa
r8c50aed ra505021 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/quickSort.cfa
r8c50aed ra505021 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/errors/.expect/completeType.txt
r8c50aed ra505021 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: … … 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: -
tests/exceptions/except-0.cfa
r8c50aed ra505021 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
r8c50aed ra505021 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/labelledExit.cfa
r8c50aed ra505021 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/nested-types.cfa
r8c50aed ra505021 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
r8c50aed ra505021 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
r8c50aed ra505021 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 1 00:02:22202013 // Update Count : 2 412 // 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
r8c50aed ra505021 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
r8c50aed ra505021 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/userLiterals.cfa
r8c50aed ra505021 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.