- Timestamp:
- Jun 27, 2018, 3:28:41 PM (8 years ago)
- Branches:
- new-env, with_gc
- Children:
- b21c77a
- Parents:
- 0182bfa (diff), 63238a4 (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:
- src/tests
- Files:
-
- 4 added
- 4 deleted
- 22 edited
- 1 moved
-
.expect/ifcond.txt (deleted)
-
.expect/ifwhileCtl.txt (added)
-
.expect/literals.txt (added)
-
.expect/literals.x64.txt (deleted)
-
.expect/literals.x86.txt (deleted)
-
.gitignore (modified) (1 diff)
-
Makefile.am (modified) (3 diffs)
-
Makefile.in (modified) (2 diffs)
-
builtins/sync.c (modified) (33 diffs)
-
concurrent/coroutineYield.c (modified) (4 diffs)
-
concurrent/examples/datingService.c (modified) (4 diffs)
-
concurrent/preempt.c (modified) (4 diffs)
-
concurrent/signal/barge.c (deleted)
-
concurrent/signal/block.c (modified) (4 diffs)
-
concurrent/signal/disjoint.c (modified) (7 diffs)
-
concurrent/signal/wait.c (modified) (6 diffs)
-
ifwhileCtl.c (moved) (moved from src/tests/ifcond.c ) (2 diffs)
-
long_tests.h (added)
-
preempt_longrun/Makefile.am (modified) (3 diffs)
-
preempt_longrun/Makefile.in (modified) (4 diffs)
-
preempt_longrun/create.c (modified) (2 diffs)
-
preempt_longrun/enter.c (modified) (3 diffs)
-
preempt_longrun/enter3.c (modified) (2 diffs)
-
preempt_longrun/processor.c (modified) (3 diffs)
-
preempt_longrun/stack.c (modified) (2 diffs)
-
preempt_longrun/update-type (added)
-
preempt_longrun/yield.c (modified) (3 diffs)
-
pybin/tools.py (modified) (2 diffs)
-
raii/.expect/ctor-autogen-ERR1.txt (modified) (1 diff)
-
sum.c (modified) (4 diffs)
-
test.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.gitignore
r0182bfa r28f3a19 1 1 .out/ 2 2 .err/ 3 .type -
src/tests/Makefile.am
r0182bfa r28f3a19 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Nov 27 21:34:33 201714 ## Update Count : 4 813 ## Last Modified On : Wed Jun 6 16:42:20 2018 14 ## Update Count : 49 15 15 ############################################################################### 16 16 … … 28 28 DEBUG_FLAGS = 29 29 30 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ 30 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -I. 31 31 if !BUILD_DEBUG 32 32 BUILD_FLAGS += -nodebug … … 92 92 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 93 93 94 literals : literals.c @CFA_BINDIR@/@CFA_NAME@95 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}96 97 94 sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@ 98 95 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} -
src/tests/Makefile.in
r0182bfa r28f3a19 309 309 # applies to both programs 310 310 DEBUG_FLAGS = 311 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ \311 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -I. \ 312 312 $(am__append_1) $(am__append_2) $(am__append_3) 313 313 TEST_FLAGS = $(if $(test), 2> $(test), ) … … 769 769 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 770 770 771 literals : literals.c @CFA_BINDIR@/@CFA_NAME@772 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}773 774 771 sched-ext-parse : sched-ext-parse.c @CFA_BINDIR@/@CFA_NAME@ 775 772 ${CC} ${AM_CFLAGS} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} -
src/tests/builtins/sync.c
r0182bfa r28f3a19 8 8 volatile int * vp4 = 0; int * rp4 = 0; int v4 = 0; 9 9 volatile long long int * vp8 = 0; long long int * rp8 = 0; long long int v8 = 0; 10 #if defined(__SIZEOF_INT128__) 10 11 volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0; 12 #endif 11 13 12 14 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 18 20 { long long int ret; ret = __sync_fetch_and_add(vp8, v8); } 19 21 { long long int ret; ret = __sync_fetch_and_add_8(vp8, v8); } 22 #if defined(__SIZEOF_INT128__) 20 23 { __int128 ret; ret = __sync_fetch_and_add(vp16, v16); } 21 24 { __int128 ret; ret = __sync_fetch_and_add_16(vp16, v16); } 25 #endif 22 26 23 27 { char ret; ret = __sync_fetch_and_sub(vp1, v1); } … … 29 33 { long long int ret; ret = __sync_fetch_and_sub(vp8, v8); } 30 34 { long long int ret; ret = __sync_fetch_and_sub_8(vp8, v8); } 35 #if defined(__SIZEOF_INT128__) 31 36 { __int128 ret; ret = __sync_fetch_and_sub(vp16, v16); } 32 37 { __int128 ret; ret = __sync_fetch_and_sub_16(vp16, v16); } 38 #endif 33 39 34 40 { char ret; ret = __sync_fetch_and_or(vp1, v1); } … … 40 46 { long long int ret; ret = __sync_fetch_and_or(vp8, v8); } 41 47 { long long int ret; ret = __sync_fetch_and_or_8(vp8, v8); } 48 #if defined(__SIZEOF_INT128__) 42 49 { __int128 ret; ret = __sync_fetch_and_or(vp16, v16); } 43 50 { __int128 ret; ret = __sync_fetch_and_or_16(vp16, v16); } 51 #endif 44 52 45 53 { char ret; ret = __sync_fetch_and_and(vp1, v1); } … … 51 59 { long long int ret; ret = __sync_fetch_and_and(vp8, v8); } 52 60 { long long int ret; ret = __sync_fetch_and_and_8(vp8, v8); } 61 #if defined(__SIZEOF_INT128__) 53 62 { __int128 ret; ret = __sync_fetch_and_and(vp16, v16); } 54 63 { __int128 ret; ret = __sync_fetch_and_and_16(vp16, v16); } 64 #endif 55 65 56 66 { char ret; ret = __sync_fetch_and_xor(vp1, v1); } … … 62 72 { long long int ret; ret = __sync_fetch_and_xor(vp8, v8); } 63 73 { long long int ret; ret = __sync_fetch_and_xor_8(vp8, v8); } 74 #if defined(__SIZEOF_INT128__) 64 75 { __int128 ret; ret = __sync_fetch_and_xor(vp16, v16); } 65 76 { __int128 ret; ret = __sync_fetch_and_xor_16(vp16, v16); } 77 #endif 66 78 67 79 { char ret; ret = __sync_fetch_and_nand(vp1, v1); } … … 73 85 { long long int ret; ret = __sync_fetch_and_nand(vp8, v8); } 74 86 { long long int ret; ret = __sync_fetch_and_nand_8(vp8, v8); } 87 #if defined(__SIZEOF_INT128__) 75 88 { __int128 ret; ret = __sync_fetch_and_nand(vp16, v16); } 76 89 { __int128 ret; ret = __sync_fetch_and_nand_16(vp16, v16); } 90 #endif 77 91 78 92 { char ret; ret = __sync_add_and_fetch(vp1, v1); } … … 84 98 { long long int ret; ret = __sync_add_and_fetch(vp8, v8); } 85 99 { long long int ret; ret = __sync_add_and_fetch_8(vp8, v8); } 100 #if defined(__SIZEOF_INT128__) 86 101 { __int128 ret; ret = __sync_add_and_fetch(vp16, v16); } 87 102 { __int128 ret; ret = __sync_add_and_fetch_16(vp16, v16); } 103 #endif 88 104 89 105 { char ret; ret = __sync_sub_and_fetch(vp1, v1); } … … 95 111 { long long int ret; ret = __sync_sub_and_fetch(vp8, v8); } 96 112 { long long int ret; ret = __sync_sub_and_fetch_8(vp8, v8); } 113 #if defined(__SIZEOF_INT128__) 97 114 { __int128 ret; ret = __sync_sub_and_fetch(vp16, v16); } 98 115 { __int128 ret; ret = __sync_sub_and_fetch_16(vp16, v16); } 116 #endif 99 117 100 118 { char ret; ret = __sync_or_and_fetch(vp1, v1); } … … 106 124 { long long int ret; ret = __sync_or_and_fetch(vp8, v8); } 107 125 { long long int ret; ret = __sync_or_and_fetch_8(vp8, v8); } 126 #if defined(__SIZEOF_INT128__) 108 127 { __int128 ret; ret = __sync_or_and_fetch(vp16, v16); } 109 128 { __int128 ret; ret = __sync_or_and_fetch_16(vp16, v16); } 129 #endif 110 130 111 131 { char ret; ret = __sync_and_and_fetch(vp1, v1); } … … 117 137 { long long int ret; ret = __sync_and_and_fetch(vp8, v8); } 118 138 { long long int ret; ret = __sync_and_and_fetch_8(vp8, v8); } 139 #if defined(__SIZEOF_INT128__) 119 140 { __int128 ret; ret = __sync_and_and_fetch(vp16, v16); } 120 141 { __int128 ret; ret = __sync_and_and_fetch_16(vp16, v16); } 142 #endif 121 143 122 144 { char ret; ret = __sync_xor_and_fetch(vp1, v1); } … … 128 150 { long long int ret; ret = __sync_xor_and_fetch(vp8, v8); } 129 151 { long long int ret; ret = __sync_xor_and_fetch_8(vp8, v8); } 152 #if defined(__SIZEOF_INT128__) 130 153 { __int128 ret; ret = __sync_xor_and_fetch(vp16, v16); } 131 154 { __int128 ret; ret = __sync_xor_and_fetch_16(vp16, v16); } 155 #endif 132 156 133 157 { char ret; ret = __sync_nand_and_fetch(vp1, v1); } … … 139 163 { long long int ret; ret = __sync_nand_and_fetch(vp8, v8); } 140 164 { long long int ret; ret = __sync_nand_and_fetch_8(vp8, v8); } 165 #if defined(__SIZEOF_INT128__) 141 166 { __int128 ret; ret = __sync_nand_and_fetch(vp16, v16); } 142 167 { __int128 ret; ret = __sync_nand_and_fetch_16(vp16, v16); } 168 #endif 143 169 144 170 { _Bool ret; ret = __sync_bool_compare_and_swap(vp1, v1, v1); } … … 150 176 { _Bool ret; ret = __sync_bool_compare_and_swap(vp8, v8, v8); } 151 177 { _Bool ret; ret = __sync_bool_compare_and_swap_8(vp8, v8, v8); } 178 #if defined(__SIZEOF_INT128__) 152 179 { _Bool ret; ret = __sync_bool_compare_and_swap(vp16, v16, v16); } 153 180 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 181 #endif 154 182 155 183 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 161 189 { long long int ret; ret = __sync_val_compare_and_swap(vp8, v8, v8); } 162 190 { long long int ret; ret = __sync_val_compare_and_swap_8(vp8, v8, v8); } 191 #if defined(__SIZEOF_INT128__) 163 192 { __int128 ret; ret = __sync_val_compare_and_swap(vp16, v16, v16); } 164 193 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 194 #endif 165 195 166 196 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 172 202 { long long int ret; ret = __sync_lock_test_and_set(vp8, v8); } 173 203 { long long int ret; ret = __sync_lock_test_and_set_8(vp8, v8); } 204 #if defined(__SIZEOF_INT128__) 174 205 { __int128 ret; ret = __sync_lock_test_and_set(vp16, v16); } 175 206 { __int128 ret; ret = __sync_lock_test_and_set_16(vp16, v16); } 207 #endif 176 208 177 209 { __sync_lock_release(vp1); } … … 183 215 { __sync_lock_release(vp8); } 184 216 { __sync_lock_release_8(vp8); } 217 #if defined(__SIZEOF_INT128__) 185 218 { __sync_lock_release(vp16); } 186 219 { __sync_lock_release_16(vp16); } 220 #endif 187 221 188 222 { __sync_synchronize(); } … … 208 242 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 209 243 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 244 #if defined(__SIZEOF_INT128__) 210 245 { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); } 211 246 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 212 247 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 248 #endif 213 249 214 250 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 224 260 { long long int ret; ret = __atomic_load_8(vp8, __ATOMIC_SEQ_CST); } 225 261 { long long int ret; __atomic_load(vp8, &ret, __ATOMIC_SEQ_CST); } 262 #if defined(__SIZEOF_INT128__) 226 263 { __int128 ret; ret = __atomic_load_n(vp16, __ATOMIC_SEQ_CST); } 227 264 { __int128 ret; ret = __atomic_load_16(vp16, __ATOMIC_SEQ_CST); } 228 265 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 266 #endif 229 267 230 268 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 240 278 { _Bool ret; ret = __atomic_compare_exchange_8(vp8, rp8, v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 241 279 { _Bool ret; ret = __atomic_compare_exchange(vp8, rp8, &v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 280 #if defined(__SIZEOF_INT128__) 242 281 { _Bool ret; ret = __atomic_compare_exchange_n(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 243 282 { _Bool ret; ret = __atomic_compare_exchange_16(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 244 283 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 284 #endif 245 285 246 286 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 256 296 { __atomic_store_8(vp8, v8, __ATOMIC_SEQ_CST); } 257 297 { __atomic_store(vp8, &v8, __ATOMIC_SEQ_CST); } 298 #if defined(__SIZEOF_INT128__) 258 299 { __atomic_store_n(vp16, v16, __ATOMIC_SEQ_CST); } 259 300 { __atomic_store_16(vp16, v16, __ATOMIC_SEQ_CST); } 260 301 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 302 #endif 261 303 262 304 { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 268 310 { long long int ret; ret = __atomic_add_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 269 311 { long long int ret; ret = __atomic_add_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 312 #if defined(__SIZEOF_INT128__) 270 313 { __int128 ret; ret = __atomic_add_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 271 314 { __int128 ret; ret = __atomic_add_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 315 #endif 272 316 273 317 { char ret; ret = __atomic_sub_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 279 323 { long long int ret; ret = __atomic_sub_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 280 324 { long long int ret; ret = __atomic_sub_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 325 #if defined(__SIZEOF_INT128__) 281 326 { __int128 ret; ret = __atomic_sub_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 282 327 { __int128 ret; ret = __atomic_sub_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 328 #endif 283 329 284 330 { char ret; ret = __atomic_and_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 290 336 { long long int ret; ret = __atomic_and_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 291 337 { long long int ret; ret = __atomic_and_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 338 #if defined(__SIZEOF_INT128__) 292 339 { __int128 ret; ret = __atomic_and_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 293 340 { __int128 ret; ret = __atomic_and_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 341 #endif 294 342 295 343 { char ret; ret = __atomic_nand_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 301 349 { long long int ret; ret = __atomic_nand_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 302 350 { long long int ret; ret = __atomic_nand_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 351 #if defined(__SIZEOF_INT128__) 303 352 { __int128 ret; ret = __atomic_nand_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 304 353 { __int128 ret; ret = __atomic_nand_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 354 #endif 305 355 306 356 { char ret; ret = __atomic_xor_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 312 362 { long long int ret; ret = __atomic_xor_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 313 363 { long long int ret; ret = __atomic_xor_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 364 #if defined(__SIZEOF_INT128__) 314 365 { __int128 ret; ret = __atomic_xor_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 315 366 { __int128 ret; ret = __atomic_xor_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 367 #endif 316 368 317 369 { char ret; ret = __atomic_or_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 323 375 { long long int ret; ret = __atomic_or_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 324 376 { long long int ret; ret = __atomic_or_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 377 #if defined(__SIZEOF_INT128__) 325 378 { __int128 ret; ret = __atomic_or_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 326 379 { __int128 ret; ret = __atomic_or_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 380 #endif 327 381 328 382 { char ret; ret = __atomic_fetch_add(vp1, v1, __ATOMIC_SEQ_CST); } … … 334 388 { long long int ret; ret = __atomic_fetch_add(vp8, v8, __ATOMIC_SEQ_CST); } 335 389 { long long int ret; ret = __atomic_fetch_add_8(vp8, v8, __ATOMIC_SEQ_CST); } 390 #if defined(__SIZEOF_INT128__) 336 391 { __int128 ret; ret = __atomic_fetch_add(vp16, v16, __ATOMIC_SEQ_CST); } 337 392 { __int128 ret; ret = __atomic_fetch_add_16(vp16, v16, __ATOMIC_SEQ_CST); } 393 #endif 338 394 339 395 { char ret; ret = __atomic_fetch_sub(vp1, v1, __ATOMIC_SEQ_CST); } … … 345 401 { long long int ret; ret = __atomic_fetch_sub(vp8, v8, __ATOMIC_SEQ_CST); } 346 402 { long long int ret; ret = __atomic_fetch_sub_8(vp8, v8, __ATOMIC_SEQ_CST); } 403 #if defined(__SIZEOF_INT128__) 347 404 { __int128 ret; ret = __atomic_fetch_sub(vp16, v16, __ATOMIC_SEQ_CST); } 348 405 { __int128 ret; ret = __atomic_fetch_sub_16(vp16, v16, __ATOMIC_SEQ_CST); } 406 #endif 349 407 350 408 { char ret; ret = __atomic_fetch_and(vp1, v1, __ATOMIC_SEQ_CST); } … … 356 414 { long long int ret; ret = __atomic_fetch_and(vp8, v8, __ATOMIC_SEQ_CST); } 357 415 { long long int ret; ret = __atomic_fetch_and_8(vp8, v8, __ATOMIC_SEQ_CST); } 416 #if defined(__SIZEOF_INT128__) 358 417 { __int128 ret; ret = __atomic_fetch_and(vp16, v16, __ATOMIC_SEQ_CST); } 359 418 { __int128 ret; ret = __atomic_fetch_and_16(vp16, v16, __ATOMIC_SEQ_CST); } 419 #endif 360 420 361 421 { char ret; ret = __atomic_fetch_nand(vp1, v1, __ATOMIC_SEQ_CST); } … … 367 427 { long long int ret; ret = __atomic_fetch_nand(vp8, v8, __ATOMIC_SEQ_CST); } 368 428 { long long int ret; ret = __atomic_fetch_nand_8(vp8, v8, __ATOMIC_SEQ_CST); } 429 #if defined(__SIZEOF_INT128__) 369 430 { __int128 ret; ret = __atomic_fetch_nand(vp16, v16, __ATOMIC_SEQ_CST); } 370 431 { __int128 ret; ret = __atomic_fetch_nand_16(vp16, v16, __ATOMIC_SEQ_CST); } 432 #endif 371 433 372 434 { char ret; ret = __atomic_fetch_xor(vp1, v1, __ATOMIC_SEQ_CST); } … … 378 440 { long long int ret; ret = __atomic_fetch_xor(vp8, v8, __ATOMIC_SEQ_CST); } 379 441 { long long int ret; ret = __atomic_fetch_xor_8(vp8, v8, __ATOMIC_SEQ_CST); } 442 #if defined(__SIZEOF_INT128__) 380 443 { __int128 ret; ret = __atomic_fetch_xor(vp16, v16, __ATOMIC_SEQ_CST); } 381 444 { __int128 ret; ret = __atomic_fetch_xor_16(vp16, v16, __ATOMIC_SEQ_CST); } 445 #endif 382 446 383 447 { char ret; ret = __atomic_fetch_or(vp1, v1, __ATOMIC_SEQ_CST); } … … 389 453 { long long int ret; ret = __atomic_fetch_or(vp8, v8, __ATOMIC_SEQ_CST); } 390 454 { long long int ret; ret = __atomic_fetch_or_8(vp8, v8, __ATOMIC_SEQ_CST); } 455 #if defined(__SIZEOF_INT128__) 391 456 { __int128 ret; ret = __atomic_fetch_or(vp16, v16, __ATOMIC_SEQ_CST); } 392 457 { __int128 ret; ret = __atomic_fetch_or_16(vp16, v16, __ATOMIC_SEQ_CST); } 458 #endif 393 459 394 460 { _Bool ret; ret = __atomic_always_lock_free(sizeof(int), vp4); } -
src/tests/concurrent/coroutineYield.c
r0182bfa r28f3a19 4 4 #include <thread> 5 5 #include <time> 6 7 #define __kick_rate 150000ul 8 #include "long_tests.h" 6 9 7 10 #ifndef PREEMPTION_RATE … … 13 16 } 14 17 15 #ifdef LONG_TEST18 #ifdef TEST_LONG 16 19 static const unsigned long N = 600_000ul; 17 20 #else … … 23 26 void main(Coroutine& this) { 24 27 while(true) { 25 sout | "Coroutine 1" | endl; 28 #if !defined(TEST_FOREVER) 29 sout | "Coroutine 1" | endl; 30 #endif 26 31 yield(); 27 sout | "Coroutine 2" | endl; 32 #if !defined(TEST_FOREVER) 33 sout | "Coroutine 2" | endl; 34 #endif 28 35 suspend(); 29 36 } … … 33 40 int main(int argc, char* argv[]) { 34 41 Coroutine c; 35 for(int i = 0; i < N; i++) { 36 sout | "Thread 1" | endl; 42 for(int i = 0; TEST(i < N); i++) { 43 #if !defined(TEST_FOREVER) 44 sout | "Thread 1" | endl; 45 #endif 37 46 resume(c); 38 sout | "Thread 2" | endl; 47 #if !defined(TEST_FOREVER) 48 sout | "Thread 2" | endl; 49 #endif 39 50 yield(); 51 KICK_WATCHDOG; 40 52 } 41 53 } -
src/tests/concurrent/examples/datingService.c
r0182bfa r28f3a19 8 8 // Created On : Mon Oct 30 12:56:20 2017 9 9 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Wed Mar 14 22:48:40201811 // Update Count : 2 310 // Last Modified On : Sun May 27 09:05:18 2018 11 // Update Count : 26 12 12 // 13 13 … … 18 18 #include <unistd.h> // getpid 19 19 20 enum { NoOfPairs = 20 };20 enum { CompCodes = 20 }; // number of compatibility codes 21 21 22 22 monitor DatingService { 23 condition Girls[ NoOfPairs], Boys[NoOfPairs];23 condition Girls[CompCodes], Boys[CompCodes]; 24 24 unsigned int GirlPhoneNo, BoyPhoneNo; 25 25 }; // DatingService … … 47 47 } // DatingService boy 48 48 49 unsigned int girlck[ NoOfPairs];50 unsigned int boyck[ NoOfPairs];49 unsigned int girlck[CompCodes]; 50 unsigned int boyck[CompCodes]; 51 51 52 52 thread Girl { … … 88 88 int main() { 89 89 DatingService TheExchange; 90 Girl * girls[ NoOfPairs];91 Boy * boys[ NoOfPairs];90 Girl * girls[CompCodes]; 91 Boy * boys[CompCodes]; 92 92 93 93 srandom( /*getpid()*/ 103 ); 94 94 95 for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {95 for ( unsigned int i = 0; i < CompCodes; i += 1 ) { 96 96 girls[i] = new( &TheExchange, i, i ); 97 boys[i] = new( &TheExchange, i, NoOfPairs - ( i + 1 ) );97 boys[i] = new( &TheExchange, i, CompCodes - ( i + 1 ) ); 98 98 } // for 99 99 100 for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {100 for ( unsigned int i = 0; i < CompCodes; i += 1 ) { 101 101 delete( boys[i] ); 102 102 delete( girls[i] ); 103 103 } // for 104 104 105 for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {105 for ( unsigned int i = 0; i < CompCodes; i += 1 ) { 106 106 if ( girlck[ boyck[i] ] != boyck[ girlck[i] ] ) abort(); 107 107 } // for -
src/tests/concurrent/preempt.c
r0182bfa r28f3a19 2 2 #include <thread> 3 3 #include <time> 4 5 #include "long_tests.h" 4 6 5 7 #ifndef PREEMPTION_RATE … … 11 13 } 12 14 13 #ifdef LONG_TEST15 #ifdef TEST_LONG 14 16 static const unsigned long N = 30_000ul; 15 17 #else … … 30 32 31 33 void main(worker_t & this) { 32 while( counter < N) {34 while(TEST(counter < N)) { 33 35 __cfaabi_check_preemption(); 34 36 if( (counter % 7) == this.value ) { … … 40 42 } 41 43 __cfaabi_check_preemption(); 44 KICK_WATCHDOG; 42 45 } 43 46 } -
src/tests/concurrent/signal/block.c
r0182bfa r28f3a19 14 14 #include <time> 15 15 16 #include "long_tests.h" 17 16 18 #ifndef PREEMPTION_RATE 17 19 #define PREEMPTION_RATE 10`ms … … 22 24 } 23 25 24 #ifdef LONG_TEST26 #ifdef TEST_LONG 25 27 static const unsigned long N = 150_000ul; 26 28 #else … … 40 42 } 41 43 42 void ^?{} ( global_data_t & this ) {}44 void ^?{} ( global_data_t & mutex this ) {} 43 45 44 46 global_data_t globalA, globalB; … … 66 68 thread Waiter {}; 67 69 void main( Waiter & this ) { 68 for( int i = 0; i < N; i++ ) {70 for( int i = 0; TEST(i < N); i++ ) { 69 71 wait_op( globalA, globalB, i ); 72 KICK_WATCHDOG; 70 73 } 71 74 } -
src/tests/concurrent/signal/disjoint.c
r0182bfa r28f3a19 4 4 #include <thread> 5 5 #include <time> 6 7 #include "long_tests.h" 6 8 7 9 #ifndef PREEMPTION_RATE … … 13 15 } 14 16 15 #ifdef LONG_TEST17 #ifdef TEST_LONG 16 18 static const unsigned long N = 300_000ul; 17 19 #else … … 26 28 monitor global_data_t; 27 29 void ?{}( global_data_t & this ); 28 void ^?{} ( global_data_t & this );30 void ^?{} ( global_data_t & mutex this ); 29 31 30 32 monitor global_data_t { … … 42 44 } 43 45 44 void ^?{} ( global_data_t & this ) {}46 void ^?{} ( global_data_t & mutex this ) {} 45 47 46 48 //------------------------------------------------------------------------------ … … 67 69 } 68 70 69 d.counter++; 71 #if !defined(TEST_FOREVER) 72 d.counter++; 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 74 #endif 70 75 71 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 72 73 return d.counter < N; 76 return TEST(d.counter < N); 74 77 } 75 78 … … 77 80 78 81 void main( Waiter & this ) { 79 while( wait( mut, data ) ) { yield(); }82 while( wait( mut, data ) ) { KICK_WATCHDOG; yield(); } 80 83 } 81 84 … … 94 97 95 98 //This is technically a mutual exclusion violation but the mutex monitor protects us 96 bool running = data.counter < N&& data.counter > 0;99 bool running = TEST(data.counter < N) && data.counter > 0; 97 100 if( data.state != SIGNAL && running ) { 98 101 sout | "ERROR Eager signal" | data.state | endl; -
src/tests/concurrent/signal/wait.c
r0182bfa r28f3a19 12 12 #include <time> 13 13 14 #define __kick_rate 12000ul 15 #include "long_tests.h" 16 14 17 #ifndef PREEMPTION_RATE 15 18 #define PREEMPTION_RATE 10`ms … … 20 23 } 21 24 22 #ifdef LONG_TEST25 #ifdef TEST_LONG 23 26 static const unsigned long N = 375_000ul; 24 27 #else … … 90 93 // Waiter ABC 91 94 void main( WaiterABC & this ) { 92 for( int i = 0; i < N; i++ ) {95 for( int i = 0; TEST(i < N); i++ ) { 93 96 wait( condABC, globalA, globalB, globalC ); 97 KICK_WATCHDOG; 94 98 } 95 99 … … 100 104 // Waiter AB 101 105 void main( WaiterAB & this ) { 102 for( int i = 0; i < N; i++ ) {106 for( int i = 0; TEST(i < N); i++ ) { 103 107 wait( condAB , globalA, globalB ); 108 KICK_WATCHDOG; 104 109 } 105 110 … … 110 115 // Waiter AC 111 116 void main( WaiterAC & this ) { 112 for( int i = 0; i < N; i++ ) {117 for( int i = 0; TEST(i < N); i++ ) { 113 118 wait( condAC , globalA, globalC ); 119 KICK_WATCHDOG; 114 120 } 115 121 … … 120 126 // Waiter BC 121 127 void main( WaiterBC & this ) { 122 for( int i = 0; i < N; i++ ) {128 for( int i = 0; TEST(i < N); i++ ) { 123 129 wait( condBC , globalB, globalC ); 130 KICK_WATCHDOG; 124 131 } 125 132 -
src/tests/ifwhileCtl.c
r0182bfa r28f3a19 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // if cond.c --7 // ifwhileCtl.c -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Aug 26 10:13:11 2017 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri Sep 01 15:22:19 201713 // Update Count : 1411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 6 17:15:09 2018 13 // Update Count : 21 14 14 // 15 15 … … 40 40 sout | "x != y incorrect" | endl; 41 41 } // if 42 43 if ( struct S { int i; } s = { 3 }; s.i < 4 ) { 44 S s1; 45 sout | "s.i < 4 correct" | endl; 46 } else { 47 S s1; 48 sout | "s.i >= 4 incorrect" | endl; 49 } // if 50 51 while ( int x = 1 ) { 52 sout | "x != 0 correct" | endl; 53 break; 54 } // while 55 56 while ( int x = 4, y = 0 ) { 57 sout | "x != 0 && y != 0 incorrect" | endl; 58 } // while 59 60 while ( int x = 5, y = f( x ); x == y ) { 61 sout | "x == y correct" | endl; 62 break; 63 } // while 64 65 while ( struct S { int i; } s = { 3 }; s.i < 4 ) { 66 S s1; 67 sout | "s.i < 4 correct" | endl; 68 break; 69 } // while 42 70 } // main 43 71 44 72 // Local Variables: // 45 73 // tab-width: 4 // 46 // compile-command: "cfa if cond.c" //74 // compile-command: "cfa ifwhileCtl.c" // 47 75 // End: // -
src/tests/preempt_longrun/Makefile.am
r0182bfa r28f3a19 19 19 preempt=10ul\`ms 20 20 debug=-debug 21 type=LONG 21 22 22 23 REPEAT = ${abs_top_srcdir}/tools/repeat 24 WATCHDOG = ${abs_top_srcdir}/tools/watchdog 23 25 TIME = /usr/bin/time -f "%E" 24 26 25 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -DLONG_TEST 27 # $(shell ./update-type $(type)) 28 # ./update-type $(type) 29 30 UPDATED_TYPE = $(shell ./update-type $(type)) 31 32 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z) 26 33 CFLAGS = ${BUILD_FLAGS} 27 34 CC = @CFA_BINDIR@/@CFA_NAME@ … … 29 36 TESTS = block coroutine create disjoint enter enter3 processor stack wait yield 30 37 31 .INTERMEDIATE: ${TESTS}38 # .INTERMEDIATE: ${TESTS} 32 39 33 40 all-local: ${TESTS:=.run} 34 41 42 runall : ${TESTS:=.run} 43 @ echo "All programs terminated normally" 44 45 watchall : ${TESTS:=.watch} 46 @ echo "All programs terminated normally" 47 48 compileall : ${TESTS} 49 @ echo "Compiled" 50 35 51 clean-local: 36 rm -f ${TESTS} 52 rm -f ${TESTS} core* out.log .type 37 53 38 % : %.c ${CC} 54 % : %.c ${CC} ${UPDATED_TYPE} 39 55 ${AM_V_GEN}${CC} ${CFLAGS} ${<} $(debug) -o ${@} 40 56 41 57 %.run : % ${REPEAT} 42 58 @ time ${REPEAT} -r out.log -i -s $(repeats) timeout ${max_time} ./${<} 59 @ rm ${<} 60 @ echo -e "${<}: SUCCESS\n" 61 62 %.watch : % ${WATCHDOG} 63 @ time ${WATCHDOG} ./${<} 43 64 @ rm ${<} 44 65 @ echo -e "${<}: SUCCESS\n" … … 49 70 @ echo -e "${<}: SUCCESS\n" 50 71 51 ${REPEAT}: 72 ${REPEAT}: ${abs_top_srcdir}/tools/Makefile 52 73 @+make -C ${abs_top_srcdir}/tools/ 74 75 ${WATCHDOG}: ${abs_top_srcdir}/tools/Makefile 76 @+make -C ${abs_top_srcdir}/tools/ -
src/tests/preempt_longrun/Makefile.in
r0182bfa r28f3a19 452 452 preempt = 10ul\`ms 453 453 debug = -debug 454 type = LONG 454 455 REPEAT = ${abs_top_srcdir}/tools/repeat 456 WATCHDOG = ${abs_top_srcdir}/tools/watchdog 455 457 TIME = /usr/bin/time -f "%E" 456 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -DLONG_TEST 458 459 # $(shell ./update-type $(type)) 460 # ./update-type $(type) 461 UPDATED_TYPE = $(shell ./update-type $(type)) 462 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell cat .type | tr a-z A-Z) 457 463 TESTS = block coroutine create disjoint enter enter3 processor stack wait yield 458 464 all: all-am … … 873 879 874 880 875 .INTERMEDIATE: ${TESTS}881 # .INTERMEDIATE: ${TESTS} 876 882 877 883 all-local: ${TESTS:=.run} 878 884 885 runall : ${TESTS:=.run} 886 @ echo "All programs terminated normally" 887 888 watchall : ${TESTS:=.watch} 889 @ echo "All programs terminated normally" 890 891 compileall : ${TESTS} 892 @ echo "Compiled" 893 879 894 clean-local: 880 rm -f ${TESTS} 881 882 % : %.c ${CC} 895 rm -f ${TESTS} core* out.log .type 896 897 % : %.c ${CC} ${UPDATED_TYPE} 883 898 ${AM_V_GEN}${CC} ${CFLAGS} ${<} $(debug) -o ${@} 884 899 … … 888 903 @ echo -e "${<}: SUCCESS\n" 889 904 905 %.watch : % ${WATCHDOG} 906 @ time ${WATCHDOG} ./${<} 907 @ rm ${<} 908 @ echo -e "${<}: SUCCESS\n" 909 890 910 %.time : % ${REPEAT} 891 911 @ ${REPEAT} -i -s -- $(repeats) $(TIME) -a -o times.log ./${<} … … 893 913 @ echo -e "${<}: SUCCESS\n" 894 914 895 ${REPEAT}: 915 ${REPEAT}: ${abs_top_srcdir}/tools/Makefile 916 @+make -C ${abs_top_srcdir}/tools/ 917 918 ${WATCHDOG}: ${abs_top_srcdir}/tools/Makefile 896 919 @+make -C ${abs_top_srcdir}/tools/ 897 920 -
src/tests/preempt_longrun/create.c
r0182bfa r28f3a19 2 2 #include <thread> 3 3 #include <time> 4 5 #include "long_tests.h" 4 6 5 7 #ifndef PREEMPTION_RATE … … 19 21 int main(int argc, char* argv[]) { 20 22 processor p; 21 for(int i = 0; i < N; i++) {23 for(int i = 0; TEST(i < N); i++) { 22 24 worker_t w[7]; 25 KICK_WATCHDOG; 23 26 } 24 27 } -
src/tests/preempt_longrun/enter.c
r0182bfa r28f3a19 3 3 #include <thread> 4 4 #include <time> 5 6 #define __kick_rate 75000ul 7 #include "long_tests.h" 5 8 6 9 #ifndef PREEMPTION_RATE … … 15 18 16 19 monitor mon_t {}; 20 void foo( mon_t & mutex this ) { 21 KICK_WATCHDOG; 22 } 17 23 18 24 mon_t mon; 19 20 void foo( mon_t & mutex this ) {}21 22 25 thread worker_t {}; 23 24 26 void main( worker_t & this ) { 25 for( unsigned long i = 0; i < N; i++ ) {27 for( unsigned long i = 0; TEST(i < N); i++ ) { 26 28 foo( mon ); 27 29 } 28 }29 30 extern "C" {31 static worker_t * workers;32 30 } 33 31 … … 36 34 { 37 35 worker_t w[7]; 38 workers = w;39 36 } 40 37 } -
src/tests/preempt_longrun/enter3.c
r0182bfa r28f3a19 3 3 #include <thread> 4 4 #include <time> 5 6 #define __kick_rate 75000ul 7 #include "long_tests.h" 5 8 6 9 #ifndef PREEMPTION_RATE … … 18 21 mon_t mon1, mon2, mon3; 19 22 20 void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {} 23 void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) { 24 KICK_WATCHDOG; 25 } 21 26 22 27 thread worker_t {}; 23 28 24 29 void main( worker_t & this ) { 25 for( unsigned long i = 0; i < N; i++ ) {30 for( unsigned long i = 0; TEST(i < N); i++ ) { 26 31 foo( mon1, mon2, mon3 ); 27 32 } -
src/tests/preempt_longrun/processor.c
r0182bfa r28f3a19 2 2 #include <thread> 3 3 #include <time> 4 5 #include <unistd.h> 6 7 #include "long_tests.h" 4 8 5 9 #ifndef PREEMPTION_RATE … … 11 15 } 12 16 13 static const unsigned long N = 5 _000ul;17 static const unsigned long N = 50_000ul; 14 18 15 19 int main(int argc, char* argv[]) { … … 18 22 p[pi] = new(); 19 23 } 20 for ( int i = 0; i < N; i++) {24 for ( int i = 0; TEST(i < N); i++) { 21 25 int pi = i % 15; 22 26 delete( p[pi] ); 23 27 p[pi] = new(); 28 KICK_WATCHDOG; 29 } 30 for ( int pi = 0; pi < 15; pi++ ) { 31 delete( p[pi] ); 24 32 } 25 33 } -
src/tests/preempt_longrun/stack.c
r0182bfa r28f3a19 3 3 #include <thread> 4 4 #include <time> 5 6 #define __kick_rate 5000000ul 7 #include "long_tests.h" 5 8 6 9 #ifndef PREEMPTION_RATE … … 15 18 16 19 void main(worker_t & this) { 17 volatile long long p = 5_021_609ul; 18 volatile long long a = 326_417ul; 19 volatile long long n = 1l; 20 for (volatile long long i = 0; i < p; i++) { 21 n *= a; 22 n %= p; 23 } 20 while(TEST(0)) { 21 volatile long long p = 5_021_609ul; 22 volatile long long a = 326_417ul; 23 volatile long long n = 1l; 24 for (volatile long long i = 0; i < p; i++) { 25 n *= a; 26 n %= p; 27 KICK_WATCHDOG; 28 } 24 29 25 if( n != a ) { 26 abort(); 30 if( !TEST(n == a) ) { 31 abort(); 32 } 27 33 } 28 34 } -
src/tests/preempt_longrun/yield.c
r0182bfa r28f3a19 2 2 #include <thread> 3 3 #include <time> 4 5 #define __kick_rate 550000ul 6 #include "long_tests.h" 4 7 5 8 #ifndef PREEMPTION_RATE … … 11 14 } 12 15 13 #ifdef LONG_TEST16 #ifdef TEST_LONG 14 17 static const unsigned long N = 9_750_000ul; 15 18 #else … … 20 23 21 24 void main(worker_t & this) { 22 for(int i = 0; i < N; i++) {25 for(int i = 0; TEST(i < N); i++) { 23 26 yield(); 27 KICK_WATCHDOG; 24 28 } 25 29 } -
src/tests/pybin/tools.py
r0182bfa r28f3a19 83 83 return sh(cmd) 84 84 85 def which(program): 86 import os 87 def is_exe(fpath): 88 return os.path.isfile(fpath) and os.access(fpath, os.X_OK) 89 90 fpath, fname = os.path.split(program) 91 if fpath: 92 if is_exe(program): 93 return program 94 else: 95 for path in os.environ["PATH"].split(os.pathsep): 96 exe_file = os.path.join(path, program) 97 if is_exe(exe_file): 98 return exe_file 99 100 return None 85 101 ################################################################################ 86 102 # file handling … … 219 235 return False 220 236 237 def fancy_print(text): 238 column = which('column') 239 if column: 240 cmd = "%s 2> /dev/null" % column 241 print(cmd) 242 proc = Popen(cmd, stdin=PIPE, stderr=None, shell=True) 243 proc.communicate(input=text) 244 else: 245 print(text) 221 246 222 247 settings.set_machine_default( getMachineType ) -
src/tests/raii/.expect/ctor-autogen-ERR1.txt
r0182bfa r28f3a19 1 raii/ctor-autogen.c:102:1 error: No reasonable alternatives for expression Applying untyped:2 Name: ?{}3 ...to: 4 Cast of:5 Variable Expression: x: instance of struct Managed with body 16 ... to:7 reference to instance of struct Managed with body 18 constant expression (123 123: signed int)1 raii/ctor-autogen.c:102:1 error: Unique best alternative includes deleted identifier in Cast of: 2 Application of 3 Deleted Expression 4 Variable Expression: ?{}: static inline function 5 ... with parameters 6 _dst: reference to instance of struct Managed with body 1 7 x: signed int 8 ... returning nothing 9 9 10 ... deleted by: ?{}: function 11 ... with parameters 12 m: reference to instance of struct Managed with body 1 13 ... returning nothing 14 ... with body 15 CompoundStmt 16 Expression Statement: 17 Application of 18 Variable Expression: ?=?: function 19 ... with parameters 20 intrinsic reference to signed int 21 intrinsic signed int 22 ... returning 23 _retval__operator_assign: signed int 24 ... with attributes: 25 Attribute with name: unused 26 27 28 ... to arguments 29 Cast of: 30 Member Expression, with field: 31 x: signed int 32 ... from aggregate: 33 Cast of: 34 Variable Expression: m: reference to instance of struct Managed with body 1 35 ... to: 36 instance of struct Managed with body 1 37 ... to: 38 reference to signed int 39 Cast of: 40 constant expression (0 0: zero_t) 41 ... to: 42 signed int 43 44 ... with environment: 45 Types: 46 Non-types: 47 48 49 ... to arguments 50 Cast of: 51 Variable Expression: x: instance of struct Managed with body 1 52 ... to: 53 reference to instance of struct Managed with body 1 54 constant expression (123 123: signed int) 55 56 ... to: nothing -
src/tests/sum.c
r0182bfa r28f3a19 11 11 // Created On : Wed May 27 17:56:53 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : S at Feb 17 11:49:17201814 // Update Count : 27 313 // Last Modified On : Sun Jun 3 19:23:41 2018 14 // Update Count : 278 15 15 // 16 16 … … 18 18 #include <stdlib> 19 19 20 void ?{}( int & c, zero_t ) { c = 0; } 20 void ?{}( int & c, zero_t ) { c = 0; } // not in prelude 21 21 22 22 trait sumable( otype T ) { 23 void ?{}( T &, zero_t ); // constructor from 0 literal23 void ?{}( T &, zero_t ); // 0 literal constructor 24 24 T ?+?( T, T ); // assortment of additions 25 25 T ?+=?( T &, T ); … … 29 29 30 30 forall( otype T | sumable( T ) ) // use trait 31 T sum( unsigned int size, T a[] ) {32 T total = 0; // in stantiate T from 0 by callingconstructor33 for ( unsigned int i = 0; i < size; i += 1 )31 T sum( size_t size, T a[] ) { 32 T total = 0; // initialize by 0 constructor 33 for ( size_t i = 0; i < size; i += 1 ) 34 34 total += a[i]; // select appropriate + 35 35 return total; … … 111 111 for ( int i = 0; i < size; i += 1, v += 1 ) { 112 112 s += (int)v; 113 gs.x[i] = (int)v; // set fi led array in generic type113 gs.x[i] = (int)v; // set field array in generic type 114 114 } // for 115 115 sout | "sum from" | low | "to" | High | "is" 116 | sum( size, gs.x ) | ", check" | (int)s | endl; // add fi led array in generic type116 | sum( size, gs.x ) | ", check" | (int)s | endl; // add field array in generic type 117 117 } // main 118 118 -
src/tests/test.py
r0182bfa r28f3a19 277 277 elif options.list : 278 278 print("Listing for %s:%s"% (settings.arch.string, settings.debug.string)) 279 print("\n".join(map(lambda t: "%s" % (t.toString()), tests)))279 fancy_print("\n".join(map(lambda t: "%s" % (t.toString()), tests))) 280 280 281 281 else :
Note:
See TracChangeset
for help on using the changeset viewer.