Changeset 12c1eef for tests


Ignore:
Timestamp:
Jan 19, 2022, 2:36:56 PM (4 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
97c215f
Parents:
5235d49 (diff), 6a33e40 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests
Files:
12 added
6 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • tests/device/cpu.cfa

    r5235d49 r12c1eef  
    1515
    1616
     17#include <device/cpu.hfa>
     18#include <limits.hfa>
    1719#include <fstream.hfa>
    18 #include <device/cpu.hfa>
    1920#include <stdlib.hfa>
    2021
     
    118119
    119120        unsigned found_level = 0;
    120         unsigned found = -1u;
     121        unsigned found = MAX;
    121122        for(i; idxs) {
    122123                unsigned idx = idxs - 1 - i;
     
    136137        }
    137138
    138         /* paranoid */ verify(found != -1u);
     139        /* paranoid */ verify(found != MAX);
    139140        return found;
    140141}
  • tests/io/io-acquire.cfa

    r5235d49 r12c1eef  
    1010// Created On       : Mon Mar  1 18:40:09 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Oct  6 18:04:58 2021
    13 // Update Count     : 72
     12// Last Modified On : Fri Jan 14 09:13:18 2022
     13// Update Count     : 74
    1414//
    1515
     
    1818#include <mutex_stmt.hfa>
    1919
     20Duration default_preemption() { return 0; }
     21
    2022thread T {};
    2123void main( T & ) {
     
    2325
    2426        for ( 100 ) {                                                                           // expression protection
    25                 mutex(sout) sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
     27                mutex( sout ) sout | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    2628        }
    2729        mutex( sout ) {                                                                         // statement protection
     
    5153        int a, b, c, d, e, f, g, h, i;
    5254        for ( 100 ) {                                                                           // expression protection
    53                 mutex(sin) sin | a | b | c | d | e | f | g | h | i;
     55                mutex( sin ) sin | a | b | c | d | e | f | g | h | i;
    5456        }
    5557        mutex( sin ) {                                                                          // statement protection
  • tests/unified_locking/.expect/locks.txt

    r5235d49 r12c1eef  
    1111Start Test 6: owner lock and condition variable 3 wait/notify all
    1212Done Test 6
    13 Start Test 7: fast lock and condition variable single wait/notify
     13Start Test 7: linear backoff lock and condition variable single wait/notify
    1414Done Test 7
    15 Start Test 8: fast lock and condition variable 3 wait/notify all
     15Start Test 8: linear backoff lock and condition variable 3 wait/notify all
    1616Done Test 8
    17 Start Test 9: linear backoff lock and condition variable single wait/notify
     17Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify
    1818Done Test 9
    19 Start Test 10: linear backoff lock and condition variable 3 wait/notify all
     19Start Test 10: owner lock and condition variable multiple acquire and wait/notify
    2020Done Test 10
    21 Start Test 11: multi acquisiton lock and condition variable multiple acquire and wait/notify
     21Start Test 11: no lock condition variable wait/notify
    2222Done Test 11
    23 Start Test 12: owner lock and condition variable multiple acquire and wait/notify
     23Start Test 12: locked condition variable wait/notify with front()
    2424Done Test 12
    25 Start Test 13: no lock condition variable wait/notify
    26 Done Test 13
    27 Start Test 14: locked condition variable wait/notify with front()
    28 Done Test 14
  • tests/unified_locking/locks.cfa

    r5235d49 r12c1eef  
    1515condition_variable( owner_lock ) c_o;
    1616
    17 fast_lock f;
    18 condition_variable( fast_lock ) c_f;
    19 
    2017linear_backoff_then_block_lock l;
    2118condition_variable( linear_backoff_then_block_lock ) c_l;
     
    7471                }
    7572                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);
    10473        }
    10574}
     
    317286        printf("Done Test 6\n");
    318287
    319         printf("Start Test 7: fast lock 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];
    322291        }
    323292        printf("Done Test 7\n");
    324293
    325         printf("Start Test 8: fast lock 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];
    328297        }
    329298        printf("Done Test 8\n");
    330299
    331         printf("Start Test 9: linear backoff lock and condition variable single wait/notify\n");
    332         {
    333                 T_C_L_WS1 t1[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];
    334303        }
    335304        printf("Done Test 9\n");
    336305
    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];
    340309        }
    341310        printf("Done Test 10\n");
    342311
    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");
    356313        {
    357314                T_C_NLW t1;
    358315                T_C_NLS t2;
    359316        }
    360         printf("Done Test 13\n");
    361 
    362         printf("Start Test 14: 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");
    363320        {
    364321                T_C_S_WNF t1[2];
    365322        }
    366         printf("Done Test 14\n");
    367 }
     323        printf("Done Test 12\n");
     324}
  • tests/unified_locking/mutex_test.hfa

    r5235d49 r12c1eef  
    1010        thread$ * id;
    1111        uint32_t sum;
     12        uint32_t cnt;
    1213};
    1314
     
    2728        {
    2829                uint32_t tsum = mo.sum;
     30                uint32_t cnt = mo.cnt;
    2931                mo.id = me;
    3032                yield(random(5));
    3133                value = ((uint32_t)random()) ^ ((uint32_t)me);
    3234                if(mo.id != me) sout | "Intruder!";
     35                mo.cnt = cnt + 1;
    3336                mo.sum = tsum + value;
    3437        }
     
    5457        uint32_t sum = -32;
    5558        mo.sum = -32;
     59        mo.cnt = 0;
    5660        processor p[2];
    5761        sout | "Starting";
     
    6367        }
    6468        sout | "Done!";
     69        if(mo.cnt != (13 * num_times)) sout | "Invalid cs count!" | mo.cnt | "vs "| (13 * num_times) | "(13 *" | num_times | ')';
    6570        if(sum == mo.sum) sout | "Match!";
    6671        else sout | "No Match!" | sum | "vs" | mo.sum;
Note: See TracChangeset for help on using the changeset viewer.