Changeset 10b5970
- Timestamp:
- Jan 7, 2025, 3:22:19 PM (9 months ago)
- Branches:
- master
- Children:
- 190a833
- Parents:
- 70670e7
- Files:
-
- 62 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/queue.hfa
r70670e7 r10b5970 33 33 } 34 34 35 T * succ( Queue(T) & q, T * n ) with( q ) {// pre: *n in *q36 35 T * succ( Queue(T) & q, T * n ) { // pre: *n in *q 36 #ifdef __CFA_DEBUG__ 37 37 if ( ! listed( n ) ) abort( "(Queue &)%p.succ( %p ) : Node is not on a list.", &q, n ); 38 #endif // __CFA_DEBUG__ 38 #else 39 (void) q; 40 #endif // __CFA_DEBUG__ 39 41 return (Next( n ) == n) ? 0p : Next( n ); 40 42 } // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *q -
libcfa/src/concurrency/mutex_stmt.hfa
r70670e7 r10b5970 30 30 forall(L & | is_lock(L)) { 31 31 static inline void * __get_mutexstmt_lock_ptr( L & this ) { return &this; } 32 static inline L __get_mutexstmt_lock_type( L & this) {}33 static inline L __get_mutexstmt_lock_type( L * this) {}32 static inline L __get_mutexstmt_lock_type( L & ) {} 33 static inline L __get_mutexstmt_lock_type( L * ) {} 34 34 } -
tests/Makefile.am
r70670e7 r10b5970 61 61 # Tests that need investigation from the CFA team about why they require lax wflags. Goal is to eliminate this list. 62 62 WFLGAS_OPT_LAX_TO_INVESTIGATE = \ 63 alloc \64 63 attributes \ 65 64 collections/atomic_mpsc \ 66 collections/multi_list \67 65 collections/queue \ 68 66 collections/sequence \ … … 78 76 concurrency/actors/static \ 79 77 concurrency/actors/types \ 80 concurrency/barrier/generation \81 concurrency/barrier/last \82 concurrency/barrier/order \83 78 concurrency/channels/big_elems \ 84 79 concurrency/channels/churn \ … … 89 84 concurrency/channels/pub_sub \ 90 85 concurrency/channels/zero_size \ 91 concurrency/cluster \92 86 concurrency/cofor \ 93 concurrency/coroutineYield \94 concurrency/examples/boundedBufferEXT \95 concurrency/examples/boundedBufferINT \96 87 concurrency/futures/multi \ 97 88 concurrency/futures/select_future \ 98 89 concurrency/futures/typed \ 99 90 concurrency/futures/wait_any \ 100 concurrency/join \101 91 concurrency/lockfree_stack \ 102 concurrency/migrate \103 concurrency/monitor \104 concurrency/multi-monitor \105 92 concurrency/mutexstmt/locks \ 106 concurrency/mutexstmt/monitors \107 93 concurrency/mutexstmt/tuple \ 108 94 concurrency/once \ 109 concurrency/preempt \110 95 concurrency/pthread/bounded_buffer \ 111 96 concurrency/pthread/pthread_attr_test \ 112 concurrency/pthread/pthread_cond_test \113 97 concurrency/pthread/pthread_demo_create_join \ 114 98 concurrency/pthread/pthread_demo_lock \ 115 99 concurrency/pthread/pthread_key_test \ 116 100 concurrency/pthread/pthread_once_test \ 117 concurrency/readyQ/leader_spin \118 concurrency/signal/block \119 concurrency/signal/disjoint \120 concurrency/signal/wait \121 concurrency/sleep \122 concurrency/suspend_then \123 101 concurrency/thread \ 124 102 concurrency/unified_locking/block_spin_lock \ … … 134 112 concurrency/unified_locking/spin_queue_lock \ 135 113 concurrency/unified_locking/timeout_lock \ 136 concurrency/waitfor/barge \137 concurrency/waitfor/statment \138 concurrency/waitfor/when \139 114 concurrency/waituntil/all_types \ 140 115 concurrency/waituntil/basic_else \ … … 147 122 concurrency/waituntil/repeat_close \ 148 123 concurrency/waituntil/timeout \ 149 configs/parsebools \150 configs/parsenums \151 124 configs/usage \ 152 coroutine/raii \153 ctrl-flow/goto \154 ctrl-flow/ifwhileCtl \155 125 ctrl-flow/labelledExit \ 156 126 ctrl-flow/loop_else \ 157 127 designations \ 158 enum \159 enum_tests/inc-dec \160 enum_tests/planet \161 enum_tests/structEnum \162 128 exceptions/cardgame \ 163 129 exceptions/defaults \ 164 130 exceptions/defaults-threads \ 165 exceptions/hotpotato \166 exceptions/hotpotato_checked \167 exceptions/pingpong_nonlocal \168 131 exceptions/polymorphic \ 169 132 exceptions/try-leave-catch \ … … 181 144 io/comp_basic \ 182 145 io/comp_fair \ 183 io/io-acquire \184 io/io-acquire2 \185 io/io-acquire-in \186 io/io-acquire-no-io \187 io/io-acquire-out \188 146 io/manipulatorsInput \ 189 147 io/manipulatorsInput-uchunk \ 190 148 io/many_read \ 191 linking/io-acquire \192 linking/mangling/anon \193 linking/mangling/lib.o \194 linking/mangling/main.o \195 linkonce \196 link-once/% \197 malloc \198 149 math \ 199 mathX \200 maybe \201 150 minmax \ 202 151 operators \ 203 poly-d-cycle \204 152 poly-many-arsz \ 205 poly-member \206 153 polymorphism \ 207 154 poly-o-cycle \ 208 PRNG \209 quotedKeyword \210 155 raii/boxed-types \ 211 156 raii/ctor-autogen \ 212 157 raii/dtor-early-exit \ 213 158 raii/init_once \ 214 raii/partial \215 159 references \ 216 result \217 160 shortCircuit \ 218 sizeof \219 161 smart-pointers \ 220 162 sum \ 221 163 switch \ 222 tuple/tupleAssign \223 164 tuple/tupleCast \ 224 165 tuple/tupleMember \ 225 tuple/tuplePolymorphism \226 tuple/tupleVariadic \227 typeof \228 166 userLiterals \ 229 167 vector -
tests/PRNG.cfa
r70670e7 r10b5970 86 86 87 87 thread T3 {}; 88 void main( T3 & th) {88 void main( T3 & ) { 89 89 size_t * buckets = calloc( BUCKETS ); // too big for task stack 90 90 for ( TRIALS / 5 ) { -
tests/alloc.cfa
r70670e7 r10b5970 21 21 #include <stdlib.hfa> // access C malloc, realloc 22 22 23 int * foo( int * p, int c) { return p; }24 int * bar( int * p, int c) { return p; }25 int * baz( int * p, int c) { return p; }23 int * foo( int * p, int ) { return p; } 24 int * bar( int * p, int ) { return p; } 25 int * baz( int * p, int ) { return p; } 26 26 27 27 int main( void ) { … … 217 217 const_count++; 218 218 } 219 void ^?{}( Struct & a) { dest_count++; } // destruct219 void ^?{}( Struct & ) { dest_count++; } // destruct 220 220 Struct st, st1, sta[dim], sta1[dim], * stp, * stp1; 221 221 -
tests/concurrency/channels/ping_pong.cfa
r70670e7 r10b5970 16 16 17 17 thread Pong {}; 18 void main(Pong & this) {18 void main(Pong &) { 19 19 try { 20 20 for ( ;; ) { … … 27 27 28 28 thread Ping {}; 29 void main(Ping & this) {29 void main(Ping &) { 30 30 try { 31 31 for ( ;; ) { … … 39 39 40 40 41 int main( int argc, char * argv[]) {41 int main() { 42 42 sout | "start"; 43 43 processor proc[1]; -
tests/concurrency/cluster.cfa
r70670e7 r10b5970 9 9 } 10 10 11 void main( MyThread & this) {11 void main( MyThread & ) { 12 12 for(50) { 13 13 yield(); -
tests/concurrency/coroutineYield.cfa
r70670e7 r10b5970 24 24 coroutine Coroutine {}; 25 25 26 void main( Coroutine& this) {26 void main( Coroutine & ) { 27 27 while(true) { 28 28 #if !defined(TEST_FOREVER) … … 39 39 40 40 Coroutine c; 41 int main( int argc, char* argv[]) {41 int main() { 42 42 for(int i = 0; TEST(i < N); i++) { 43 43 #if !defined(TEST_FOREVER) -
tests/concurrency/examples/boundedBufferEXT.cfa
r70670e7 r10b5970 94 94 Buffer(int) buffer; 95 95 int sums[Cons]; 96 int i;97 96 processor p; 98 97 -
tests/concurrency/examples/boundedBufferINT.cfa
r70670e7 r10b5970 94 94 Consumer * cons[Cons]; 95 95 int sums[Cons]; 96 int i;97 96 processor p; 98 97 -
tests/concurrency/futures/wait_any.cfa
r70670e7 r10b5970 32 32 33 33 thread Waiter {}; 34 void main( Waiter & this) {34 void main( Waiter & ) { 35 35 for (numtimes) { 36 36 wait_any(futures, num_futures); … … 42 42 43 43 thread Deliverer {}; 44 void main( Deliverer & this) {44 void main( Deliverer & ) { 45 45 while (!done) { 46 46 size_t num_satisfy = random(1,num_futures); -
tests/concurrency/join.cfa
r70670e7 r10b5970 28 28 29 29 30 int main( int argc, char* argv[]) {30 int main() { 31 31 { 32 32 Worker workers[17]; -
tests/concurrency/migrate.cfa
r70670e7 r10b5970 47 47 } 48 48 49 struct cluster_wrapper * curr = (struct cluster_wrapper *)&the_clusters[0];50 51 49 for(100) { 52 50 unsigned idx = prng( this, cluster_cnt ); -
tests/concurrency/monitor.cfa
r70670e7 r10b5970 28 28 thread MyThread {}; 29 29 30 void main( MyThread & this) {30 void main( MyThread & ) { 31 31 for(int i = 0; i < 750_000; i++) { 32 32 increment( global ); … … 34 34 } 35 35 36 int main( int argc, char* argv[]) {36 int main() { 37 37 assert( global.__mon.entry_queue.tail != NULL ); 38 38 processor p; -
tests/concurrency/multi-monitor.cfa
r70670e7 r10b5970 44 44 } 45 45 46 int main( int argc, char* argv[]) {46 int main() { 47 47 processor p; 48 48 { -
tests/concurrency/mutexstmt/locks.cfa
r70670e7 r10b5970 12 12 int count = 0; 13 13 14 void main( T_Mutex & this) {14 void main( T_Mutex & ) { 15 15 for (unsigned int i = 0; i < num_times; i++) { 16 16 mutex ( m1 ) count++; … … 35 35 thread T_Multi {}; 36 36 37 void main( T_Multi & this) {37 void main( T_Multi & ) { 38 38 for (unsigned int i = 0; i < num_times; i++) { 39 39 refTest( m1 ); … … 81 81 thread T_Multi_Poly {}; 82 82 83 void main( T_Multi_Poly & this) {83 void main( T_Multi_Poly & ) { 84 84 for (unsigned int i = 0; i < num_times; i++) { 85 85 refTest( l1 ); -
tests/concurrency/mutexstmt/monitors.cfa
r70670e7 r10b5970 16 16 bool startFlag = false; 17 17 18 void main( T_Mutex & this) {18 void main( T_Mutex & ) { 19 19 for (unsigned int i = 0; i < num_times; i++) { 20 20 mutex ( m1 ) count++; … … 30 30 thread T_Multi {}; 31 31 32 void main( T_Multi & this) {32 void main( T_Multi & ) { 33 33 for (unsigned int i = 0; i < num_times; i++) { 34 34 mutex ( m1 ) { -
tests/concurrency/preempt.cfa
r70670e7 r10b5970 71 71 } 72 72 73 int main( int argc, char* argv[]) {73 int main() { 74 74 processor p; 75 75 globals.counter = 0; -
tests/concurrency/pthread/pthread_cond_test.cfa
r70670e7 r10b5970 9 9 pthread_cond_t cond; 10 10 11 extern "C" {12 void* S1( void* arg){11 extern "C" { 12 void* S1( void * ) { 13 13 pthread_mutex_lock(&_mutex); 14 14 for (int i = 0; i < 1000; i++) sout | "S1 done " | i; … … 19 19 } 20 20 21 void* S2( void* arg){21 void* S2( void * ) { 22 22 pthread_mutex_lock(&_mutex); 23 23 if (!done_flag) pthread_cond_wait(&cond, &_mutex); … … 30 30 31 31 32 int main(int argc, char const *argv[]) 33 { 34 /* code */ 32 int main() { 35 33 pthread_mutex_init(&_mutex, NULL); 36 34 pthread_cond_init(&cond, NULL); -
tests/concurrency/pthread/pthread_once_test.cfa
r70670e7 r10b5970 90 90 91 91 92 int main( int argc, char const *argv[])92 int main() 93 93 { 94 94 test(); -
tests/concurrency/readyQ/leader_spin.cfa
r70670e7 r10b5970 97 97 98 98 // ================================================== 99 int main( int argc, char * argv[]) {99 int main() { 100 100 lead_idx = 0; 101 101 leader = prng( lead_rng, nthreads ); -
tests/concurrency/signal/block.cfa
r70670e7 r10b5970 51 51 52 52 //------------------------------------------------------------------------------ 53 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i) {53 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned ) { 54 54 wait( cond, (uintptr_t)active_thread() ); 55 55 … … 67 67 68 68 thread Waiter {}; 69 void main( Waiter & this) {69 void main( Waiter & ) { 70 70 for( int i = 0; TEST(i < N); i++ ) { 71 71 wait_op( globalA, globalB, i ); … … 100 100 101 101 thread Signaller {}; 102 void main( Signaller & this) {102 void main( Signaller & ) { 103 103 while( !done ) { 104 104 signal_op( globalA, globalB ); … … 112 112 113 113 thread Barger {}; 114 void main( Barger & this) {114 void main( Barger & ) { 115 115 for( unsigned i = 0; !done; i++ ) { 116 116 //Choose some monitor to barge into with some irregular pattern … … 123 123 //------------------------------------------------------------------------------ 124 124 125 int main( int argc, char* argv[]) {125 int main() { 126 126 srandom( time( NULL ) ); 127 127 done = false; -
tests/concurrency/signal/disjoint.cfa
r70670e7 r10b5970 65 65 } 66 66 67 void main( Barger & this) {67 void main( Barger & ) { 68 68 while( !all_done ) { 69 69 barge( globals.data ); … … 93 93 } 94 94 95 void main( Waiter & this) {95 void main( Waiter & ) { 96 96 while( wait( globals.mut, globals.data ) ) { KICK_WATCHDOG; yield(); } 97 97 } … … 122 122 } 123 123 124 void main( Signaller & this) {124 void main( Signaller & ) { 125 125 while( !all_done ) { 126 126 logic( globals.mut ); … … 131 131 //------------------------------------------------------------------------------ 132 132 // Main loop 133 int main( int argc, char* argv[]) {133 int main() { 134 134 srandom( time( NULL ) ); 135 135 all_done = false; -
tests/concurrency/signal/wait.cfa
r70670e7 r10b5970 65 65 //---------------------------------------------------------------------------------------------------- 66 66 // Signaler 67 void main( Signaler & this) {67 void main( Signaler & ) { 68 68 69 69 while( waiter_left != 0 ) { … … 92 92 //---------------------------------------------------------------------------------------------------- 93 93 // Waiter ABC 94 void main( WaiterABC & this) {94 void main( WaiterABC & ) { 95 95 for( int i = 0; TEST(i < N); i++ ) { 96 96 wait( condABC, globalA, globalB, globalC ); … … 103 103 //---------------------------------------------------------------------------------------------------- 104 104 // Waiter AB 105 void main( WaiterAB & this) {105 void main( WaiterAB & ) { 106 106 for( int i = 0; TEST(i < N); i++ ) { 107 107 wait( condAB , globalA, globalB ); … … 114 114 //---------------------------------------------------------------------------------------------------- 115 115 // Waiter AC 116 void main( WaiterAC & this) {116 void main( WaiterAC & ) { 117 117 for( int i = 0; TEST(i < N); i++ ) { 118 118 wait( condAC , globalA, globalC ); … … 125 125 //---------------------------------------------------------------------------------------------------- 126 126 // Waiter BC 127 void main( WaiterBC & this) {127 void main( WaiterBC & ) { 128 128 for( int i = 0; TEST(i < N); i++ ) { 129 129 wait( condBC , globalB, globalC ); … … 136 136 //---------------------------------------------------------------------------------------------------- 137 137 // Main 138 int main( int argc, char* argv[]) {138 int main() { 139 139 srandom( time( NULL ) ); 140 140 waiter_left = 4; -
tests/concurrency/suspend_then.cfa
r70670e7 r10b5970 64 64 65 65 thread Thread {}; 66 void main( Thread & this) {66 void main( Thread & ) { 67 67 Coroutine * mine = 0p; 68 68 while(!done) { … … 78 78 79 79 80 int main( int argc, char* argv[]) {80 int main() { 81 81 processor p[2]; 82 82 Coroutine c; -
tests/concurrency/thread.cfa
r70670e7 r10b5970 28 28 29 29 30 int main( int argc, char* argv[]) {30 int main() { 31 31 semaphore lock = { 0 }; 32 32 sout | "User main begin"; -
tests/concurrency/unified_locking/locks.cfa
r70670e7 r10b5970 23 23 thread T_C_M_WS1 {}; 24 24 25 void main( T_C_M_WS1 & this) {25 void main( T_C_M_WS1 & ) { 26 26 for (unsigned int i = 0; i < num_times; i++) { 27 27 lock(m); … … 37 37 thread T_C_M_WB1 {}; 38 38 39 void main( T_C_M_WB1 & this) {39 void main( T_C_M_WB1 & ) { 40 40 for (unsigned int i = 0; i < num_times; i++) { 41 41 lock(m); … … 51 51 thread T_C_S_WS1 {}; 52 52 53 void main( T_C_S_WS1 & this) {53 void main( T_C_S_WS1 & ) { 54 54 for (unsigned int i = 0; i < num_times; i++) { 55 55 lock(s); … … 65 65 thread T_C_S_WB1 {}; 66 66 67 void main( T_C_S_WB1 & this) {67 void main( T_C_S_WB1 & ) { 68 68 for (unsigned int i = 0; i < num_times; i++) { 69 69 lock(s); … … 79 79 thread T_C_L_WS1 {}; 80 80 81 void main( T_C_L_WS1 & this) {81 void main( T_C_L_WS1 & ) { 82 82 for (unsigned int i = 0; i < num_times; i++) { 83 83 lock(l); … … 93 93 thread T_C_L_WB1 {}; 94 94 95 void main( T_C_L_WB1 & this) {95 void main( T_C_L_WB1 & ) { 96 96 for (unsigned int i = 0; i < num_times; i++) { 97 97 lock(l); … … 107 107 thread T_F_C_F_WS1 {}; 108 108 109 void main( T_F_C_F_WS1 & this) {109 void main( T_F_C_F_WS1 & ) { 110 110 for (unsigned int i = 0; i < num_times; i++) { 111 111 lock(f); … … 121 121 thread T_C_O_WS1 {}; 122 122 123 void main( T_C_O_WS1 & this) {123 void main( T_C_O_WS1 & ) { 124 124 for (unsigned int i = 0; i < num_times; i++) { 125 125 lock(o); … … 135 135 thread T_C_O_WB1 {}; 136 136 137 void main( T_C_O_WB1 & this) {137 void main( T_C_O_WB1 & ) { 138 138 for (unsigned int i = 0; i < num_times; i++) { 139 139 lock(o); … … 149 149 thread T_C_M_WS2 {}; 150 150 151 void main( T_C_M_WS2 & this) {151 void main( T_C_M_WS2 & ) { 152 152 for (unsigned int i = 0; i < num_times; i++) { 153 153 lock(m); … … 167 167 thread T_C_O_WS2 {}; 168 168 169 void main( T_C_O_WS2 & this) {169 void main( T_C_O_WS2 & ) { 170 170 for (unsigned int i = 0; i < num_times; i++) { 171 171 lock(o); … … 185 185 thread T_C_NLW {}; 186 186 187 void main( T_C_NLW & this) {187 void main( T_C_NLW & ) { 188 188 for (unsigned int i = 0; i < num_times; i++) { 189 189 wait(c_o); … … 193 193 thread T_C_NLS {}; 194 194 195 void main( T_C_NLS & this) {195 void main( T_C_NLS & ) { 196 196 for (unsigned int i = 0; i < num_times; i++) { 197 197 while (empty(c_o)) { } … … 202 202 thread T_C_S_WNF {}; 203 203 204 void main( T_C_S_WNF & this) {204 void main( T_C_S_WNF & ) { 205 205 for (unsigned int i = 0; i < num_times; i++) { 206 206 lock(s); … … 219 219 thread T_C_NLWD {}; 220 220 221 void main( T_C_NLWD & this) {221 void main( T_C_NLWD & ) { 222 222 done = false; 223 223 for (unsigned int i = 0; i < num_times/5; i++) { … … 230 230 thread T_C_WDS {}; 231 231 232 void main( T_C_WDS & this) {232 void main( T_C_WDS & ) { 233 233 for (unsigned int i = 0; i < num_times; i++) { 234 234 while (empty(c_s) && !done) { } … … 241 241 thread T_C_LWD {}; 242 242 243 void main( T_C_LWD & this) {243 void main( T_C_LWD & ) { 244 244 done = false; 245 245 for (unsigned int i = 0; i < num_times/5; i++) { … … 254 254 thread T_C_LWDS {}; 255 255 256 void main( T_C_LWDS & this) {256 void main( T_C_LWDS & ) { 257 257 for (unsigned int i = 0; i < num_times; i++) { 258 258 while (empty(c_s) && !done) { } -
tests/concurrency/unified_locking/pthread_locks.cfa
r70670e7 r10b5970 18 18 thread Wait_Signal_1 {}; 19 19 20 void main( Wait_Signal_1 & this) {20 void main( Wait_Signal_1 & ) { 21 21 for (unsigned int i = 0; i < num_times; i++) { 22 22 lock(l); … … 32 32 thread Wait_3_Signal_3 {}; 33 33 34 void main( Wait_3_Signal_3 & this) {34 void main( Wait_3_Signal_3 & ) { 35 35 for (unsigned int i = 0; i < num_times; i++) { 36 36 lock(l); … … 48 48 thread Rec_Lock_Wait_Signal_1 {}; 49 49 50 void main( Rec_Lock_Wait_Signal_1 & this) {50 void main( Rec_Lock_Wait_Signal_1 & ) { 51 51 for (unsigned int i = 0; i < num_times; i++) { 52 52 lock(l); … … 66 66 thread Wait_Time_Signal_1 {}; 67 67 68 void main( Wait_Time_Signal_1 & this) {68 void main( Wait_Time_Signal_1 & ) { 69 69 for (unsigned int i = 0; i < num_times; i++) { 70 70 lock(l); … … 74 74 timespec waitTime{0,1}; 75 75 bool woken = wait(c,l, t + waitTime); 76 (void) woken; 76 77 }else{ 77 78 notify_one(c); -
tests/concurrency/waitfor/barge.cfa
r70670e7 r10b5970 30 30 } 31 31 32 void ^?{} ( global_t & mutex this) {}32 void ^?{} ( global_t & mutex ) {} 33 33 34 34 global_t global; … … 40 40 41 41 thread barger_t {}; 42 void main( barger_t & this) {42 void main( barger_t & ) { 43 43 yield(); 44 44 while( barge( global ) ) { yield(random( 10 )); } … … 56 56 57 57 thread caller_t {}; 58 void main( caller_t & this) {58 void main( caller_t & ) { 59 59 while( do_call(global) ) { yield(random( 10 )); } 60 60 } … … 78 78 79 79 thread waiter_t{}; 80 void main( waiter_t & this) {80 void main( waiter_t & ) { 81 81 do_wait(global); 82 82 } -
tests/concurrency/waitfor/statment.cfa
r70670e7 r10b5970 89 89 } 90 90 91 void main( caller & this) {91 void main( caller & ) { 92 92 int index = get_index( m ); 93 93 while( !start ) yield(); … … 122 122 thread waiter{}; 123 123 124 void main( waiter & this) {124 void main( waiter & ) { 125 125 do_wait( m ); 126 126 } -
tests/concurrency/waitfor/when.cfa
r70670e7 r10b5970 39 39 40 40 thread caller_t{}; 41 void main( caller_t & this) {41 void main( caller_t & ) { 42 42 while( true ) { 43 43 rand_yield(); … … 76 76 77 77 thread arbiter_t{}; 78 void main( arbiter_t & this) {78 void main( arbiter_t & ) { 79 79 arbiter( global ); 80 80 } -
tests/concurrency/waituntil/channel_zero_size.cfa
r70670e7 r10b5970 9 9 10 10 thread Server1 {}; 11 void main( Server1 & this) {11 void main( Server1 & ) { 12 12 long long int a, b, c, i = 0, myTotal = 0; 13 13 for( ;;i++ ) { -
tests/concurrency/waituntil/one_chan.cfa
r70670e7 r10b5970 9 9 10 10 thread Server1 {}; 11 void main( Server1 & this) {11 void main( Server1 & ) { 12 12 long long int c, i = 0, myTotal = 0; 13 13 for( ;;i++ ) { -
tests/configs/parsebools.cfa
r70670e7 r10b5970 22 22 23 23 int main( int argc, char * argv[] ) { 24 check_main(argv[0]); 24 if ( argc == 0 ) abort( "Test requires a command-line argument" ); 25 check_main( argv[0] ); 25 26 26 27 bool YN = false; -
tests/configs/parsenums.cfa
r70670e7 r10b5970 35 35 36 36 int main( int argc, char * argv[]) { 37 check_main( argv[0]); 37 if ( argc == 0 ) abort( "Test requires a command-line argument" ); 38 check_main( argv[0] ); 38 39 39 40 int i = -3; -
tests/coroutine/raii.cfa
r70670e7 r10b5970 32 32 coroutine Cor {}; 33 33 34 void ?{}( Cor & this) {34 void ?{}( Cor & ) { 35 35 sout | "Coroutine Ctor"; 36 36 } 37 37 38 void main( Cor & this) {38 void main( Cor & ) { 39 39 Raii raii = { "Coroutine" }; 40 40 sout | "Before Suspend"; … … 43 43 } 44 44 45 void ^?{}( Cor & this) {45 void ^?{}( Cor & ) { 46 46 sout | "Coroutine Dtor"; 47 47 } -
tests/ctrl-flow/goto.cfa
r70670e7 r10b5970 16 16 } 17 17 18 int main( int argc, char * argv[]) {18 int main() { 19 19 sout | nlOff; 20 20 -
tests/ctrl-flow/ifwhileCtl.cfa
r70670e7 r10b5970 19 19 20 20 int main( void ) { 21 int x = 4, y = 3; 21 int x = 4, y = 3; (void) x; (void) y; 22 22 23 23 if ( int x = 1 ) { … … 42 42 43 43 if ( struct S { int i; } s = { 3 }; s.i < 4 ) { 44 S s1; 44 S s1; (void) s1; 45 45 sout | "s.i < 4 correct"; 46 46 } else { 47 S s1; 47 S s1; (void) s1; 48 48 sout | "s.i >= 4 incorrect"; 49 49 } // if … … 64 64 65 65 while ( struct S { int i; } s = { 3 }; s.i < 4 ) { 66 S s1; 66 S s1; (void) s1; 67 67 sout | "s.i < 4 correct"; 68 68 break; -
tests/enum.cfa
r70670e7 r10b5970 19 19 Pear, 20 20 Mango 21 } fruit = Mango; 22 enum Fruits f1; 23 Fruits f2; 21 } fruit = Mango; (void) fruit; 22 enum Fruits f1; (void) f1; 23 Fruits f2; (void) f2; 24 24 } 25 25 … … 41 41 42 42 //Dummy main 43 int main( int argc, char const *argv[]) {43 int main() { 44 44 printf( "done\n" ); // non-empty .expect file 45 45 } -
tests/enum_tests/inc-dec.cfa
r70670e7 r10b5970 4 4 enum() Number { One, Two, Three }; 5 5 6 int main( int argc, char * argv[]) {6 int main() { 7 7 Number a = One; 8 8 -
tests/enum_tests/planet.cfa
r70670e7 r10b5970 28 28 } 29 29 30 int main( int argc, char * argv[]) {30 int main() { 31 31 // if ( argc != 2 ) exit | "Usage: " | argv[0] | "earth-weight"; // terminate program 32 32 // double earthWeight = convert( argv[1] ); -
tests/enum_tests/structEnum.cfa
r70670e7 r10b5970 26 26 27 27 int main() { 28 PointEnum vals = second; 29 PointEnum val2; 28 PointEnum vals = second; (void) vals; 29 PointEnum val2; (void) val2; 30 30 // The failing line: assignment 31 31 // val2 = vals; -
tests/exceptions/hotpotato.cfa
r70670e7 r10b5970 129 129 intmax_t seed = 42; // random-number seed 130 130 bool playersSet = false; 131 char * nosummary = getenv( "NOSUMMARY" ); // print extra output132 131 133 132 try { -
tests/exceptions/hotpotato_checked.cfa
r70670e7 r10b5970 150 150 intmax_t seed = 42; // random-number seed 151 151 bool playersSet = false; 152 char * nosummary = getenv( "NOSUMMARY" ); // print extra output153 152 154 153 try { -
tests/io/io-acquire-no-io.cfa
r70670e7 r10b5970 55 55 // above output used as input to parallel threads 56 56 57 int a, b, c, d, e, f, g, h, i;58 57 for ( 100 ) { // expression protection 59 58 mutex(sinLock) doWork(); -
tests/link-once/main.cfa
r70670e7 r10b5970 9 9 } 10 10 11 int main( int argc, char * argv[]) {11 int main() { 12 12 printformat(example, example); 13 13 } -
tests/linking/mangling/main.cfa
r70670e7 r10b5970 12 12 a_typedefed_global.a_float = 9.0f; 13 13 14 (void) test; 15 14 16 sout | "Done!"; 15 17 } -
tests/malloc.cfa
r70670e7 r10b5970 51 51 size_t elemSize = sizeof(int); 52 52 size_t size = dim * elemSize; 53 char fill = '\xde';54 53 int * ip; 55 54 T1 * tp; -
tests/mathX.cfa
r70670e7 r10b5970 29 29 unsigned long long int ulli, ullir1, ullir2, ullir3; 30 30 31 float f;32 double d;33 long double l;34 35 31 //---------------------- Nearest Integer ---------------------- 36 32 -
tests/maybe.cfa
r70670e7 r10b5970 60 60 } 61 61 62 int main( int argc, char * argv[]) {62 int main() { 63 63 checkPredicates(); 64 64 checkGetter(); -
tests/poly-d-cycle.cfa
r70670e7 r10b5970 20 20 func_table(int) an_instance = { func }; 21 21 22 int main( int argc, char * argv[]) {22 int main() { 23 23 object(int) x = { 0p }; 24 24 an_instance.object_func( &x ); -
tests/poly-member.cfa
r70670e7 r10b5970 15 15 MonoCell thing1; 16 16 Proxy(int) & thing2 = thing1.data; 17 (void) thing2; 17 18 } 18 19 … … 20 21 PolyCell(int) thing1; 21 22 Proxy(int) & thing2 = thing1.data; 23 (void) thing2; 22 24 } 23 25 -
tests/poly-o-cycle.cfa
r70670e7 r10b5970 20 20 func_table(int) an_instance = { func }; 21 21 22 int main( int argc, char * argv[]) {22 int main() { 23 23 object(int) x = { 0p }; 24 24 an_instance.object_func( &x ); -
tests/quotedKeyword.cfa
r70670e7 r10b5970 15 15 16 16 #include <fstream.hfa> 17 18 #pragma GCC diagnostic ignored "-Wunused-variable" 17 19 18 20 static struct { -
tests/raii/partial.cfa
r70670e7 r10b5970 12 12 // Declaring your own empty ctor leaves an autogen dtor usable 13 13 struct thing1 {}; 14 void ?{}( thing1 & this) { printf( "custom ctor\n"); }14 void ?{}( thing1 & ) { printf( "custom ctor\n"); } 15 15 void test1() { 16 16 printf("test1\n"); … … 20 20 // Declaring your own empty ctor and dtor leaves an autogen copy ctor usable 21 21 struct thing2 {}; 22 void ?{}( thing2 & this) { printf( "custom ctor\n"); }23 void ^?{}( thing2 & this) { printf( "custom dtor\n"); }22 void ?{}( thing2 & ) { printf( "custom ctor\n"); } 23 void ^?{}( thing2 & ) { printf( "custom dtor\n"); } 24 24 void test2() { 25 25 printf("test2\n"); … … 37 37 38 38 struct thing456 {}; 39 void ?{}( thing456 & this) { printf( "custom ctor\n"); }39 void ?{}( thing456 & ) { printf( "custom ctor\n"); } 40 40 void ?{}( thing456 &, thing456 ) = void; 41 41 thing456 & ?=?( thing456 &, thing456 ) = void; 42 void ^?{}( thing456 & this) { printf( "custom dtor\n"); }42 void ^?{}( thing456 & ) { printf( "custom dtor\n"); } 43 43 44 44 struct wrapper1 { thing456 x; }; … … 80 80 // Declaring your own empty ctor leaves an autogen dtor usable 81 81 struct thing1 {}; 82 void ?{}( thing1 & this) { printf( "custom ctor\n"); }82 void ?{}( thing1 & ) { printf( "custom ctor\n"); } 83 83 void test1() { 84 84 printf("test1\n"); … … 88 88 // Declaring your own empty ctor and dtor leaves an autogen copy ctor usable 89 89 struct thing2 {}; 90 void ?{}( thing2 & this) { printf( "custom ctor\n"); }91 void ^?{}( thing2 & this) { printf( "custom dtor\n"); }90 void ?{}( thing2 & ) { printf( "custom ctor\n"); } 91 void ^?{}( thing2 & ) { printf( "custom dtor\n"); } 92 92 void test2() { 93 93 printf("test2\n"); … … 105 105 106 106 struct thing456 {}; 107 void ?{}( thing456 & this) { printf( "custom ctor\n"); }107 void ?{}( thing456 & ) { printf( "custom ctor\n"); } 108 108 void ?{}( thing456 &, thing456 ) = void; 109 109 thing456 & ?=?( thing456 &, thing456 ) = void; 110 void ^?{}( thing456 & this) { printf( "custom dtor\n"); }110 void ^?{}( thing456 & ) { printf( "custom dtor\n"); } 111 111 112 112 struct wrapper1 { thing456 x; }; -
tests/result.cfa
r70670e7 r10b5970 61 61 } 62 62 63 int main( int argc, char * argv[]) {63 int main() { 64 64 checkPredicates(); 65 65 //checkNamedConstructors(); -
tests/sizeof.cfa
r70670e7 r10b5970 3 3 #include <fstream.hfa> 4 4 5 int main( int argc, char * argv[]) {5 int main() { 6 6 char val = 'c'; 7 7 char & ref = val; … … 9 9 sout | "char : " | sizeof(val) | alignof(val); 10 10 sout | "char &: " | sizeof(ref) | alignof(ref); 11 12 // FIX ME: work around Trac #300 13 (void) val; 14 (void) ref; 11 15 } -
tests/smart-pointers.cfa
r70670e7 r10b5970 65 65 } 66 66 67 int main( int argc, char * argv[]) {67 int main() { 68 68 counter_test(); 69 69 unique_test(); -
tests/tuple/tupleAssign.cfa
r70670e7 r10b5970 48 48 int z; 49 49 } x; 50 X ?=?(X & x, double d) { return x; }50 X ?=?(X & x, double) { return x; } 51 51 [int, double, int] t; 52 52 -
tests/tuple/tuplePolymorphism.cfa
r70670e7 r10b5970 66 66 forall(T) 67 67 [T, T] foo([T, T] y) { 68 (void) y; 68 69 [T, T] x; 69 70 return x; -
tests/tuple/tupleVariadic.cfa
r70670e7 r10b5970 98 98 } 99 99 100 forall(T... | { void foo(T); }) void bar( T x) {}100 forall(T... | { void foo(T); }) void bar( T ) {} 101 101 void foo(int) {} 102 102 … … 126 126 { 127 127 // T = [const int] -- this ensures that void(*)(int) satisfies void(*)(const int) 128 const int x ;128 const int x = 42; 129 129 bar(x); 130 130 } -
tests/typeof.cfa
r70670e7 r10b5970 10 10 (typeof(v1)) v2; // cast with typeof 11 11 printf( "done\n" ); // non-empty .expect file 12 13 // FIX ME: work around Trac #300 14 (void) v1; 15 (void) v3; 16 (void) v4; 17 (void) v5; 18 (void) v6; 19 (void) v7; 20 (void) v8; 12 21 }
Note:
See TracChangeset
for help on using the changeset viewer.