Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ tests/Makefile.am	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -11,6 +11,6 @@
 ## Created On       : Sun May 31 09:08:15 2015
 ## Last Modified By : Peter A. Buhr
-## Last Modified On : Mon May  1 16:45:07 2023
-## Update Count     : 144
+## Last Modified On : Mon May  1 17:25:24 2023
+## Update Count     : 145
 ###############################################################################
 
@@ -116,5 +116,5 @@
 #----------------------------------------------------------------------------------------------------------------
 
-all-local :
+all-local : # This name is important to automake and implies the default build target.
 	@+$(TEST_PY) --debug=$(debug) --install=$(installed) --archive-errors=$(archiveerrors) $(concurrent) $(timeouts) $(ARCH) --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
 
Index: tests/concurrent/futures/select_future.cfa
===================================================================
--- tests/concurrent/futures/select_future.cfa	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ tests/concurrent/futures/select_future.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -196,5 +196,3 @@
     delete( shared_future );
 	printf( "done 3\n" );
-
-    // C_TODO: add test for select statement once it is implemented
 }
Index: tests/concurrent/mutexstmt/.expect/scoped_lock.txt
===================================================================
--- tests/concurrent/mutexstmt/.expect/scoped_lock.txt	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ 	(revision )
@@ -1,4 +1,0 @@
-Start Test: single scoped lock mutual exclusion
-End Test: single scoped lock mutual exclusion
-Start Test: multi scoped lock deadlock/mutual exclusion
-End Test: multi scoped lock deadlock/mutual exclusion
Index: tests/concurrent/mutexstmt/scoped_lock.cfa
===================================================================
--- tests/concurrent/mutexstmt/scoped_lock.cfa	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ 	(revision )
@@ -1,96 +1,0 @@
-#include <mutex_stmt.hfa>
-#include <locks.hfa>
-
-const unsigned int num_times = 10000;
-
-single_acquisition_lock m1, m2, m3, m4, m5;
-
-bool insideFlag = false;
-int count = 0;
-
-thread T_Mutex_Scoped {};
-
-void main( T_Mutex_Scoped & this ) {
-	for (unsigned int i = 0; i < num_times; i++) {
-		{
-			scoped_lock(single_acquisition_lock) s{m1};
-			count++;
-		}
-		{
-			scoped_lock(single_acquisition_lock) s{m1};
-			assert(!insideFlag);
-			insideFlag = true;
-			assert(insideFlag);
-			insideFlag = false;
-		}
-	}
-}
-
-thread T_Multi_Scoped {};
-
-void main( T_Multi_Scoped & this ) {
-	for (unsigned int i = 0; i < num_times; i++) {
-		{
-			scoped_lock(single_acquisition_lock) s{m1};
-			assert(!insideFlag);
-			insideFlag = true;
-			assert(insideFlag);
-			insideFlag = false;
-		}
-		{
-			scoped_lock(single_acquisition_lock) s1{m1};
-			scoped_lock(single_acquisition_lock) s2{m2};
-			scoped_lock(single_acquisition_lock) s3{m3};
-			scoped_lock(single_acquisition_lock) s4{m4};
-			scoped_lock(single_acquisition_lock) s5{m5};
-			assert(!insideFlag);
-			insideFlag = true;
-			assert(insideFlag);
-			insideFlag = false;
-		}
-		{
-			scoped_lock(single_acquisition_lock) s1{m1};
-			scoped_lock(single_acquisition_lock) s3{m3};
-			assert(!insideFlag);
-			insideFlag = true;
-			assert(insideFlag);
-			insideFlag = false;
-		}
-		{
-			scoped_lock(single_acquisition_lock) s1{m1};
-			scoped_lock(single_acquisition_lock) s2{m2};
-			scoped_lock(single_acquisition_lock) s4{m4};
-			assert(!insideFlag);
-			insideFlag = true;
-			assert(insideFlag);
-			insideFlag = false;
-		}
-		{
-			scoped_lock(single_acquisition_lock) s1{m1};
-			scoped_lock(single_acquisition_lock) s3{m3};
-			scoped_lock(single_acquisition_lock) s4{m4};
-			scoped_lock(single_acquisition_lock) s5{m5};
-			assert(!insideFlag);
-			insideFlag = true;
-			assert(insideFlag);
-			insideFlag = false;
-		}
-	}
-}
-
-int num_tasks = 10;
-int main() {
-	processor p[10];
-
-	printf("Start Test: single scoped lock mutual exclusion\n");
-	{
-		T_Mutex_Scoped t[10];
-	}
-	assert(count == num_tasks * num_times);
-	printf("End Test: single scoped lock mutual exclusion\n");
-	printf("Start Test: multi scoped lock deadlock/mutual exclusion\n");
-	{
-		T_Multi_Scoped t[10];
-	}
-	printf("End Test: multi scoped lock deadlock/mutual exclusion\n");
-}
Index: tests/concurrent/unified_locking/.expect/clh.txt
===================================================================
--- tests/concurrent/unified_locking/.expect/clh.txt	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ 	(revision )
@@ -1,3 +1,0 @@
-Starting
-Done!
-Match!
Index: tests/concurrent/unified_locking/clh.cfa
===================================================================
--- tests/concurrent/unified_locking/clh.cfa	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#include <locks.hfa>
-
-#define LOCK clh_lock
-#include "mutex_test.hfa"
-
-int main() {
-    test();
-}
Index: tests/concurrent/waituntil/.expect/basic_else.txt
===================================================================
--- tests/concurrent/waituntil/.expect/basic_else.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/.expect/basic_else.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,5 @@
+else1
+A2
+else3
+A4
+A5
Index: tests/concurrent/waituntil/.expect/channel_close.txt
===================================================================
--- tests/concurrent/waituntil/.expect/channel_close.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/.expect/channel_close.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,10 @@
+start OR
+done sleep
+closing A
+closing B
+done
+start AND
+done sleep
+closing A
+closing B
+done
Index: tests/concurrent/waituntil/.expect/channels.txt
===================================================================
--- tests/concurrent/waituntil/.expect/channels.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/.expect/channels.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,6 @@
+start
+terminating churner
+waiting for empty channels
+sending sentinels
+joining servers
+done
Index: tests/concurrent/waituntil/.expect/futures.txt
===================================================================
--- tests/concurrent/waituntil/.expect/futures.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/.expect/futures.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,2 @@
+start
+end
Index: tests/concurrent/waituntil/.expect/locks.txt
===================================================================
--- tests/concurrent/waituntil/.expect/locks.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/.expect/locks.txt	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,6 @@
+start
+DONE
+DONE
+DONE
+start recursive acq test
+done
Index: tests/concurrent/waituntil/basic_else.cfa
===================================================================
--- tests/concurrent/waituntil/basic_else.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/basic_else.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,17 @@
+#include <select.hfa>
+#include <future.hfa>
+
+future(int) A, B, C;
+
+int main() {
+    waituntil( A ) { printf("A1\n"); } or else { printf("else1\n"); }
+    fulfil( A, 1 );
+    waituntil( A ) { printf("A2\n"); } or else { printf("else2\n"); }
+    reset( A );
+    waituntil( A ) { printf("A3\n"); } or when(true) else { printf("else3\n"); }
+    fulfil( A, 1 );
+    waituntil( A ) { printf("A4\n"); } or when(false) else { printf("else4\n"); }
+    reset( A );
+    fulfil( A, 1 );
+    waituntil( A ) { printf("A5\n"); }
+}
Index: tests/concurrent/waituntil/channel_close.cfa
===================================================================
--- tests/concurrent/waituntil/channel_close.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/channel_close.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,94 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+#include <time.hfa>
+
+channel(long long int) A, B;
+
+volatile long long int inserts = 0;
+volatile long long int removes = 0;
+
+thread Producer {};
+void main( Producer & this ) {
+    try {
+        for( long long int i = 0;;i++ ) {
+            waituntil( (i >> A) ) { inserts++; }
+            and waituntil( (i >> B) ) { inserts++; }
+        }
+    } catch ( channel_closed * e ) {} 
+}
+
+bool useAnd = false;
+thread Consumer {}; // ensures that the changing when states of Server1 don't result in a deadlock
+void main( Consumer & this ) {
+    long long int in, in2, A_removes = 0, B_removes = 0;
+    try {
+        for( ;; ) {
+            if ( useAnd ) {
+                waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
+                and waituntil( (in2 << B) ) { assert( B_removes == in2 ); B_removes++; removes++; }
+                continue;
+            }
+            waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
+            or waituntil( (in2 << B) ) { assert( B_removes == in2 ); B_removes++; removes++; }
+        }
+    } catchResume ( channel_closed * e ) {} // continue to remove until would block
+    catch ( channel_closed * e ) {} 
+    try {
+        for( ;; )
+            waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; }
+    } catchResume ( channel_closed * e ) {} // continue to remove until would block
+    catch ( channel_closed * e ) {} 
+    try {
+        for( ;; )
+            waituntil( (in << B) ) { assert( B_removes == in ); B_removes++; removes++; }
+    } catchResume ( channel_closed * e ) {} // continue to remove until would block
+    catch ( channel_closed * e ) {} 
+}
+
+
+size_t time = 5;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        time = atoi( argv[1] );
+
+    processor p[2];
+    A{5};
+    B{5};
+
+    printf("start OR\n");
+    {
+        Producer p;
+        Consumer c;
+        sleep(time`s);
+        printf("done sleep\n");
+        printf("closing A\n");
+        close(A);
+        printf("closing B\n");
+        close(B);
+    }
+    if ( inserts != removes ) 
+        printf("CHECKSUM MISMATCH!! Producer got: %lld, Consumer got: %lld\n", inserts, removes);
+    printf("done\n");
+    ^A{};
+    ^B{};
+
+    inserts = 0;
+    removes = 0;
+    A{5};
+    B{5};
+    printf("start AND\n");
+    {
+        Producer p;
+        Consumer c;
+        sleep(time`s);
+        printf("done sleep\n");
+        printf("closing A\n");
+        close(A);
+        printf("closing B\n");
+        close(B);
+    }
+    if ( inserts != removes ) 
+        printf("CHECKSUM MISMATCH!! Producer got: %lld, Consumer got: %lld\n", inserts, removes);
+    printf("done\n");
+}
Index: tests/concurrent/waituntil/channels.cfa
===================================================================
--- tests/concurrent/waituntil/channels.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/channels.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,86 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <channel.hfa>
+
+channel(long long int) A, B, C;
+
+volatile bool done = false;
+long long int globalTotal = 0;
+
+thread Server1 {};
+void main( Server1 & this ) {
+    long long int a, b, c, i = 0, myTotal = 0;
+    for( ;;i++ ) {
+        when( i % 2 == 0 ) waituntil( (a << A) ) { myTotal += a; }
+        or when( i % 4 < 2 ) waituntil( (b << B) ) { myTotal += b; }
+        or waituntil( (c << C) ) { if ( c == -1 ) break; myTotal += c; }
+        or when( i % 8 < 4 ) else {}
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+thread Drainer {}; // ensures that the changing when states of Server1 don't result in a deadlock
+void main( Drainer & this ) {
+    long long int a, b, c, i = 0, myTotal = 0;
+    for( ;;i++ ) {
+        waituntil( (a << A) ) { myTotal += a; }
+        or waituntil( (b << B) ) { myTotal += b; }
+        or waituntil( (c << C) ) { if ( c == -1 ) break; myTotal += c; }
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+thread Churner {}; // performs non-waituntil try insert/remove operations to add churn/interference
+void main( Churner & this ) {
+    long long int out, myTotal = 0;
+    bool success;
+    while( !done ) {
+        try_insert( A, 0 );
+        try_insert( B, 0 );
+        try_insert( C, 0 );
+        [out, success] = try_remove(A);
+        if ( success ) myTotal += out;
+        [out, success] = try_remove(B);
+        if ( success ) myTotal += out;
+        [out, success] = try_remove(C);
+        if ( success ) myTotal += out;
+    }
+    __atomic_fetch_add( &globalTotal, myTotal, __ATOMIC_SEQ_CST );
+}
+
+size_t numtimes = 100000;
+size_t numServers = 3;
+int main( int argc, char * argv[] ) {
+    if ( argc == 2 )
+        numtimes = atoi( argv[1] );
+
+    processor p[numServers + 2];
+    A{5};
+    B{5};
+    C{5};
+
+    long long int total = 0;
+    printf("start\n");
+    {
+        Server1 s[numServers];
+        Drainer d;
+        {
+            Churner c;
+            for( long long int j = 0; j < numtimes; j++ ) {
+                when( j % 2 == 0 ) waituntil( (j >> A) ) { total += j; }
+                or when( j % 4 < 2 ) waituntil( (j >> B) ) { total += j; }
+                and when( j % 8 < 4 ) waituntil( (j >> C) ) { total += j; }
+            }
+            done = true;
+            printf("terminating churner\n");
+        }
+        printf("waiting for empty channels\n");
+        while( get_count(A) > 0 || get_count(B) > 0 || get_count(C) > 0 ) { Pause(); }
+        printf("sending sentinels\n");
+        for ( i; numServers + 1 ) insert( C, -1 );
+        printf("joining servers\n");
+    }
+    if ( total != globalTotal ) 
+        printf("CHECKSUM MISMATCH!! Main thread got %lld, server sum is %lld\n", total, globalTotal);
+    printf("done\n");
+}
Index: tests/concurrent/waituntil/futures.cfa
===================================================================
--- tests/concurrent/waituntil/futures.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/futures.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,61 @@
+#include <select.hfa>
+#include <future.hfa>
+#include <thread.hfa>
+
+future(int) A, B, C;
+
+semaphore s{0};
+
+thread Server1 {};
+void main( Server1 & this ) {
+    fulfil(B, 3);
+    P( s );
+    fulfil(A, 2);
+    fulfil(C, 4);
+}
+
+thread Server2 {};
+void main( Server2 & this ) {
+    fulfil(B, 6);
+    fulfil(A, 5);
+    fulfil(C, 7);
+}
+
+int main() {
+    processor proc[1];
+    printf("start\n"); // currently not working
+    {
+        Server1 s1;
+        waituntil( A ) { get(A); }
+        or waituntil( B ) { get(B); V( s ); }
+        and waituntil( C ) { get(C); }
+    }
+    reset(A);
+    reset(B);
+    reset(C);
+    for ( int i = 0; i < 8; i++ ) {
+        {
+            Server2 s2;
+            when( i % 2 == 0 ) waituntil( A ) { get(A); }
+            or when( i % 4 < 2 ) waituntil( B ) { get(B); }
+            and when( i < 4 ) waituntil( C ) { get(C); }
+        }
+        reset(A);
+        reset(B);
+        reset(C);
+        {
+            Server2 s2;
+            (
+                when( i % 2 == 0 ) waituntil( A ) { get(A); }
+                or when( i % 4 < 2 ) waituntil( B ) { get(B); }
+            )
+            and when( i < 4 ) waituntil( C ) { get(C); }
+        }
+        reset(A);
+        reset(B);
+        reset(C);
+    }
+
+    printf("end\n");
+    return 0;
+}
Index: tests/concurrent/waituntil/locks.cfa
===================================================================
--- tests/concurrent/waituntil/locks.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
+++ tests/concurrent/waituntil/locks.cfa	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
@@ -0,0 +1,73 @@
+#include <select.hfa>
+#include <thread.hfa>
+#include <locks.hfa>
+#include <mutex_stmt.hfa>
+
+multiple_acquisition_lock A;
+simple_owner_lock B;
+simple_owner_lock C;
+
+volatile bool done = false;
+
+thread Server1 {};
+void main( Server1 & this ) {
+    while( !done ) {
+        lock(A);
+        unlock(A);
+        lock(B);
+        unlock(B);
+        lock(C);
+        unlock(C);
+        mutex(A,B,C) {};
+    }
+    mutex(sout) sout | "DONE";
+}
+
+size_t numtimes = 10000;
+int main() {
+    processor p[3];
+    int a = 0, b = 0, c = 0;
+    printf("start\n");
+    {
+        Server1 s[3];
+        for( j; numtimes ) {
+            for ( int i = 0; i < 8; i++ ) {
+
+                when( i % 2 == 0 ) waituntil( A ) { a++; }
+                or when( i % 4 < 2 ) waituntil( B ) { b++; }
+                and when( i < 4 ) waituntil( C ) { c++; }
+
+                (
+                    when( i % 2 == 0 ) waituntil( A ) { a++; }
+                    or when( i % 4 < 2 ) waituntil( B ) { b++; }
+                )
+                and when( i < 4 ) waituntil( C ) { c++; }
+                
+                when( i % 2 == 0 ) waituntil( A ) { a++; }
+                and when( i % 4 < 2 ) waituntil( B ) { b++; }
+                and when( i < 4 ) waituntil( C ) { c++; }
+
+                when( i % 2 == 0 ) waituntil( A ) { a++; }
+                or when( i % 4 < 2 ) waituntil( B ) { b++; }
+                or when( i < 4 ) waituntil( C ) { c++; }
+            }
+        }
+        done = true;
+    }
+    printf("start recursive acq test\n");
+    {
+        for( j; 10 ) {
+            lock( A );
+            lock( B );
+        }
+        for ( j; 10 ) {
+            waituntil( A ) { a++; } or waituntil( B ) { b++; }
+            waituntil( B ) { b++; } or waituntil( A ) { a++; }
+        }
+        for( j; 10 ) {
+            unlock( A );
+            unlock( B );
+        }
+    }
+    printf("done\n");
+}
Index: tests/zombies/gc_no_raii/bug-repro/deref.c
===================================================================
--- tests/zombies/gc_no_raii/bug-repro/deref.c	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ tests/zombies/gc_no_raii/bug-repro/deref.c	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
Index: tests/zombies/gc_no_raii/bug-repro/malloc.c
===================================================================
--- tests/zombies/gc_no_raii/bug-repro/malloc.c	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ tests/zombies/gc_no_raii/bug-repro/malloc.c	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
Index: tests/zombies/gc_no_raii/bug-repro/zero.c
===================================================================
--- tests/zombies/gc_no_raii/bug-repro/zero.c	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ tests/zombies/gc_no_raii/bug-repro/zero.c	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
Index: tests/zombies/gc_no_raii/test/operators.c
===================================================================
--- tests/zombies/gc_no_raii/test/operators.c	(revision 4daf79f5bebb1c45d59ca6a16f2c2facb6763c7d)
+++ tests/zombies/gc_no_raii/test/operators.c	(revision c083c3d051f3db3793a548d324e8e7d5aa9560d1)
