Changeset 6f8c46d for tests


Ignore:
Timestamp:
Jun 15, 2021, 11:34:45 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
4f1b8f3f
Parents:
b6749fd (diff), 07033ce (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:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • tests/coroutine/fibonacci.cfa

    rb6749fd r6f8c46d  
    3131}
    3232
    33 int next( Fibonacci & fib ) with( fib ) {
    34         resume( fib );                                                                          // restart last suspend
    35         return fn;
    36 }
    37 
    3833int main() {
    3934        Fibonacci f1, f2;
    4035        for ( 10 ) {                                                                            // print N Fibonacci values
    41                 sout | next( f1 ) | next( f2 );
     36                sout | resume( f1 ).fn | resume( f2 ).fn;
    4237        } // for
    4338}
  • tests/unified_locking/fast.cfa

    rb6749fd r6f8c46d  
    2222uint32_t cs() {
    2323        $thread * me = active_thread();
    24         uint32_t value = (uint32_t)me;
     24        uint32_t value;
    2525        lock(mo.l);
    2626        {
     
    2828                mo.id = me;
    2929                yield(random(5));
     30                value = ((uint32_t)random()) ^ ((uint32_t)me);
    3031                if(mo.id != me) sout | "Intruder!";
    3132                mo.sum = tsum + value;
Note: See TracChangeset for help on using the changeset viewer.