- Timestamp:
- Jul 13, 2017, 3:57:04 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0720e049, 9a1e509
- Parents:
- 55a68c3 (diff), d6ff3ff (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:
- src/tests
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/32/math.txt
r55a68c3 r3d4b23fa 22 22 cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i 23 23 tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i 24 asin:1.5708 1.5707963267949 1.57079632679489662 0.6662 4+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i24 asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i 25 25 acos:0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i 26 26 atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i -
src/tests/.expect/concurrent/sched-int-disjoint.txt
r55a68c3 r3d4b23fa 9 9 9000 10 10 10000 11 1100012 1200013 1300014 1400015 1500016 1600017 1700018 1800019 1900020 2000021 2100022 2200023 2300024 2400025 2500026 2600027 2700028 2800029 2900030 3000031 3100032 3200033 3300034 3400035 3500036 3600037 3700038 3800039 3900040 4000041 4100042 4200043 4300044 4400045 4500046 4600047 4700048 4800049 4900050 5000051 5100052 5200053 5300054 5400055 5500056 5600057 5700058 5800059 5900060 6000061 6100062 6200063 6300064 6400065 6500066 6600067 6700068 6800069 6900070 7000071 7100072 7200073 7300074 7400075 7500076 7600077 7700078 7800079 7900080 8000081 8100082 8200083 8300084 8400085 8500086 8600087 8700088 8800089 8900090 9000091 9100092 9200093 9300094 9400095 9500096 9600097 9700098 9800099 99000100 100000101 11 All waiter done -
src/tests/.expect/io.txt
r55a68c3 r3d4b23fa 4 4 123 5 5 6 opening delimiters 6 opening delimiters 7 7 x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10 8 8 9 closing delimiters 10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x 9 closing delimiters 10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x 11 11 12 opening/closing delimiters 12 opening/closing delimiters 13 13 x`1`x'2'x"3"x:4:x 5 x 6 x 14 14 7 … … 19 19 x 20 20 10 21 x 21 x 22 22 23 override opening/closing delimiters 23 override opening/closing delimiters 24 24 x ( 1 ) x 2 , x 3 :x: 4 25 25 26 input bacis types 26 input bacis types 27 27 28 output basic types 28 output basic types 29 29 A 30 30 1 2 3 4 5 6 7 8 … … 32 32 1.1+2.3i 1.1-2.3i 1.1-2.3i 33 33 34 tuples 35 1, 2, 3 3, 4, 534 tuples 35 1, 2, 3 4, 5, 6 36 36 37 toggle separator 37 toggle separator 38 38 1.11.21.3 39 39 1.1+2.3i1.1-2.3i1.1-2.3i 40 abcxyz 41 abcxyz 40 1.1+2.3i 1.1-2.3i1.1-2.3i 41 1.1+2.3i 1.1-2.3i 1.1-2.3i 42 1.1+2.3i1.1-2.3i 1.1-2.3i 43 abcxyz 44 abcxyz 42 45 43 change separator 44 from " "to ", $"46 change separator 47 from " " to ", $" 45 48 1.1, $1.2, $1.3 46 49 1.1+2.3i, $1.1-2.3i, $1.1-2.3i 47 abc, $xyz , $48 1, 2, 3, $ 3, 4, 550 abc, $xyz 51 1, 2, 3, $4, 5, 6 49 52 50 from ", $" to " "53 from ", $" to " " 51 54 1.1 1.2 1.3 52 55 1.1+2.3i 1.1-2.3i 1.1-2.3i 53 abc xyz 54 1, 2, 3 3, 4, 556 abc xyz 57 1, 2, 3 4, 5, 6 55 58 56 1 2 3 59 check sepOn/sepOff 60 1 2 3 57 61 12 3 58 1 2 359 62 1 2 3 60 63 1 2 3 61 64 65 1 2 3 66 67 check enable/disable 62 68 123 63 69 1 23 … … 65 71 123 66 72 1 2 3 67 123 73 123 68 74 1 2 3 69 75 70 1 2 3 3 4 5" "71 1, 2, 3 3, 4, 5 ","72 1, 2, 3 3, 4, 576 1 2 3 4 5 6 " " 77 1, 2, 3 4, 5, 6 " " 78 1, 2, 3 4, 5, 6 73 79 74 80 3, 4, a, 7.2 75 81 3, 4, a, 7.2 76 82 3 4 a 7.2 77 83 3 4 a 7.234a7.23 4 a 7.2 78 84 3-4-a-7.2^3^4^3-4-a-7.2 -
src/tests/Makefile.am
r55a68c3 r3d4b23fa 29 29 30 30 # applies to both programs 31 EXTRA_FLAGS = 32 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ ${EXTRA_FLAGS} 31 DEBUG_FLAGS = 32 33 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ 34 if !BUILD_DEBUG 35 BUILD_FLAGS += -nodebug 36 else 37 if !BUILD_RELEASE 38 BUILD_FLAGS += -debug 39 else 40 BUILD_FLAGS += ${DEBUG_FLAGS} 41 endif 42 endif 43 33 44 TEST_FLAGS = $(if $(test), 2> .err/${@}.log, ) 34 45 AM_CFLAGS = ${TEST_FLAGS} ${BUILD_FLAGS} -
src/tests/Makefile.in
r55a68c3 r3d4b23fa 92 92 host_triplet = @host@ 93 93 @BUILD_CONCURRENCY_TRUE@am__append_1 = coroutine thread monitor 94 @BUILD_DEBUG_FALSE@am__append_2 = -nodebug 95 @BUILD_DEBUG_TRUE@@BUILD_RELEASE_FALSE@am__append_3 = -debug 96 @BUILD_DEBUG_TRUE@@BUILD_RELEASE_TRUE@am__append_4 = ${DEBUG_FLAGS} 94 97 EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \ 95 98 avl_test$(EXEEXT) … … 320 323 321 324 # applies to both programs 322 EXTRA_FLAGS = 323 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ ${EXTRA_FLAGS} 325 DEBUG_FLAGS = 326 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ \ 327 $(am__append_2) $(am__append_3) $(am__append_4) 324 328 TEST_FLAGS = $(if $(test), 2> .err/${@}.log, ) 325 329 AM_CFLAGS = ${TEST_FLAGS} ${BUILD_FLAGS} … … 343 347 esac; \ 344 348 done; \ 345 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/tests/Makefile'; \349 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tests/Makefile'; \ 346 350 $(am__cd) $(top_srcdir) && \ 347 $(AUTOMAKE) -- gnusrc/tests/Makefile351 $(AUTOMAKE) --foreign src/tests/Makefile 348 352 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 349 353 @case '$?' in \ -
src/tests/io.c
r55a68c3 r3d4b23fa 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jul 2 09:40:58201713 // Update Count : 6812 // Last Modified On : Thu Jul 6 23:26:12 2017 13 // Update Count : 78 14 14 // 15 15 … … 104 104 105 105 sout | "tuples" | endl; 106 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5] ];106 [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ]; 107 107 sout | t1 | t2 | endl; // print tuple 108 108 sout | endl; … … 110 110 sout | "toggle separator" | endl; 111 111 sout | f | "" | d | "" | ld | endl // floating point without separator 112 | sepDisable | fc | dc | ldc | sepEnable | endl // complex without separator 113 | sepOn | s1 | sepOff | s2 | endl // local separator removal 114 | s1 | "" | s2 | endl; // C string without separator 112 | sepDisable | fc | dc | ldc | endl // complex without separator 113 | fc | sepOn | dc | ldc | endl // local separator add 114 | sepEnable | fc | dc | ldc | endl // complex with separator 115 | fc | sepOff | dc | ldc | endl // local separator removal 116 | s1 | sepOff | s2 | endl // local separator removal 117 | s1 | "" | s2 | endl; // local separator removal 115 118 sout | endl; 116 119 117 120 sout | "change separator" | endl; 118 sout | "from \" " | sepGet( sout )| "\"";121 sout | "from \"" | sep | "\""; 119 122 sepSet( sout, ", $" ); // change separator, maximum of 15 characters 120 sout | " to \" " | sepGet( sout )| "\"" | endl;123 sout | " to \"" | sep | "\"" | endl; 121 124 sout | f | d | ld | endl 122 125 | fc | dc | ldc | endl … … 124 127 | t1 | t2 | endl; // print tuple 125 128 sout | endl; 126 sout | "from \"" | sep Get( sout ) | "\"";129 sout | "from \"" | sep | "\" "; 127 130 sepSet( sout, " " ); // restore separator 128 sout | "to \"" | sep Get( sout )| "\"" | endl;131 sout | "to \"" | sep | "\"" | endl; 129 132 sout | f | d | ld | endl 130 133 | fc | dc | ldc | endl … … 133 136 sout | endl; 134 137 135 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // separator at start/end of line 138 sout | "check sepOn/sepOff" | endl; 139 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // no separator at start/end of line 136 140 sout | 1 | sepOff | 2 | 3 | endl; // locally turn off implicit separator 137 sout | sepOn | 1 | 2 | 3 | sepOn | sepOff | endl; // separator at startof line138 sout | 1 | 2 | 3 | endl | sepOn; //separator at start of next line141 sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n'; // no separator at start/end of line 142 sout | 1 | 2 | 3 | "\n\n" | sepOn; // no separator at start of next line 139 143 sout | 1 | 2 | 3 | endl; 140 144 sout | endl; 141 145 146 sout | "check enable/disable" | endl; 142 147 sout | sepDisable | 1 | 2 | 3 | endl; // globally turn off implicit separation 143 148 sout | 1 | sepOn | 2 | 3 | endl; // locally turn on implicit separator … … 149 154 sout | endl; 150 155 156 // sout | fmt( d, "%8.3f" ) || endl; 157 // sout | endl; 158 151 159 sepSetTuple( sout, " " ); // set tuple separator from ", " to " " 152 sout | t1 | t2 | " \"" | sep GetTuple( sout )| "\"" | endl;160 sout | t1 | t2 | " \"" | sep | "\"" | endl; 153 161 sepSetTuple( sout, ", " ); // reset tuple separator to ", " 154 sout | t1 | t2 | " \"" | sep GetTuple( sout )| "\"" | endl;162 sout | t1 | t2 | " \"" | sep | "\"" | endl; 155 163 sout | t1 | t2 | endl; // print tuple 156 164 sout | endl; -
src/tests/preempt_longrun/Makefile.am
r55a68c3 r3d4b23fa 10 10 ## Author : Thierry Delisle 11 11 ## Created On : Fri Jun 16 10:57:34 2017 12 ## Last Modified By : 13 ## Last Modified On : 12 ## Last Modified By : 13 ## Last Modified On : 14 14 ## Update Count : 0 15 15 ############################################################################### 16 16 17 17 repeats=10 18 max_time= 3019 preempt=1 0_000ul18 max_time=600 19 preempt=1_000ul 20 20 21 21 REPEAT = ${abs_top_srcdir}/tools/repeat -s … … 25 25 CC = @CFA_BINDIR@/@CFA_NAME@ 26 26 27 TESTS = barge block create disjoint processor stack wait yield27 TESTS = barge block create disjoint enter enter3 processor stack wait yield 28 28 29 29 .INTERMEDIATE: ${TESTS} -
src/tests/preempt_longrun/Makefile.in
r55a68c3 r3d4b23fa 449 449 top_srcdir = @top_srcdir@ 450 450 repeats = 10 451 max_time = 30452 preempt = 1 0_000ul451 max_time = 600 452 preempt = 1_000ul 453 453 REPEAT = ${abs_top_srcdir}/tools/repeat -s 454 454 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -debug -O2 -DPREEMPTION_RATE=${preempt} 455 TESTS = barge block create disjoint processor stack wait yield455 TESTS = barge block create disjoint enter enter3 processor stack wait yield 456 456 all: all-am 457 457 … … 467 467 esac; \ 468 468 done; \ 469 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/tests/preempt_longrun/Makefile'; \469 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tests/preempt_longrun/Makefile'; \ 470 470 $(am__cd) $(top_srcdir) && \ 471 $(AUTOMAKE) -- gnusrc/tests/preempt_longrun/Makefile471 $(AUTOMAKE) --foreign src/tests/preempt_longrun/Makefile 472 472 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 473 473 @case '$?' in \ … … 663 663 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ 664 664 "$$tst" $(AM_TESTS_FD_REDIRECT) 665 enter.log: enter 666 @p='enter'; \ 667 b='enter'; \ 668 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ 669 --log-file $$b.log --trs-file $$b.trs \ 670 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ 671 "$$tst" $(AM_TESTS_FD_REDIRECT) 672 enter3.log: enter3 673 @p='enter3'; \ 674 b='enter3'; \ 675 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ 676 --log-file $$b.log --trs-file $$b.trs \ 677 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ 678 "$$tst" $(AM_TESTS_FD_REDIRECT) 665 679 processor.log: processor 666 680 @p='processor'; \ -
src/tests/preempt_longrun/create.c
r55a68c3 r3d4b23fa 10 10 } 11 11 12 thread Worker{};12 thread worker_t {}; 13 13 14 void main( Worker* this) {}14 void main(worker_t * this) {} 15 15 16 16 int main(int argc, char* argv[]) { 17 for(int i = 0; i < 100_000ul; i++) { 18 Worker w; 17 processor p; 18 for(int i = 0; i < 10_000ul; i++) { 19 worker_t w[7]; 19 20 } 20 21 } -
src/tests/preempt_longrun/processor.c
r55a68c3 r3d4b23fa 10 10 } 11 11 12 thread Worker{};12 thread worker_t {}; 13 13 14 void main( Worker* this) {}14 void main(worker_t * this) {} 15 15 16 16 int main(int argc, char* argv[]) { 17 for(int i = 0; i < 10 0_000ul; i++) {17 for(int i = 0; i < 10_000ul; i++) { 18 18 processor p; 19 19 } -
src/tests/preempt_longrun/stack.c
r55a68c3 r3d4b23fa 12 12 } 13 13 14 thread Worker{};14 thread worker_t {}; 15 15 16 void main( Worker* this) {16 void main(worker_t * this) { 17 17 volatile long p = 5_021_609ul; 18 18 volatile long a = 326_417ul; 19 19 volatile long n = 1l; 20 for (volatile long i = 0; i < p; i++) { 21 n *= a; 22 n %= p; 20 for (volatile long i = 0; i < p; i++) { 21 n *= a; 22 n %= p; 23 23 } 24 24 25 25 if( n != a ) { 26 26 abort(); … … 28 28 } 29 29 30 extern "C" { 31 static worker_t * workers; 32 } 33 30 34 int main(int argc, char* argv[]) { 31 35 processor p; 32 36 { 33 Worker w[7]; 37 worker_t w[7]; 38 workers = w; 34 39 } 35 40 } -
src/tests/preempt_longrun/yield.c
r55a68c3 r3d4b23fa 10 10 } 11 11 12 thread Worker{};12 thread worker_t {}; 13 13 14 void main( Worker* this) {15 for(int i = 0; i < 100_000ul; i++) {14 void main(worker_t * this) { 15 for(int i = 0; i < 325_000ul; i++) { 16 16 yield(); 17 17 } 18 } 19 20 extern "C" { 21 static worker_t * workers; 18 22 } 19 23 … … 21 25 processor p; 22 26 { 23 Worker w[7]; 27 worker_t w[7]; 28 workers = w; 24 29 } 25 30 } -
src/tests/sched-int-block.c
r55a68c3 r3d4b23fa 6 6 7 7 #ifndef N 8 #define N 10 0_0008 #define N 10_000 9 9 #endif 10 10 … … 31 31 //------------------------------------------------------------------------------ 32 32 void wait_op( global_data_t * mutex a, global_data_t * mutex b, unsigned i ) { 33 wait( &cond, (uintptr_t)this_thread ());33 wait( &cond, (uintptr_t)this_thread ); 34 34 35 35 yield( ((unsigned)rand48()) % 10 ); … … 40 40 } 41 41 42 a->last_thread = b->last_thread = this_thread ();42 a->last_thread = b->last_thread = this_thread; 43 43 44 44 yield( ((unsigned)rand48()) % 10 ); … … 56 56 yield( ((unsigned)rand48()) % 10 ); 57 57 58 a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread ();58 a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread; 59 59 60 60 if( !is_empty( &cond ) ) { … … 86 86 //------------------------------------------------------------------------------ 87 87 void barge_op( global_data_t * mutex a ) { 88 a->last_thread = this_thread ();88 a->last_thread = this_thread; 89 89 } 90 90 -
src/tests/sched-int-disjoint.c
r55a68c3 r3d4b23fa 5 5 6 6 #ifndef N 7 #define N 10 0_0007 #define N 10_000 8 8 #endif 9 9 … … 42 42 43 43 void main( Barger * this ) { 44 while( !all_done ) { 44 while( !all_done ) { 45 45 barge( &data ); 46 yield(); 46 yield(); 47 47 } 48 48 } … … 53 53 wait( &cond ); 54 54 if( d->state != SIGNAL ) { 55 sout | "ERROR barging!" | endl; 55 sout | "ERROR barging!" | endl; 56 56 } 57 57 … … 85 85 bool running = data.counter < N && data.counter > 0; 86 86 if( data.state != SIGNAL && running ) { 87 sout | "ERROR Eager signal" | data.state | endl; 87 sout | "ERROR Eager signal" | data.state | endl; 88 88 } 89 89 } … … 92 92 93 93 void main( Signaller * this ) { 94 while( !all_done ) { 94 while( !all_done ) { 95 95 logic( &mut ); 96 yield(); 96 yield(); 97 97 } 98 98 } … … 111 111 sout | "All waiter done" | endl; 112 112 all_done = true; 113 } 113 } 114 114 } -
src/tests/sched-int-wait.c
r55a68c3 r3d4b23fa 50 50 unsigned action = (unsigned)rand48() % 4; 51 51 switch( action ) { 52 case 0: 52 case 0: 53 53 signal( &condABC, &globalA, &globalB, &globalC ); 54 54 break; 55 case 1: 55 case 1: 56 56 signal( &condAB , &globalA, &globalB ); 57 57 break; 58 case 2: 58 case 2: 59 59 signal( &condBC , &globalB, &globalC ); 60 60 break; 61 case 3: 61 case 3: 62 62 signal( &condAC , &globalA, &globalC ); 63 63 break; … … 67 67 } 68 68 yield(); 69 } 69 } 70 70 } 71 71 -
src/tests/test.py
r55a68c3 r3d4b23fa 166 166 167 167 # build, skipping to next test on error 168 make_ret, _ = sh("""%s test=yes EXTRA_FLAGS="%s" %s 2> %s 1> /dev/null""" % (make_cmd, options, test.name, out_file), dry_run)168 make_ret, _ = sh("""%s test=yes DEBUG_FLAGS="%s" %s 2> %s 1> /dev/null""" % (make_cmd, options, test.name, out_file), dry_run) 169 169 170 170 retcode = 0 … … 202 202 error = myfile.read() 203 203 204 204 205 205 # clean the executable 206 206 sh("rm -f %s > /dev/null 2>&1" % test.name, dry_run) -
src/tests/thread.c
r55a68c3 r3d4b23fa 4 4 #include <thread> 5 5 6 // thread First;7 // void main(First* this);6 thread First { semaphore* lock; }; 7 thread Second { semaphore* lock; }; 8 8 9 // thread Second; 10 // void main(Second* this); 11 12 thread First { signal_once* lock; }; 13 thread Second { signal_once* lock; }; 14 15 void ?{}( First * this, signal_once* lock ) { this->lock = lock; } 16 void ?{}( Second * this, signal_once* lock ) { this->lock = lock; } 9 void ?{}( First * this, semaphore* lock ) { this->lock = lock; } 10 void ?{}( Second * this, semaphore* lock ) { this->lock = lock; } 17 11 18 12 void main(First* this) { … … 21 15 yield(); 22 16 } 23 signal(this->lock);17 V(this->lock); 24 18 } 25 19 26 20 void main(Second* this) { 27 wait(this->lock);21 P(this->lock); 28 22 for(int i = 0; i < 10; i++) { 29 23 sout | "Second : Suspend No." | i + 1 | endl; … … 34 28 35 29 int main(int argc, char* argv[]) { 36 s ignal_once lock;30 semaphore lock = { 0 }; 37 31 sout | "User main begin" | endl; 38 32 {
Note:
See TracChangeset
for help on using the changeset viewer.