Home | History | Annotate | Download | only in tests

Lines Matching refs:GLOB

319 int     GLOB = 0;
322 printf("\tGLOB=%d\n", GLOB);
330 int GLOB = 0;
332 GLOB = 1;
338 GLOB = 2;
342 FAST_MODE_INIT(&GLOB);
343 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test01. TP.");
344 ANNOTATE_TRACE_MEMORY(&GLOB);
347 const int tmp = GLOB;
356 int GLOB = 0;
357 // Two write accesses to GLOB are synchronized because
363 // 3. MU.Lock() a. write(GLOB)
370 // 6. write(GLOB)
375 GLOB = 1;
392 GLOB = 2;
397 printf("\tGLOB=%d\n", GLOB);
405 int GLOB = 0;
406 // Two write accesses to GLOB are synchronized via conditional critical section.
412 // a. write(GLOB)
418 // 5. write(GLOB)
423 GLOB = 1;
437 GLOB = 2;
442 printf("\tGLOB=%d\n", GLOB);
449 int GLOB = 0;
451 // Two write accesses to GLOB are separated by PCQ Put/Get.
454 // 1. write(GLOB)
457 // b. write(GLOB)
461 GLOB = 1;
467 GLOB = 2;
475 printf("\tGLOB=%d\n", GLOB);
484 int GLOB = 0;
485 // Two write accesses to GLOB are synchronized via CondVar.
493 // 3. MU.Lock() a. write(GLOB)
500 // 6. write(GLOB)
504 GLOB = 1;
521 GLOB = 2;
524 FAST_MODE_INIT(&GLOB);
526 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test05. FP. Unavoidable in hybrid scheme.");
529 printf("\tGLOB=%d\n", GLOB);
537 int GLOB = 0;
543 // 3. MU.Lock() a. write(GLOB)
551 // 6. write(GLOB)
556 GLOB = 1;
575 GLOB = 2;
580 printf("\tGLOB=%d\n", GLOB);
588 int GLOB = 0;
590 // Two write accesses to GLOB are synchronized via conditional critical section.
597 // a. write(GLOB)
603 // 5. write(GLOB)
607 GLOB = 1;
621 GLOB = 2; // If LockWhen didn't catch the signal, a race may be reported here.
627 printf("\tGLOB=%d\n", GLOB);
634 int GLOB = 0;
635 // Three accesses to GLOB are separated by thread start/join.
638 // 1. write(GLOB)
640 // a. write(GLOB)
642 // 4. write(GLOB)
644 GLOB = 2;
649 GLOB = 1;
652 GLOB = 3;
657 printf("\tGLOB=%d\n", GLOB);
665 int GLOB = 0;
671 GLOB = 3;
674 CHECK(GLOB != -777);
678 ANNOTATE_TRACE_MEMORY(&GLOB);
679 FAST_MODE_INIT(&GLOB);
680 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test09. TP.");
685 printf("\tGLOB=%d\n", GLOB);
693 int GLOB = 0;
699 // 1. write(GLOB) a. sleep(long enough so that GLOB
701 // b. read(GLOB)
708 GLOB = 3;
712 CHECK(GLOB != -777);
716 FAST_MODE_INIT(&GLOB);
717 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test10. TP. FN in MSMHelgrind.");
722 printf("\tGLOB=%d\n", GLOB);
733 // 1. Start(workers) a. read(GLOB)
738 // 5. write(GLOB)
741 int GLOB = 0;
745 CHECK(GLOB != 777);
765 GLOB = 2;
771 // ANNOTATE_EXPECT_RACE(&GLOB, "test11. FP. Fixed by MSMProp1.");
774 printf("\tGLOB=%d\n", GLOB);
782 int GLOB = 0;
786 // First, we write to GLOB under MU, then we synchronize via PCQ,
791 // 2. write(GLOB) <---- MU ----> b. write(GLOB)
794 // e. write(GLOB)
801 GLOB++;
809 GLOB++;
813 GLOB++;
817 // ANNOTATE_EXPECT_RACE(&GLOB, "test12. FP. Fixed by MSMProp1.");
822 printf("\tGLOB=%d\n", GLOB);
830 int GLOB = 0;
836 // 2. write(GLOB) <---------- MU ----------> b. write(GLOB)
844 // f. write(GLOB)
849 GLOB++;
860 GLOB++;
865 GLOB++;
869 // ANNOTATE_EXPECT_RACE(&GLOB, "test13. FP. Fixed by MSMProp1.");
877 printf("\tGLOB=%d\n", GLOB);
885 int GLOB = 0;
892 // 1. read(GLOB) a. read(GLOB)
896 // C. write(GLOB)
900 CHECK(GLOB != 777);
904 CHECK(GLOB != 777);
910 GLOB++;
913 // ANNOTATE_EXPECT_RACE(&GLOB, "test14. FP. Fixed by MSMProp1.");
918 printf("\tGLOB=%d\n", GLOB);
927 // 1. write(GLOB)
932 // c. read(GLOB)
934 int GLOB = 0;
938 GLOB = 2;
949 CHECK(GLOB != 777);
959 printf("\tGLOB=%d\n", GLOB);
969 // 2. write(GLOB) <------------ MU ----------> b. write(GLOB)
976 // 9. read(GLOB) h. MU2.Unlock()
977 // i. read(GLOB)
986 int GLOB = 0;
992 GLOB++;
1001 CHECK(GLOB == 2);
1005 // ANNOTATE_EXPECT_RACE(&GLOB, "test16. FP. Fixed by MSMProp1 + Barrier support.");
1011 printf("\tGLOB=%d\n", GLOB);
1020 int GLOB = 0;
1026 GLOB++;
1035 CHECK(GLOB == 3);
1039 // ANNOTATE_EXPECT_RACE(&GLOB, "test17. FP. Fixed by MSMProp1 + Barrier support.");
1045 printf("\tGLOB=%d\n", GLOB);
1053 int GLOB = 0;
1059 GLOB = 1;
1075 GLOB = 2;
1080 printf("\tGLOB=%d\n", GLOB);
1087 int GLOB = 0;
1092 GLOB = 1;
1108 GLOB = 2;
1113 printf("\tGLOB=%d\n", GLOB);
1120 int GLOB = 0;
1124 GLOB = 1;
1137 GLOB = 2;
1140 FAST_MODE_INIT(&GLOB);
1141 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test20. TP.");
1144 printf("\tGLOB=%d\n", GLOB);
1151 int GLOB = 0;
1155 GLOB = 1;
1167 GLOB = 2;
1170 FAST_MODE_INIT(&GLOB);
1171 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test21. TP.");
1174 printf("\tGLOB=%d\n", GLOB);
1181 int GLOB = 0;
1185 GLOB = 1;
1203 GLOB = 2;
1206 FAST_MODE_INIT(&GLOB);
1207 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test22. TP.");
1210 printf("\tGLOB=%d\n", GLOB);
1218 int GLOB = 0;
1224 GLOB++;
1237 CHECK(GLOB != 777);
1249 CHECK(GLOB != 777);
1258 GLOB++;
1273 printf("\tGLOB=%d\n", GLOB);
1280 int GLOB = 0;
1286 GLOB = 1;
1300 GLOB = 2;
1305 printf("\tGLOB=%d\n", GLOB);
1312 int GLOB = 0;
1319 GLOB = 1;
1333 GLOB = 2;
1338 printf("\tGLOB=%d\n", GLOB);
1345 int GLOB = 0;
1350 GLOB = 1;
1361 GLOB = 2;
1364 FAST_MODE_INIT(&GLOB);
1365 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test26. TP");
1368 printf("\tGLOB=%d\n", GLOB);
1377 int GLOB = 0;
1381 GLOB++;
1391 printf("\tGLOB=%d\n", GLOB);
1402 // 2. write(GLOB) B. write(GLOB)
1406 // 6. read(GLOB) b. Q.Get() <---------/ F. read(GLOB)
1408 // c. read(GLOB)
1410 int GLOB = 0;
1415 GLOB++;
1421 CHECK(GLOB != 777);
1429 CHECK(GLOB == 2);
1437 printf("\tGLOB=%d\n", GLOB);
1448 int GLOB = 0;
1452 GLOB++;
1459 CHECK(GLOB != 777);
1471 CHECK(GLOB == 2);
1482 printf("\tGLOB=%d\n", GLOB);
1496 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1498 // 3. BOUNDARY++; c. read(GLOB[i]: i < n)
1501 // no actual races on accesses to GLOB[]:
1502 // Writer writes to GLOB[i] where i>=BOUNDARY and then increments BOUNDARY.
1503 // Readers read BOUNDARY and read GLOB[i] where i<BOUNDARY.
1506 // accesses to GLOB since compilers and CPUs
1513 static int GLOB[N];
1520 GLOB[j] = j;
1535 CHECK(GLOB[i] == i);
1548 printf("\tGLOB=%d\n", GLOB[N-1]);
1560 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1562 // 3. BOUNDARY++; c. write(GLOB[i]: i < n)
1566 static int GLOB[N];
1573 GLOB[j] = j;
1588 if(GLOB[i] == i) {
1589 GLOB[i]++;
1603 printf("\tGLOB=%d\n", GLOB[N-1]);
1618 // b. write(GLOB)
1622 // C. read(GLOB)
1625 // 5. write(GLOB)
1631 int GLOB = 0;
1636 GLOB = 1;
1643 CHECK(GLOB != 777);
1656 GLOB = 2;
1660 // ANNOTATE_EXPECT_RACE(&GLOB, "test32. FP. Fixed by MSMProp1.");
1663 printf("\tGLOB=%d\n", GLOB);
1672 int GLOB = 0;
1684 int n = ++GLOB;
1718 GLOB, ARR[1], ARR[7], ARR[N-1]);
1727 int GLOB = 0;
1757 printf("\tGLOB=%d\n", GLOB);
1817 // 2. write(GLOB) B. write(GLOB)
1822 // 7. write(GLOB) G. write(GLOB)
1826 // d. write(GLOB)
1829 int GLOB = 0;
1834 GLOB++;
1841 GLOB++;
1851 GLOB++;
1860 printf("\tGLOB=%d\n", GLOB);
1868 int GLOB = 0;
1881 GLOB = 3;
1887 CHECK(GLOB != -777);
1896 printf("\tGLOB=%d\n", GLOB);
1908 // write(GLOB) write(GLOB)
1914 // write(GLOB) write(GLOB)
1920 // write(GLOB) write(GLOB)
1926 int GLOB = 0;
1931 GLOB++;
1939 GLOB++;
1954 GLOB++;
1967 printf("\tGLOB=%d\n", GLOB);
1978 int GLOB = 0;
1985 GLOB++;
1988 CHECK(GLOB == N_threads);
1991 ANNOTATE_TRACE_MEMORY(&GLOB);
1992 // ANNOTATE_EXPECT_RACE(&GLOB, "test39. FP. Fixed by MSMProp1. Barrier.");
2001 printf("\tGLOB=%d\n", GLOB);
2014 // write(GLOB) write(GLOB)
2021 // write(GLOB) write(GLOB)
2026 // write(GLOB) write(GLOB)
2032 int GLOB = 0;
2037 GLOB++;
2046 GLOB++;
2060 GLOB++;
2067 // ANNOTATE_EXPECT_RACE(&GLOB, "test40. FP. Fixed by MSMProp1. Complex Stuff.");
2074 printf("\tGLOB=%d\n", GLOB);
2098 int GLOB = 0;
2104 GLOB=1;
2117 GLOB=3;
2129 GLOB=2;
2139 // ANNOTATE_EXPECT_RACE(&GLOB, "test42. TN. debugging.");
2144 printf("\tGLOB=%d\n", GLOB);
2159 int GLOB = 0;
2162 GLOB = 1;
2164 CHECK(GLOB == 1);
2169 CHECK(GLOB == 1);
2176 printf("\tGLOB=%d\n", GLOB);
2194 int GLOB = 0;
2198 CHECK(GLOB == 0);
2201 GLOB = 1;
2208 GLOB = 1;
2212 // ANNOTATE_EXPECT_RACE(&GLOB, "test44. FP. Fixed by MSMProp1.");
2217 printf("\tGLOB=%d\n", GLOB);
2235 int GLOB = 0;
2239 CHECK(GLOB == 0);
2242 GLOB++;
2249 CHECK(GLOB <= 1);
2257 printf("\tGLOB=%d\n", GLOB);
2274 int GLOB = 0;
2277 GLOB++;
2279 GLOB++;
2285 GLOB++;
2292 printf("\tGLOB=%d\n", GLOB);
2296 ANNOTATE_TRACE_MEMORY(&GLOB);
2317 int GLOB = 0;
2320 GLOB=1;
2328 GLOB++;
2331 FAST_MODE_INIT(&GLOB);
2333 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test47. TP. Not detected by pure HB.");
2338 printf("\tGLOB=%d\n", GLOB);
2346 int GLOB = 0;
2353 // 1. write(GLOB) a. sleep(long enough so that GLOB
2355 // b. read(GLOB)
2362 GLOB = 3;
2366 CHECK(GLOB != -777);
2370 FAST_MODE_INIT(&GLOB);
2371 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test48. TP. FN in MSMHelgrind.");
2376 printf("\tGLOB=%d\n", GLOB);
2384 int GLOB = 0;
2390 // 1. write(GLOB) a. sleep(long enough so that GLOB
2392 // b. read(GLOB)
2393 // c. read(GLOB)
2394 // d. read(GLOB)
2395 // e. read(GLOB)
2402 GLOB = 3;
2406 CHECK(GLOB != -777);
2407 CHECK(GLOB != -777);
2408 CHECK(GLOB != -777);
2409 CHECK(GLOB != -777);
2413 FAST_MODE_INIT(&GLOB);
2414 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test49. TP. FN in MSMHelgrind.");
2419 printf("\tGLOB=%d\n", GLOB);
2427 int GLOB = 0;
2429 // Two last write accesses to GLOB are not synchronized
2434 // 3. MU.Lock() a. write(GLOB)
2441 // 6. write(GLOB) f. MU.Lock()
2442 // g. write(GLOB)
2449 GLOB = 1;
2458 GLOB = 3;
2474 GLOB = 2;
2477 FAST_MODE_INIT(&GLOB);
2478 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test50. TP.");
2481 printf("\tGLOB=%d\n", GLOB);
2489 int GLOB = 0;
2503 // 5. write(GLOB) \ a. write(GLOB)
2509 // f. write(GLOB)
2520 GLOB = 1;
2529 GLOB = 2;
2549 GLOB = 3;
2552 FAST_MODE_INIT(&GLOB);
2553 ANNOTATE_EXPECT_RACE(&GLOB, "test51. TP.");
2556 printf("\tGLOB=%d\n", GLOB);
2564 int GLOB = 0;
2573 // a. write(GLOB)
2582 // 4. MU.Unlock() \ f. write(GLOB)
2583 // 5. write(GLOB) \ .
2591 GLOB = 1;
2600 GLOB = 2;
2620 GLOB = 3;
2623 FAST_MODE_INIT(&GLOB);
2624 ANNOTATE_EXPECT_RACE(&GLOB, "test52. TP.");
2627 printf("\tGLOB=%d\n", GLOB);
2644 // 2. write(GLOB)
2652 // f. write(GLOB)
2656 int GLOB = 0;
2662 GLOB = 1000;
2676 GLOB again
2678 CHECK(GLOB >= 1000);
2679 GLOB++;
2684 FAST_MODE_INIT(&GLOB);
2686 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test53. FP. Implicit semaphore");
2691 printf("\tGLOB=%d\n", GLOB);
2700 int GLOB = 0;
2706 GLOB = 1000;
2708 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
2721 // at this point Initializer will not access GLOB again
2722 ANNOTATE_CONDVAR_WAIT(&GLOB);
2724 CHECK(GLOB >= 1000);
2725 GLOB++;
2734 printf("\tGLOB=%d\n", GLOB);
2747 int GLOB = 0;
2751 GLOB = 1;
2765 GLOB = 2;
2773 printf("\tGLOB=%d\n", GLOB);
2783 // a race on GLOB as a benign race.
2784 int GLOB = 0;
2788 GLOB++;
2792 ANNOTATE_BENIGN_RACE(&GLOB, "test56. Use of ANNOTATE_BENIGN_RACE.");
2798 printf("\tGLOB=%d\n", GLOB);
2806 int GLOB = 0;
2809 AtomicIncrement(&GLOB, 1);
2814 while (GLOB < 20) usleep(1000);
2821 CHECK(GLOB == 20);
2822 printf("\tGLOB=%d\n", GLOB);
2969 int GLOB = 0;
2980 P1 = &GLOB;
3006 printf("\tGLOB=%d\n", GLOB);
3077 // 1. read(GLOB) (sleep)
3078 // a. read(GLOB)
3080 // B. write(GLOB)
3084 int GLOB = 0;
3088 CHECK(GLOB == 0);
3093 CHECK(GLOB == 0);
3099 GLOB = 1;
3104 FAST_MODE_INIT(&GLOB);
3105 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test64: TP.");
3110 printf("\tGLOB=%d\n", GLOB);
3123 // 2. write(GLOB)
3126 // b. write(GLOB)
3129 // B. write(GLOB)
3133 int GLOB = 0;
3139 GLOB++;
3146 GLOB++;
3153 GLOB = 1;
3158 FAST_MODE_INIT(&GLOB);
3160 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test65. TP.");
3165 printf("\tGLOB=%d\n", GLOB);
3230 int GLOB = 0;
3236 GLOB = 1;
3263 GLOB = 2;
3267 FAST_MODE_INIT(&GLOB);
3268 ANNOTATE_EXPECT_RACE(&GLOB, "test67. FN. Race between Signaller1 and Waiter2");
3273 printf("\tGLOB=%d\n", GLOB);
3281 // In this test, all writes to GLOB are protected by a mutex
3286 int GLOB = 0;
3294 GLOB++;
3307 CHECK(GLOB >= 0);
3319 FAST_MODE_INIT(&GLOB);
3320 ANNOTATE_EXPECT_RACE(&GLOB, "TP. Writes are protected, reads are not.");
3325 printf("\tGLOB=%d\n", GLOB);
3334 // We do not want to annotate GLOB as a benign race
3338 int GLOB = 0;
3347 GLOB++;
3361 CHECK(GLOB >= 0);
3378 printf("\tGLOB=%d\n", GLOB);
3385 int GLOB = 0;
3388 ANNOTATE_TRACE_MEMORY(&GLOB);
3389 GLOB = 1;
3390 printf("\tGLOB=%d\n", GLOB);
3455 int GLOB = 0;
3466 int n = ++GLOB;
3523 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3535 int GLOB = 0;
3557 int n = ++GLOB;
3615 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3639 int GLOB = 0;
3643 GLOB = 1;
3650 CHECK(GLOB==1);
3655 CHECK(GLOB==1);
3669 GLOB = 2;
3675 printf("\tGLOB=%d\n", GLOB);
3757 int GLOB = 0;
3784 int GLOB = 0;
3811 int GLOB = 0;
3936 int GLOB = 0;
3962 int GLOB = 0;
4127 int GLOB = 0;
4295 int GLOB = 0;
4298 GLOB = 1;
4305 GLOB = 1;
4307 printf("\tGLOB=%d\n", GLOB);
4393 int *GLOB = 0;
4398 GLOB = (int*)memalign(64, sizeof(int));
4399 *GLOB = 777;
4401 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test90. FP. This is a false positve");
4410 int *p = GLOB;
4424 printf("\t*GLOB=%d\n", *GLOB);
4425 free(GLOB);
4440 int *GLOB = 0;
4445 GLOB = (int*)memalign(64, sizeof(int));
4446 *GLOB = 777;
4448 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test91. FP. This is a false positve");
4456 int *p = GLOB;
4473 printf("\t*GLOB=%d\n", *GLOB);
4474 free(GLOB);
4488 // 2. Create GLOB.
4489 // 3. ANNOTATE_PUBLISH_...(GLOB) -------\ .
4492 // \ b. Get GLOB
4494 // \--> d. Access GLOB
4497 // accesses to GLOB.
4503 ObjType *GLOB = 0;
4508 GLOB = new ObjType;
4510 GLOB->arr[i] = 777;
4513 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB, sizeof(*GLOB));
4520 ObjType *p = GLOB;
4541 printf("\t*GLOB=%d\n", GLOB->arr[0]);
4549 int GLOB = 0;
4552 CHECK(GLOB == 0);
4558 ANNOTATE_PUBLISH_MEMORY_RANGE(&GLOB, sizeof(GLOB));
4566 printf("\tGLOB=%d\n", GLOB);
4574 int GLOB;
4584 GLOB = 1; // WRITE
4611 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4614 FAST_MODE_INIT(&GLOB);
4615 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test94: TP.");
4620 printf("\tGLOB=%d\n", GLOB);
4627 int GLOB = 0;
4638 GLOB = 1; // WRITE
4664 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4667 FAST_MODE_INIT(&GLOB);
4668 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test95: TP.");
4673 printf("\tGLOB=%d\n", GLOB);
4683 int GLOB = 0;
4690 GLOB++;
4696 GLOB++;
4702 GLOB++;
4707 ANNOTATE_TRACE_MEMORY(&GLOB);
4711 CHECK(GLOB == 3);
4712 printf("\tGLOB=%d\n", GLOB);
4725 int * GLOB = &array[ARRAY_SIZE/2];
4727 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4733 CHECK(777 == *GLOB);
4739 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test97: TP. FN with --fast-mode=yes");
4743 *GLOB = 777;
4762 int GLOB = 0;
4768 GLOB = 1;
4778 GLOB = 2;
4802 printf("\tGLOB=%d\n", GLOB);
4817 bool GLOB = false;
4822 mu.LockWhenWithTimeout(Condition(&ArgIsTrue, &GLOB), 5);
4823 GLOB = false;
4892 int GLOB = 0;
4904 GLOB = 1;
4927 GLOB = 2;
4936 printf("\tGLOB=%d\n", GLOB);
4949 int * GLOB = &array[ARRAY_SIZE/2];
4951 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4957 CHECK(777 == GLOB[0]);
4959 CHECK(777 == GLOB[1]);
4965 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+0, "test102: TP. FN with --fast-mode=yes");
4966 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+1, "test102: TP");
4970 GLOB[0] = 777;
4972 GLOB[1] = 777;
5019 int *GLOB = NULL;
5021 *GLOB = 1;
5028 *GLOB = 2;
5032 GLOB = (int*)memalign(64, sizeof(int));
5033 *GLOB = 0;
5034 ANNOTATE_EXPECT_RACE(GLOB, "test104. TP.");
5035 ANNOTATE_TRACE_MEMORY(GLOB);
5038 printf("\tGLOB=%d\n", *GLOB);
5039 free(GLOB);
5047 int GLOB = 0;
5072 printf("\tGLOB=%d\n", GLOB);
5080 int *GLOB = NULL;
5083 GLOB = new int;
5084 ANNOTATE_TRACE_MEMORY(GLOB);
5085 *GLOB = 777;
5094 CHECK(*GLOB == 777);
5103 printf("\tGLOB=%d\n", *GLOB);
5111 int GLOB = 0;
5114 ANNOTATE_EXPECT_RACE(&GLOB, "No race in fact. Just checking the tool.");
5115 printf("\tGLOB=%d\n", GLOB);
5174 static int GLOB[N];
5178 // printf("--Worker : %ld %p\n", (int*)a - GLOB, (void*)pthread_self());
5187 t[i] = new MyThread(Worker, &GLOB[i]);
5190 ANNOTATE_TRACE_MEMORY(&GLOB[i]);
5191 GLOB[i] = 1;
5199 GLOB[i]++;
5203 printf("\tGLOB=%d\n", GLOB[13]);
5211 int GLOB = 0;
5229 GLOB++;
5266 FAST_MODE_INIT(&GLOB);
5267 ANNOTATE_EXPECT_RACE(&GLOB, "real race on global object");
5297 CHECK(GLOB <= 3);
5317 char *GLOB = 0;
5374 char *GLOB = 0;
5397 GLOB[i]++;
5407 ANNOTATE_NEW_MEMORY(GLOB + b, e - b);
5408 ANNOTATE_TRACE_MEMORY(GLOB + b);
5410 GLOB[j] = 0;
5412 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB + b, e - b);
5426 GLOB = new char [N];
5446 printf("GLOB = %d\n", (int)GLOB[0]);
5502 int GLOB = 0;
5519 GLOB = 1;
5530 CHECK(GLOB == 1);
5629 int GLOB = 0;
5633 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
5637 ANNOTATE_CONDVAR_WAIT(&GLOB);
5647 printf("\tGLOB=%d\n", GLOB);
5655 int GLOB = 0;
5657 GLOB = 1;
5663 GLOB = 2;
5667 FAST_MODE_INIT(&GLOB);
5669 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true race");
5673 printf("\tGLOB=%d\n", GLOB);
5681 int GLOB = 0;
5684 GLOB = 1; // write
5685 CHECK(GLOB); // read
5690 CHECK(GLOB >= 0); // read
5694 FAST_MODE_INIT(&GLOB);
5695 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "TP (T1: write then read, T2: read)");
5698 GLOB = 1;
5701 printf("\tGLOB=%d\n", GLOB);
5937 int GLOB = 0;
5946 GLOB = 1;
5954 printf("\tGLOB=%d\n", GLOB);
5964 // (GLOB[thread_num]) and we take a *writer* lock when we
5974 int GLOB[n_threads];
5982 GLOB[my_num]++;
5990 sum += GLOB[i];
6023 int GLOB = 0;
6026 CHECK(GLOB == 0);
6035 GLOB = 1;
6037 printf("\tGLOB=%d\n", GLOB);
6066 int GLOB = 0;
6070 GLOB++;
6074 GLOB++;
6087 int GLOB = 0;
6090 *param = GLOB; // a write into Waiter's memory
6091 return GLOB > 0;
6097 CHECK(GLOB > 0);
6103 GLOB++;
6112 printf("\tGLOB=%d\n", GLOB);
6195 int GLOB = 0;
6196 void Worker() { GLOB = 1; }
6199 FAST_MODE_INIT(&GLOB);
6200 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test132");
6201 printf("test132: positive; &GLOB=%p\n", &GLOB);
6202 ANNOTATE_TRACE_MEMORY(&GLOB);
6203 GLOB = 7;
6220 int GLOB = 0;
6221 void Worker() { GLOB = 1; }
6224 FAST_MODE_INIT(&GLOB);
6225 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test133");
6226 printf("test133: positive; &GLOB=%p\n", &GLOB);
6227 ANNOTATE_TRACE_MEMORY(&GLOB);
6228 GLOB = 7;
6342 int GLOB = 0;
6371 int GLOB = 0;
6375 GLOB++;
6379 FAST_MODE_INIT(&GLOB);
6399 int GLOB = 0;
6403 GLOB++; // First access.
6410 GLOB++; // Second access.
6414 FAST_MODE_INIT(&GLOB);
6640 // We have a race on GLOB between Putter and one of the Getters.
6645 int GLOB = 0;
6650 GLOB = 1;
6657 CHECK(GLOB == 1); // Race here
6663 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true races");
6678 int GLOB = 0;
6715 // In this test we have many different accesses to GLOB and only one access
6717 int GLOB = 0;
6726 MU1.Lock(); CHECK(GLOB >= 0); MU1.Unlock();
6730 MU2.Lock(); CHECK(GLOB >= 0); MU2.Unlock();
6734 MU1.Lock(); CHECK(GLOB >= 0); MU1.Unlock();
6738 MU1.Lock(); GLOB++; MU1.Unlock();
6760 int GLOB = 0;
6763 void Worker1() { CHECK(GLOB >= 0); }
6764 void Worker2() { MU.Lock(); GLOB=1; MU.Unlock();}
6768 ANNOTATE_TRACE_MEMORY(&GLOB);
6821 int GLOB = 0;
6823 // In this test GLOB is protected by MU1 and MU2, but inconsistently.
6831 // which mutex is supposed to protect GLOB.
6834 void Worker1() { MU1.Lock(); MU2.Lock(); GLOB=1; MU2.Unlock(); MU1.Unlock(); }
6835 void Worker2() { MU1.Lock(); GLOB=2; MU1.Unlock(); }
6836 void Worker3() { MU1.Lock(); MU2.Lock(); GLOB=3; MU2.Unlock(); MU1.Unlock(); }
6837 void Worker4() { MU2.Lock(); GLOB=4; MU2.Unlock(); }
6840 ANNOTATE_TRACE_MEMORY(&GLOB);
6854 int GLOB = 0;
6860 void Worker1() { MU1.Lock(); MU2.Lock(); GLOB=1; MU2.Unlock(); MU1.Unlock(); }
6861 void Worker2() { MU1.Lock(); MU2.Lock(); GLOB=3; MU2.Unlock(); MU1.Unlock(); }
6862 void Worker3() { GLOB=4; }
6865 ANNOTATE_TRACE_MEMORY(&GLOB);
6878 int *GLOB = 0;
6892 (*GLOB)++; // "--keep-history=2" will point here (experimental).
6905 GLOB = new int;
6906 *GLOB = 1;
6959 string GLOB;
6962 GLOB="Thread1";
6966 GLOB="Booooooooooo";
7108 int GLOB = 0;
7109 void RaceyWrite() { GLOB++; }
7142 int GLOB = 0;
7144 // Worker(N) will do 2^N increments of GLOB, each increment in a separate thread
7153 GLOB++; // Race here
7159 printf("\tGLOB=%d\n", GLOB);
7288 int GLOB = 0;
7300 GLOB++;
7346 int GLOB = 0;
7351 GLOB++;
7390 int GLOB[ARRAY_SIZE];
7403 GLOB[i]++;
7405 if (myId == 0 && GLOB[0] > GLOB_limit) {
7410 nextQ.Put(GLOB);
7418 Q[0]->Put(GLOB);
7539 int GLOB = 0;
7548 GLOB++;
7565 CHECK(GLOB == N_threads * ITERATIONS);
7690 int GLOB = 0;
7696 GLOB++;
7702 //ANNOTATE_BENIGN_RACE(&GLOB, "Test");
7717 int GLOB = 0;
7721 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
7723 GLOB++;
7724 ANNOTATE_CONDVAR_WAIT(&GLOB);
7734 int GLOB = 0;
7742 GLOB++;