- Timestamp:
- Jan 25, 2022, 4:54:35 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 6b2d444, a488783, f681823
- Parents:
- f57f6ea0 (diff), 4fcbf26 (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:
-
- 5 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/.expect/ctor-check.txt
rf57f6ea0 r97fed44 2 2 ?{}: function 3 3 ... with parameters 4 lvalue reference to instance of struct Empty with body4 this: lvalue reference to instance of struct Empty with body 5 5 ... returning nothing 6 6 with body -
tests/concurrent/preempt.cfa
rf57f6ea0 r97fed44 1 #include <fstream.hfa> 1 2 #include <kernel.hfa> 2 3 #include <thread.hfa> … … 25 26 thread worker_t { 26 27 int value; 28 unsigned spin; 27 29 }; 28 30 29 31 void ?{}( worker_t & this, int value ) { 30 32 this.value = value; 33 this.spin = 0; 31 34 } 32 35 33 36 void main(worker_t & this) { 34 37 while(TEST(counter < N)) { 38 if(this.spin > 100_000_000) abort | "Worker" | this.value | "has been spinning too long! (" | this.spin | ")"; 35 39 __cfaabi_check_preemption(); 36 40 if( (counter % 7) == this.value ) { … … 40 44 if( (next % 100) == 0 ) printf("%d\n", (int)next); 41 45 __cfaabi_check_preemption(); 46 this.spin = 0; 42 47 } 43 48 __cfaabi_check_preemption(); 44 49 KICK_WATCHDOG; 50 this.spin++; 45 51 } 46 52 } -
tests/device/cpu.cfa
rf57f6ea0 r97fed44 15 15 16 16 17 #include <device/cpu.hfa> 18 #include <limits.hfa> 17 19 #include <fstream.hfa> 18 #include <device/cpu.hfa>19 20 #include <stdlib.hfa> 20 21 … … 118 119 119 120 unsigned found_level = 0; 120 unsigned found = -1u;121 unsigned found = MAX; 121 122 for(i; idxs) { 122 123 unsigned idx = idxs - 1 - i; … … 136 137 } 137 138 138 /* paranoid */ verify(found != -1u);139 /* paranoid */ verify(found != MAX); 139 140 return found; 140 141 } -
tests/io/io-acquire-in.cfa
rf57f6ea0 r97fed44 10 10 // Created On : Mon Mar 1 18:40:09 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:04:58 202113 // Update Count : 7 212 // Last Modified On : Fri Jan 14 09:13:43 2022 13 // Update Count : 73 14 14 // 15 15 … … 17 17 #include <thread.hfa> 18 18 #include <mutex_stmt.hfa> 19 20 Duration default_preemption() { return 0; } 19 21 20 22 // above output used as input to parallel threads -
tests/io/io-acquire-no-io.cfa
rf57f6ea0 r97fed44 10 10 // Created On : Mon Mar 1 18:40:09 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:04:58 202113 // Update Count : 7 212 // Last Modified On : Fri Jan 14 09:13:54 2022 13 // Update Count : 73 14 14 // 15 15 … … 17 17 #include <thread.hfa> 18 18 #include <mutex_stmt.hfa> 19 20 Duration default_preemption() { return 0; } 19 21 20 22 multiple_acquisition_lock soutLock, sinLock; -
tests/io/io-acquire-out.cfa
rf57f6ea0 r97fed44 10 10 // Created On : Mon Mar 1 18:40:09 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Oct 6 18:04:58 202113 // Update Count : 7 212 // Last Modified On : Fri Jan 14 09:14:06 2022 13 // Update Count : 73 14 14 // 15 15 … … 17 17 #include <thread.hfa> 18 18 #include <mutex_stmt.hfa> 19 20 Duration default_preemption() { return 0; } 19 21 20 22 thread T {}; -
tests/io/io-acquire.cfa
rf57f6ea0 r97fed44 10 10 // Created On : Mon Mar 1 18:40:09 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 10 07:57:12202213 // Update Count : 7 312 // Last Modified On : Fri Jan 14 09:13:18 2022 13 // Update Count : 74 14 14 // 15 15 … … 17 17 #include <thread.hfa> 18 18 #include <mutex_stmt.hfa> 19 20 Duration default_preemption() { return 0; } 19 21 20 22 thread T {}; -
tests/unified_locking/.expect/locks.txt
rf57f6ea0 r97fed44 11 11 Start Test 6: owner lock and condition variable 3 wait/notify all 12 12 Done Test 6 13 Start Test 7: fastlock and condition variable single wait/notify13 Start Test 7: linear backoff lock and condition variable single wait/notify 14 14 Done Test 7 15 Start Test 8: fastlock and condition variable 3 wait/notify all15 Start Test 8: linear backoff lock and condition variable 3 wait/notify all 16 16 Done Test 8 17 Start Test 9: linear backoff lock and condition variable singlewait/notify17 Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify 18 18 Done Test 9 19 Start Test 10: linear backoff lock and condition variable 3 wait/notify all19 Start Test 10: owner lock and condition variable multiple acquire and wait/notify 20 20 Done Test 10 21 Start Test 11: multi acquisiton lock and condition variable multiple acquire andwait/notify21 Start Test 11: no lock condition variable wait/notify 22 22 Done Test 11 23 Start Test 12: owner lock and condition variable multiple acquire and wait/notify23 Start Test 12: locked condition variable wait/notify with front() 24 24 Done Test 12 25 Start Test 13: no lock condition variable wait/notify26 Done Test 1327 Start Test 14: locked condition variable wait/notify with front()28 Done Test 14 -
tests/unified_locking/locks.cfa
rf57f6ea0 r97fed44 15 15 condition_variable( owner_lock ) c_o; 16 16 17 fast_lock f;18 condition_variable( fast_lock ) c_f;19 20 17 linear_backoff_then_block_lock l; 21 18 condition_variable( linear_backoff_then_block_lock ) c_l; … … 74 71 } 75 72 unlock(s); 76 }77 }78 79 thread T_C_F_WS1 {};80 81 void main( T_C_F_WS1 & this ) {82 for (unsigned int i = 0; i < num_times; i++) {83 lock(f);84 if(empty(c_f) && i != num_times - 1) {85 wait(c_f,f);86 }else{87 notify_one(c_f);88 }89 unlock(f);90 }91 }92 93 thread T_C_F_WB1 {};94 95 void main( T_C_F_WB1 & this ) {96 for (unsigned int i = 0; i < num_times; i++) {97 lock(f);98 if(counter(c_f) == 3 || i == num_times - 1) {99 notify_all(c_f);100 }else{101 wait(c_f,f);102 }103 unlock(f);104 73 } 105 74 } … … 317 286 printf("Done Test 6\n"); 318 287 319 printf("Start Test 7: fastlock and condition variable single wait/notify\n");320 { 321 T_C_ F_WS1 t1[2];288 printf("Start Test 7: linear backoff lock and condition variable single wait/notify\n"); 289 { 290 T_C_L_WS1 t1[2]; 322 291 } 323 292 printf("Done Test 7\n"); 324 293 325 printf("Start Test 8: fastlock and condition variable 3 wait/notify all\n");326 { 327 T_C_ F_WB1 t1[4];294 printf("Start Test 8: linear backoff lock and condition variable 3 wait/notify all\n"); 295 { 296 T_C_L_WB1 t1[4]; 328 297 } 329 298 printf("Done Test 8\n"); 330 299 331 printf("Start Test 9: linear backoff lock and condition variable singlewait/notify\n");332 { 333 T_C_ L_WS1t1[2];300 printf("Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 301 { 302 T_C_M_WS2 t1[2]; 334 303 } 335 304 printf("Done Test 9\n"); 336 305 337 printf("Start Test 10: linear backoff lock and condition variable 3 wait/notify all\n");338 { 339 T_C_ L_WB1 t1[4];306 printf("Start Test 10: owner lock and condition variable multiple acquire and wait/notify\n"); 307 { 308 T_C_O_WS2 t1[2]; 340 309 } 341 310 printf("Done Test 10\n"); 342 311 343 printf("Start Test 11: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 344 { 345 T_C_M_WS2 t1[2]; 346 } 347 printf("Done Test 11\n"); 348 349 printf("Start Test 12: owner lock and condition variable multiple acquire and wait/notify\n"); 350 { 351 T_C_O_WS2 t1[2]; 352 } 353 printf("Done Test 12\n"); 354 355 printf("Start Test 13: no lock condition variable wait/notify\n"); 312 printf("Start Test 11: no lock condition variable wait/notify\n"); 356 313 { 357 314 T_C_NLW t1; 358 315 T_C_NLS t2; 359 316 } 360 printf("Done Test 1 3\n");361 362 printf("Start Test 1 4: locked condition variable wait/notify with front()\n");317 printf("Done Test 11\n"); 318 319 printf("Start Test 12: locked condition variable wait/notify with front()\n"); 363 320 { 364 321 T_C_S_WNF t1[2]; 365 322 } 366 printf("Done Test 1 4\n");367 } 323 printf("Done Test 12\n"); 324 }
Note:
See TracChangeset
for help on using the changeset viewer.