- Timestamp:
- May 8, 2020, 4:44:53 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:
- 5c9b20c
- Parents:
- e3bc51c (diff), 0e7e3c17 (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:
-
- 14 added
- 4 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/alloc.txt
re3bc51c rbcd74f3 35 35 CFA realloc array alloc, fill 36 36 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 37 CFA realloc array alloc, 538 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede39 CFA realloc array alloc, 540 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef41 CFA realloc array alloc, 542 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff43 37 44 38 C memalign 42 42.5 -
tests/Makefile.am
re3bc51c rbcd74f3 41 41 -quiet @CFA_FLAGS@ \ 42 42 -DIN_DIR="${abs_srcdir}/.in/" 43 44 AM_CFAFLAGS = -XCFA --deterministic-out 43 45 44 46 # get the desired cfa to test -
tests/Makefile.in
re3bc51c rbcd74f3 408 408 -DIN_DIR="${abs_srcdir}/.in/" 409 409 410 AM_CFAFLAGS = -XCFA --deterministic-out 410 411 411 412 # get the desired cfa to test -
tests/alloc.cfa
re3bc51c rbcd74f3 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 1 10:58:35202013 // Update Count : 42 412 // Last Modified On : Mon Apr 6 21:08:23 2020 13 // Update Count : 428 14 14 // 15 15 … … 151 151 ip = alloc_set( ip, 3 * dim, fill ); // CFA realloc array alloc, fill 152 152 printf( "CFA realloc array alloc, fill\n" ); 153 for ( i; 3 * dim ) { printf( "%#x ", ip[i] ); ;}154 printf( "\n" ); 155 // do not free 156 157 ip = alloc_set( ip, 3* dim, 5 ); // CFA realloc array alloc, 5153 for ( i; 3 * dim ) { printf( "%#x ", ip[i] ); } 154 printf( "\n" ); 155 // do not free 156 #if 0 // FIX ME 157 ip = alloc_set( ip, 5 * dim, 5 ); // CFA realloc array alloc, 5 158 158 printf( "CFA realloc array alloc, 5\n" ); 159 for ( i; 3* dim ) { printf( "%#x ", ip[i] ); }159 for ( i; 5 * dim ) { printf( "%#x ", ip[i] ); } 160 160 printf( "\n" ); 161 161 // do not free … … 167 167 // do not free 168 168 169 ip = alloc_set( ip, 3* dim, 5 ); // CFA realloc array alloc, 5169 ip = alloc_set( ip, 5 * dim, 5 ); // CFA realloc array alloc, 5 170 170 printf( "CFA realloc array alloc, 5\n" ); 171 for ( i; 3 * dim ) { printf( "%#x ", ip[i] );; }172 printf( "\n" ); 173 free( ip ); 174 171 for ( i; 5 * dim ) { printf( "%#x ", ip[i] ); } 172 printf( "\n" ); 173 #endif // 0 174 free( ip ); 175 175 176 176 // resize, non-array types -
tests/concurrent/.expect/monitor.txt
re3bc51c rbcd74f3 1 40000001 3000000 -
tests/concurrent/monitor.cfa
re3bc51c rbcd74f3 29 29 30 30 void main( MyThread & this ) { 31 for(int i = 0; i < 1_000_000; i++) {31 for(int i = 0; i < 750_000; i++) { 32 32 increment( global ); 33 33 } -
tests/errors/.expect/completeType.txt
re3bc51c rbcd74f3 27 27 void 28 28 ) 29 Environment: ( _85_4_DT )-> instance of struct A with body 0 (no widening)29 Environment: -> instance of struct A with body 0 (no widening) 30 30 31 31 … … 50 50 void 51 51 ) 52 Environment: ( _85_4_DT )-> instance of struct B with body 1 (no widening)52 Environment: -> instance of struct B with body 1 (no widening) 53 53 54 54 … … 127 127 void 128 128 ) 129 Environment: ( _104_0_T )-> instance of type T (not function type) (no widening)129 Environment: -> instance of type T (not function type) (no widening) 130 130 131 131 Could not satisfy assertion: -
tests/exceptions/.expect/interact.txt
re3bc51c rbcd74f3 14 14 resumption catch, will terminate 15 15 inner termination catch 16 17 throwing resume moon 18 resumption moon catch, will terminate 19 termination catch 20 throwing resume star 21 resumption star catch -
tests/exceptions/.expect/resume.txt
re3bc51c rbcd74f3 25 25 caught second exception 26 26 recaught first exception 27 28 inner catch 29 inner catch 30 outer catch -
tests/exceptions/.expect/terminate.txt
re3bc51c rbcd74f3 24 24 caught second exception 25 25 recaught first exception 26 27 inner catch 28 outer catch -
tests/exceptions/conditional.cfa
re3bc51c rbcd74f3 4 4 // up the non-trivial exception is reasonable to do. 5 5 6 #include "except-mac.hfa"6 #include <exception.hfa> 7 7 #include <stdio.h> 8 8 9 DECLARE_EXCEPT(num_error, BASE_EXCEPT, 9 VTABLE_DECLARATION(num_error)( 10 10 int (*code)(num_error *this); 11 11 ); … … 36 36 this.num = other.num; 37 37 } 38 void copy(num_error * this, num_error * other) {39 *this = *other;40 }41 38 void ^?{}(num_error & this) { 42 39 if( this.msg ) free( this.msg ); … … 46 43 } 47 44 48 VTABLE_INSTANCE(num_error, BASE_EXCEPT, copy, ^?{}, 49 num_error_msg, num_error_code 45 VTABLE_INSTANCE(num_error)( 46 num_error_msg, 47 num_error_code, 50 48 ); 51 49 … … 58 56 59 57 try { 60 THROW(&exc);58 throw &exc; 61 59 } catch (num_error * error ; 3 == error->virtual_table->code( error )) { 62 60 caught_num_error(3, error); … … 66 64 67 65 try { 68 THROW_RESUME(&exc);66 throwResume &exc; 69 67 } catchResume (num_error * error ; 3 == error->virtual_table->code( error )) { 70 68 caught_num_error(3, error); -
tests/exceptions/finally.cfa
re3bc51c rbcd74f3 1 1 // Finally Clause Tests 2 2 3 #include "except-mac.hfa"3 #include <exception.hfa> 4 4 #include "except-io.hfa" 5 5 … … 12 12 try { 13 13 printf("termination throw\n"); 14 THROW(&exc);14 throw &exc; 15 15 } finally { 16 16 loud_exit a = "termination inner finally"; … … 28 28 try { 29 29 printf("resumption throw\n"); 30 THROW_RESUME(&exc);30 throwResume &exc; 31 31 } finally { 32 32 loud_exit a = "resumption inner finally"; -
tests/exceptions/interact.cfa
re3bc51c rbcd74f3 1 1 // Testing Interactions Between Termination and Resumption 2 2 3 #include "except-mac.hfa"3 #include <exception.hfa> 4 4 #include "except-io.hfa" 5 5 … … 10 10 // Resume falls back to terminate. 11 11 try { 12 THROW_RESUME(&(star){});12 throwResume &(star){}; 13 13 } catch (star *) { 14 14 printf("caught as termination\n"); … … 17 17 try { 18 18 loud_region a = "try block with resume throw"; 19 THROW_RESUME(&(star){});19 throwResume &(star){}; 20 20 } catch (star *) { 21 21 printf("caught as termination\n"); … … 29 29 try { 30 30 try { 31 THROW(&(star){});31 throw &(star){}; 32 32 } catchResume (star *) { 33 33 printf("resume catch on terminate\n"); … … 43 43 try { 44 44 try { 45 THROW_RESUME(&(star){});45 throwResume &(star){}; 46 46 } catch (star *) { 47 47 printf("terminate catch on resume\n"); … … 58 58 try { 59 59 try { 60 THROW(&(star){});60 throw &(star){}; 61 61 } catchResume (star *) { 62 62 printf("inner resume catch (error)\n"); … … 64 64 } catch (star * error) { 65 65 printf("termination catch, will resume\n"); 66 THROW_RESUME(error);66 throwResume error; 67 67 } 68 68 } catchResume (star *) { … … 75 75 try { 76 76 try { 77 THROW_RESUME(&(star){});77 throwResume &(star){}; 78 78 } catch (star *) { 79 79 printf("inner termination catch\n"); … … 81 81 } catchResume (star * error) { 82 82 printf("resumption catch, will terminate\n"); 83 THROW(error);83 throw error; 84 84 } 85 85 } catch (star *) { 86 86 printf("outer terminate catch (error)\n"); 87 87 } 88 #if 089 88 printf("\n"); 90 89 … … 95 94 try { 96 95 printf("throwing resume moon\n"); 97 THROW_RESUME(&(moon){});96 throwResume &(moon){}; 98 97 } catch (star *) { 99 98 printf("termination catch\n"); 100 99 } 101 100 printf("throwing resume star\n"); 102 THROW_RESUME(&(star){});101 throwResume &(star){}; 103 102 } catchResume (star *) { 104 103 printf("resumption star catch\n"); … … 106 105 } catchResume (moon *) { 107 106 printf("resumption moon catch, will terminate\n"); 108 THROW(&(star){});107 throw &(star){}; 109 108 } 110 109 } catchResume (star *) { 111 110 printf("outermost catch (error)\n"); 112 111 } 113 #endif114 112 } -
tests/exceptions/resume.cfa
re3bc51c rbcd74f3 1 1 // Resumption Exception Tests 2 2 3 #include "except-mac.hfa"3 #include <exception.hfa> 4 4 #include "except-io.hfa" 5 5 … … 14 14 loud_exit a = "simple try clause"; 15 15 printf("simple throw\n"); 16 THROW_RESUME(&(zen){});16 throwResume &(zen){}; 17 17 printf("end of try clause\n"); 18 18 } catchResume (zen * error) { … … 25 25 try { 26 26 printf("throwing child exception\n"); 27 THROW_RESUME(&(moment_of){});27 throwResume &(moment_of){}; 28 28 } catchResume (zen *) { 29 29 printf("inner parent match\n"); … … 36 36 try { 37 37 try { 38 THROW_RESUME(&(yin){});38 throwResume &(yin){}; 39 39 } catchResume (zen *) { 40 40 printf("caught yin as zen\n"); … … 52 52 loud_exit a = "rethrow inner try"; 53 53 printf("rethrow inner try\n"); 54 THROW_RESUME(&(zen){});54 throwResume &(zen){}; 55 55 } catchResume (zen *) { 56 56 loud_exit a = "rethrowing catch clause"; … … 67 67 try { 68 68 try { 69 THROW_RESUME(&(yin){});69 throwResume &(yin){}; 70 70 } catchResume (yin *) { 71 71 printf("caught yin, will throw yang\n"); 72 THROW_RESUME(&(yang){});72 throwResume &(yang){}; 73 73 } catchResume (yang *) { 74 74 printf("caught exception from same try\n"); … … 83 83 try { 84 84 printf("throwing first exception\n"); 85 THROW_RESUME(&(yin){});85 throwResume &(yin){}; 86 86 } catchResume (yin *) { 87 87 printf("caught first exception\n"); 88 88 try { 89 89 printf("throwing second exception\n"); 90 THROW_RESUME(&(yang){});90 throwResume &(yang){}; 91 91 } catchResume (yang *) { 92 92 printf("caught second exception\n"); … … 99 99 printf("caught second exception (bad location)\n"); 100 100 } 101 printf("\n"); 102 103 // Check successive operations. 104 try { 105 try { 106 throwResume &(zen){}; 107 throwResume &(zen){}; 108 } catchResume (zen *) { 109 printf("inner catch\n"); 110 } 111 throwResume &(zen){}; 112 } catchResume (zen *) { 113 printf("outer catch\n"); 114 } 101 115 } -
tests/exceptions/terminate.cfa
re3bc51c rbcd74f3 1 1 // Termination Exception Tests 2 2 3 #include "except-mac.hfa"3 #include <exception.hfa> 4 4 #include "except-io.hfa" 5 5 … … 14 14 loud_exit a = "simple try clause"; 15 15 printf("simple throw\n"); 16 THROW(&(zen){});16 throw &(zen){}; 17 17 printf("end of try clause\n"); 18 18 } catch (zen * error) { … … 25 25 try { 26 26 printf("throwing child exception\n"); 27 THROW(&(moment_of){});27 throw &(moment_of){}; 28 28 } catch (zen *) { 29 29 printf("inner parent match\n"); … … 36 36 try { 37 37 try { 38 THROW(&(yin){});38 throw &(yin){}; 39 39 } catch (zen *) { 40 40 printf("caught yin as zen\n"); … … 52 52 loud_exit a = "rethrow inner try"; 53 53 printf("rethrow inner try\n"); 54 THROW(&(zen){});54 throw &(zen){}; 55 55 } catch (zen *) { 56 56 loud_exit a = "rethrowing catch clause"; … … 67 67 try { 68 68 try { 69 THROW(&(yin){});69 throw &(yin){}; 70 70 } catch (yin *) { 71 71 printf("caught yin, will throw yang\n"); 72 THROW(&(yang){});72 throw &(yang){}; 73 73 } catch (yang *) { 74 74 printf("caught exception from same try\n"); … … 83 83 try { 84 84 printf("throwing first exception\n"); 85 THROW(&(yin){});85 throw &(yin){}; 86 86 } catch (yin *) { 87 87 printf("caught first exception\n"); 88 88 try { 89 89 printf("throwing second exception\n"); 90 THROW(&(yang){});90 throw &(yang){}; 91 91 } catch (yang *) { 92 92 printf("caught second exception\n"); … … 99 99 printf("caught second exception (bad location)\n"); 100 100 } 101 printf("\n"); 102 103 // Check successive operations. 104 try { 105 try { 106 throw &(zen){}; 107 throw &(zen){}; 108 } catch (zen *) { 109 printf("inner catch\n"); 110 } 111 throw &(zen){}; 112 } catch (zen *) { 113 printf("outer catch\n"); 114 } 101 115 } -
tests/manipulatorsOutput1.cfa
re3bc51c rbcd74f3 7 7 // Created On : Sat Jun 8 18:04:11 2019 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Mon Jun 10 12:37:28 201910 // Update Count : 89 // Last Modified On : Fri May 1 11:51:44 2020 10 // Update Count : 9 11 11 // 12 12 … … 17 17 signed char sc = -12; 18 18 printf( "%hhd %2hhd %5.2hhd %-5.2hhd %hho %#hho %hhx %#hhx %#8hhx %#8.10hhx %#8.3hhX %+-8.3hhd %08hhd\n", sc, sc, sc, sc, sc, sc, sc, sc, sc, sc, sc, sc, sc ); 19 sout | sc | wd(2,sc) | wd(5,2,sc) | left(wd(5,2,sc)) | nobase(oct(sc)) | oct(sc) | nobase(hex(sc)) | hex(sc) | wd(8,hex(sc)) | wd(8,10,hex(sc)) | upcase(wd(8,3,hex(sc))) | left(sign(upcase(wd(8,3,sc)))) | pad0(wd(8,sc)); 19 sout | sc | wd(2,sc) | wd(5,2,sc) | left(wd(5,2,sc)) | nobase(oct(sc)) | oct(sc) | nonl; 20 sout | nobase(hex(sc)) | hex(sc) | wd(8,hex(sc)) | wd(8,10,hex(sc)) | upcase(wd(8,3,hex(sc))) | nonl; 21 sout | left(sign(upcase(wd(8,3,sc)))) | pad0(wd(8,sc)); 20 22 21 23 sout | "unsigned char"; 22 24 unsigned char usc = 12; 23 25 printf( "%hhu %2hhu %5.2hhu %-5.2hhu %hho %#hho %hhx %#hhx %#8hhx %#8.10hhx %#8.3hhX %-8.3hhu %08hhu\n", usc, usc, usc, usc, usc, usc, usc, usc, usc, usc, usc, usc, usc ); 24 sout | usc | wd(2,usc) | wd(5,2,usc) | left(wd(5,2,usc)) | nobase(oct(usc)) | oct(usc) | nobase(hex(usc)) | hex(usc) | wd(8,hex(usc)) | wd(8,10,hex(usc)) | upcase(wd(8,3,hex(usc))) | left(upcase(wd(8,3,usc))) | pad0(wd(8,usc)); 26 sout | usc | wd(2,usc) | wd(5,2,usc) | left(wd(5,2,usc)) | nobase(oct(usc)) | oct(usc) | nonl; 27 sout | nobase(hex(usc)) | hex(usc) | wd(8,hex(usc)) | wd(8,10,hex(usc)) | upcase(wd(8,3,hex(usc))) | nonl; 28 sout | left(upcase(wd(8,3,usc))) | pad0(wd(8,usc)); 25 29 26 30 sout | "signed short int"; 27 31 signed short int si = -12; 28 32 printf( "%hd %2hd %5.2hd %-5.2hd %ho %#ho %hx %#hx %#8hx %#8.10hx %#8.3hX %+-8.3hd %08hd\n", si, si, si, si, si, si, si, si, si, si, si, si, si ); 29 sout | si | wd(2,si) | wd(5,2,si) | left(wd(5,2,si)) | nobase(oct(si)) | oct(si) | nobase(hex(si)) | hex(si) | wd(8,hex(si)) | wd(8,10,hex(si)) | upcase(wd(8,3,hex(si))) | left(sign(upcase(wd(8,3,si)))) | pad0(wd(8,si)); 33 sout | si | wd(2,si) | wd(5,2,si) | left(wd(5,2,si)) | nobase(oct(si)) | oct(si) | nonl; 34 sout | nobase(hex(si)) | hex(si) | wd(8,hex(si)) | wd(8,10,hex(si)) | upcase(wd(8,3,hex(si))) | nonl; 35 sout | left(sign(upcase(wd(8,3,si)))) | pad0(wd(8,si)); 30 36 31 37 sout | "unsigned short int"; 32 38 unsigned short int usi = 12; 33 39 printf( "%hu %2hu %5.2hu %-5.2hu %ho %#ho %hx %#hx %#8hx %#8.10hx %#8.3hX %-8.3hu %08hu\n", usi, usi, usi, usi, usi, usi, usi, usi, usi, usi, usi, usi, usi ); 34 sout | usi | wd(2,usi) | wd(5,2,usi) | left(wd(5,2,usi)) | nobase(oct(usi)) | oct(usi) | nobase(hex(usi)) | hex(usi) | wd(8,hex(usi)) | wd(8,10,hex(usi)) | upcase(wd(8,3,hex(usi))) | left(upcase(wd(8,3,usi))) | pad0(wd(8,usi)); 40 sout | usi | wd(2,usi) | wd(5,2,usi) | left(wd(5,2,usi)) | nobase(oct(usi)) | oct(usi) | nonl; 41 sout | nobase(hex(usi)) | hex(usi) | wd(8,hex(usi)) | wd(8,10,hex(usi)) | upcase(wd(8,3,hex(usi))) | nonl; 42 sout | left(upcase(wd(8,3,usi))) | pad0(wd(8,usi)); 35 43 36 44 sout | "signed int"; 37 45 signed int i = -12; 38 46 printf( "%d %2d %5.2d %-5.2d %o %#o %x %#x %#8x %#8.10x %#8.3X %+-8.3d %08d\n", i, i, i, i, i, i, i, i, i, i, i, i, i ); 39 sout | i | wd(2,i) | wd(5,2,i) | left(wd(5,2,i)) | nobase(oct(i)) | oct(i) | nobase(hex(i)) | hex(i) | wd(8,hex(i)) | wd(8,10,hex(i)) | upcase(wd(8,3,hex(i))) | left(sign(upcase(wd(8,3,i)))) | pad0(wd(8,i)); 47 sout | i | wd(2,i) | wd(5,2,i) | left(wd(5,2,i)) | nobase(oct(i)) | oct(i) | nonl; 48 sout | nobase(hex(i)) | hex(i) | wd(8,hex(i)) | wd(8,10,hex(i)) | upcase(wd(8,3,hex(i))) | nonl; 49 sout | left(sign(upcase(wd(8,3,i)))) | pad0(wd(8,i)); 40 50 41 51 sout | "unsigned int"; 42 52 unsigned int ui = 12; 43 53 printf( "%u %2u %5.2u %-5.2u %o %#o %x %#x %#8x %#8.10x %#8.3X %-8.3u %08u\n", ui, ui, ui, ui, ui, ui, ui, ui, ui, ui, ui, ui, ui ); 44 sout | ui | wd(2,ui) | wd(5,2,ui) | left(wd(5,2,ui)) | nobase(oct(ui)) | oct(ui) | nobase(hex(ui)) | hex(ui) | wd(8,hex(ui)) | wd(8,10,hex(ui)) | upcase(wd(8,3,hex(ui))) | left(upcase(wd(8,3,ui))) | pad0(wd(8,ui)); 54 sout | ui | wd(2,ui) | wd(5,2,ui) | left(wd(5,2,ui)) | nobase(oct(ui)) | oct(ui) | nonl; 55 sout | nobase(hex(ui)) | hex(ui) | wd(8,hex(ui)) | wd(8,10,hex(ui)) | upcase(wd(8,3,hex(ui))) | nonl; 56 sout | left(upcase(wd(8,3,ui))) | pad0(wd(8,ui)); 45 57 46 58 sout | "signed long long int"; 47 59 signed long long int lli = -12; 48 60 printf( "%lld %2lld %5.2lld %-5.2lld %llo %#llo %llx %#llx %#8llx %#8.10llx %#8.3llX %+-8.3lld %08lld\n", lli, lli, lli, lli, lli, lli, lli, lli, lli, lli, lli, lli, lli ); 49 sout | lli | wd(2,lli) | wd(5,2,lli) | left(wd(5,2,lli)) | nobase(oct(lli)) | oct(lli) | nobase(hex(lli)) | hex(lli) | wd(8,hex(lli)) | wd(8,10,hex(lli)) | upcase(wd(8,3,hex(lli))) | left(sign(upcase(wd(8,3,lli)))) | pad0(wd(8,lli)); 61 sout | lli | wd(2,lli) | wd(5,2,lli) | left(wd(5,2,lli)) | nobase(oct(lli)) | oct(lli) | nonl; 62 sout | nobase(hex(lli)) | hex(lli) | wd(8,hex(lli)) | wd(8,10,hex(lli)) | upcase(wd(8,3,hex(lli))) | nonl; 63 sout | left(sign(upcase(wd(8,3,lli)))) | pad0(wd(8,lli)); 50 64 51 65 sout | "unsigned long long int"; 52 66 unsigned long long int ulli = 12; 53 67 printf( "%llu %2llu %5.2llu %-5.2llu %llo %#llo %llx %#llx %#8llx %#8.10llx %#8.3llX %-8.3llu %08llu\n", ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli, ulli ); 54 sout | ulli | wd(2,ulli) | wd(5,2,ulli) | left(wd(5,2,ulli)) | nobase(oct(ulli)) | oct(ulli) | nobase(hex(ulli)) | hex(ulli) | wd(8,hex(ulli)) | wd(8,10,hex(ulli)) | upcase(wd(8,3,hex(ulli))) | left(upcase(wd(8,3,ulli))) | pad0(wd(8,ulli)); 68 sout | ulli | wd(2,ulli) | wd(5,2,ulli) | left(wd(5,2,ulli)) | nobase(oct(ulli)) | oct(ulli) | nonl; 69 sout | nobase(hex(ulli)) | hex(ulli) | wd(8,hex(ulli)) | wd(8,10,hex(ulli)) | upcase(wd(8,3,hex(ulli))) | nonl; 70 sout | left(upcase(wd(8,3,ulli))) | pad0(wd(8,ulli)); 55 71 56 72 sout | nl | "binary integral"; 57 sout | bin(0) | bin(13) | upcase(bin(13)) | nobase(bin(13)) | left(wd(8,bin(13))) | wd(8,bin(13)) | pad0(left(wd(8,bin(13)))) | pad0(wd(8,bin(13))) | pad0(wd(8,10,bin(13))) | pad0(wd(8,6,bin(13))); 73 sout | bin(0) | bin(13) | upcase(bin(13)) | nobase(bin(13)) | left(wd(8,bin(13))) | wd(8,bin(13)) | nonl; 74 sout | pad0(left(wd(8,bin(13)))) | pad0(wd(8,bin(13))) | pad0(wd(8,10,bin(13))) | pad0(wd(8,6,bin(13))); 58 75 59 76 … … 62 79 printf( "%g %8g %#8g %g %8g %8.0g %#8.0g %8.2g %#8.2g %-8.2g %-8.2g %-#8.2g %-+8.2g %-+#8.2g %08.2g %8.2E %8.2a %#8.2A %#8.2e\n", 63 80 0.0,3.0F,3.0F, f, f, f, f, f, f, 3.0F, f, f, f, f, f, f, f, f, f ); 64 sout | 0.0 | wd(8, 3.0F) | nodp(wd(8, 3.0F)) | f | wd(8, f) | ws(8,0, f) | nodp(ws(8,0, f)) | ws(8,2, f) | nodp(ws(8,2, f)) | left(ws(8,2, 3.0F)) | left(ws(8,2, f)) | left(nodp(ws(8,2, f))) | left(sign(ws(8,2, f))) | left(sign(nodp(ws(8,2, f)))) | pad0(ws(8,2, f)) | upcase(wd(8,2, sci(f))) | wd(8,2, hex(f)) | upcase(wd(8,2, hex(f))) | nodp(wd(8,2, sci(f))); 81 sout | 0.0 | wd(8, 3.0F) | nodp(wd(8, 3.0F)) | f | wd(8, f) | ws(8,0, f) | nodp(ws(8,0, f)) | ws(8,2, f) | nodp(ws(8,2, f)) | nonl; 82 sout | left(ws(8,2, 3.0F)) | left(ws(8,2, f)) | left(nodp(ws(8,2, f))) | left(sign(ws(8,2, f))) | left(sign(nodp(ws(8,2, f)))) | nonl; 83 sout | pad0(ws(8,2, f)) | upcase(wd(8,2, sci(f))) | wd(8,2, hex(f)) | upcase(wd(8,2, hex(f))) | nodp(wd(8,2, sci(f))); 65 84 66 85 sout | "double"; … … 68 87 printf( "%g %#8f %g %8f %#8.0f %8.0f %8.2f %-8.2f %-+#8.2f %08.2F %8.2E %8.2a %8.2A %8.2e\n", 69 88 0.0, 3.0, d, d, d, d, d, d, d, d, d, d, d, d ); 70 sout | 0.0 | wd(8, 3.0) | d | wd(8, d) | nodp(wd(8,0, d)) | wd(8,0, d) | wd(8,2, d) | left(wd(8,2, d)) | left(sign(wd(8,2, d))) | pad0(upcase(wd(8,2, d))) | upcase(wd(8,2, sci(d))) | wd(8,2, hex(d)) | upcase(wd(8,2, hex(d))) | wd(8,2, sci(d)); 89 sout | 0.0 | wd(8, 3.0) | d | wd(8, d) | nodp(wd(8,0, d)) | wd(8,0, d) | wd(8,2, d) | nonl; 90 sout | left(wd(8,2, d)) | left(sign(wd(8,2, d))) | pad0(upcase(wd(8,2, d))) | upcase(wd(8,2, sci(d))) | wd(8,2, hex(d)) | upcase(wd(8,2, hex(d))) | wd(8,2, sci(d)); 71 91 72 92 sout | "long double"; … … 74 94 printf( "%Lg %#8Lf %Lg %8Lf %#8.0Lf %8.0Lf %8.2Lf %-8.2Lf %-+#8.2Lf %08.2LF %8.2LE %8.2La %8.2LA %8.2Le\n", 75 95 0.0L, 3.0L, ld, ld, ld, ld, ld, ld, ld, ld, ld, ld, ld, ld ); 76 sout | 0.0L | wd(8, 3.0L) | ld | wd(8, ld) | nodp(wd(8,0, ld)) | wd(8,0, ld) | wd(8,2, ld) | left(wd(8,2, ld)) | left(sign(wd(8,2, ld))) | pad0(upcase(wd(8,2, ld))) | upcase(wd(8,2, sci(ld))) | wd(8,2, hex(ld)) | upcase(wd(8,2, hex(ld))) | wd(8,2, sci(ld)); 96 sout | 0.0L | wd(8, 3.0L) | ld | wd(8, ld) | nodp(wd(8,0, ld)) | wd(8,0, ld) | wd(8,2, ld) | nonl; 97 sout | left(wd(8,2, ld)) | left(sign(wd(8,2, ld))) | pad0(upcase(wd(8,2, ld))) | upcase(wd(8,2, sci(ld))) | wd(8,2, hex(ld)) | upcase(wd(8,2, hex(ld))) | wd(8,2, sci(ld)); 77 98 78 99 … … 80 101 char c = 'a'; 81 102 printf( "%c %2c %5c %-5c %hho %#hho %hhx %#hhx %#8hhx %#8hhX %-8c %8c\n", c, c, c, c, c, c, c, c, c, c, c, c ); 82 sout | c | ' ' | wd(2,c) | wd(5,c) | left(wd(5,c)) | nobase(oct(c)) | oct(c) | nobase(hex(c)) | hex(c) | wd(8,hex(c)) | upcase(wd(8,hex(c))) | left(wd(8,c)) | wd(8,c); 103 sout | c | ' ' | wd(2,c) | wd(5,c) | left(wd(5,c)) | nobase(oct(c)) | oct(c) | nonl; 104 sout | nobase(hex(c)) | hex(c) | wd(8,hex(c)) | upcase(wd(8,hex(c))) | left(wd(8,c)) | wd(8,c); 83 105 84 106 sout | nl | "string"; -
tests/pybin/settings.py
re3bc51c rbcd74f3 23 23 class Architecture: 24 24 KnownArchitectures = { 25 'x64' 26 'x86-64' 27 'x86_64' 28 'x86' 29 'aarch64' 30 'i386' 31 'i486' 32 'i686' 33 'Intel 80386' 34 'arm' 35 'ARM' 25 'x64' : 'x64', 26 'x86-64' : 'x64', 27 'x86_64' : 'x64', 28 'x86' : 'x86', 29 'aarch64' : 'arm', 30 'i386' : 'x86', 31 'i486' : 'x86', 32 'i686' : 'x86', 33 'Intel 80386' : 'x86', 34 'arm' : 'arm', 35 'ARM' : 'arm', 36 36 } 37 37 … … 81 81 return True if not arch else self.target == arch 82 82 83 @ classmethod84 def make_canonical( _,arch):83 @staticmethod 84 def make_canonical(arch): 85 85 return Architecture.KnownArchitectures[arch] 86 86 … … 105 105 self.total = Timeouts.check(tg) 106 106 107 @ classmethod108 def check( _,value):107 @staticmethod 108 def check(value): 109 109 if value < 1: 110 110 print("Timeouts must be at least 1 second", file=sys.stderr) … … 129 129 global timeout2gdb 130 130 131 all_arch = [Architecture(o) for o in list(dict.fromkeys(options.arch ))] 131 all_arch = [Architecture(o) for o in list(dict.fromkeys(options.arch ))] if options.arch else [Architecture(None)] 132 132 all_debug = [Debug(o) for o in list(dict.fromkeys(options.debug ))] 133 133 all_install = [Install(o) for o in list(dict.fromkeys(options.install))] -
tests/pybin/test_run.py
re3bc51c rbcd74f3 40 40 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, self.name) ) 41 41 42 @ classmethod43 def valid_name( _,name):42 @staticmethod 43 def valid_name(name): 44 44 return not name.endswith( ('.c', '.cc', '.cpp', '.cfa') ) 45 45 46 @ classmethod47 def from_target(_, target):46 @staticmethod 47 def new_target(target, arch): 48 48 test = Test() 49 49 test.name = os.path.basename(target) 50 50 test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR) 51 test.arch = settings.arch.target if settings.arch.cross_compileelse ''51 test.arch = arch.target if arch else '' 52 52 return test 53 53 … … 72 72 return text 73 73 74 @ classmethod75 def fmtDur( cls,duration ):74 @staticmethod 75 def fmtDur( duration ): 76 76 if duration : 77 77 hours, rem = divmod(duration, 3600) -
tests/test.py
re3bc51c rbcd74f3 67 67 for testname in options.tests : 68 68 testname = canonical_path( testname ) 69 # first check if this is a valid name to regenerate 69 70 if Test.valid_name(testname): 71 # this is a valid name, let's check if it already exists 70 72 found = [test for test in all_tests if canonical_path( test.target() ) == testname] 71 tests.append( found[0] if len(found) == 1 else Test.from_target(testname) ) 73 if not found: 74 # it's a new name, create it according to the name and specified architecture 75 if options.arch: 76 # user specified one or multiple architectures, assume the tests will have architecture specific results 77 tests.extend( [Test.new_target(testname, arch) for arch in settings.all_arch] ) 78 else: 79 # user didn't specify an architecture, just create a cross platform test 80 tests.append( Test.new_target( testname, None ) ) 81 elif len(found) == 1 and not found[0].arch: 82 # we found a single test, the user better be wanting to create a cross platform test 83 if options.arch: 84 print('ERROR: "%s", test has no specified architecture but --arch was specified, ignoring it' % testname, file=sys.stderr) 85 else: 86 tests.append( found[0] ) 87 else: 88 # this test is already cross platform, just add a test for each platform the user asked 89 tests.extend( [Test.new_target(testname, arch) for arch in settings.all_arch] ) 90 91 # print a warning if it users didn't ask for a specific architecture 92 if not options.arch: 93 print('WARNING: "%s", test has architecture specific expected files but --arch was not specified, regenerating only for current host' % testname, file=sys.stderr) 94 72 95 else : 73 96 print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr) … … 91 114 parser.add_argument('--debug', help='Run all tests in debug or release', type=comma_separated(yes_no), default='yes') 92 115 parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no') 93 parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default= '')116 parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None) 94 117 parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_') 95 118 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=60) … … 183 206 184 207 else: 185 with open (out_file, "r") as myfile: 186 error = myfile.read() 208 if os.stat(out_file).st_size < 1048576: 209 with open (out_file, "r") as myfile: 210 error = myfile.read() 211 else: 212 error = "Output log can't be read, file is bigger than 1MB, see {} for actual error\n".format(out_file) 187 213 188 214 ret, info = core_info(exe_file) … … 220 246 return False, "" 221 247 except Exception as ex: 222 print("Unexpected error in worker thread : %s" % ex, file=sys.stderr)248 print("Unexpected error in worker thread running {}: {}".format(t.target(), ex), file=sys.stderr) 223 249 sys.stderr.flush() 224 250 return False, "" -
tests/vector.cfa
re3bc51c rbcd74f3 14 14 // 15 15 16 #include <vector.hfa> 16 17 #include <fstream.hfa> 17 #include <vector.hfa>18 18 19 19 #undef assert … … 28 28 int main() { 29 29 vector( int ) iv; 30 31 assert( ((uintptr_t)&iv.storage.storage ) == (((uintptr_t)&iv)) ); 32 assert( ((uintptr_t)&iv.storage.capacity) == (((uintptr_t)&iv) + sizeof(void *)) ); 33 assert( ((uintptr_t)&iv.size ) == (((uintptr_t)&iv) + sizeof(void *) + sizeof(size_t)) ); 30 34 31 35 assert( empty( &iv ) );
Note: See TracChangeset
for help on using the changeset viewer.