Lines Matching defs:GLOB
323 int GLOB = 0;
326 printf("\tGLOB=%d\n", GLOB);
334 int GLOB = 0;
336 GLOB = 1;
344 GLOB = 2;
348 FAST_MODE_INIT(&GLOB);
349 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test01. TP.");
350 ANNOTATE_TRACE_MEMORY(&GLOB);
353 const int tmp = GLOB;
362 int GLOB = 0;
363 // Two write accesses to GLOB are synchronized because
369 // 3. MU.Lock() a. write(GLOB)
376 // 6. write(GLOB)
381 GLOB = 1;
398 GLOB = 2;
403 printf("\tGLOB=%d\n", GLOB);
411 int GLOB = 0;
412 // Two write accesses to GLOB are synchronized via conditional critical section.
418 // a. write(GLOB)
424 // 5. write(GLOB)
429 GLOB = 1;
443 GLOB = 2;
448 printf("\tGLOB=%d\n", GLOB);
455 int GLOB = 0;
457 // Two write accesses to GLOB are separated by PCQ Put/Get.
460 // 1. write(GLOB)
463 // b. write(GLOB)
467 GLOB = 1;
473 GLOB = 2;
481 printf("\tGLOB=%d\n", GLOB);
490 int GLOB = 0;
491 // Two write accesses to GLOB are synchronized via CondVar.
499 // 3. MU.Lock() a. write(GLOB)
506 // 6. write(GLOB)
510 GLOB = 1;
527 GLOB = 2;
530 FAST_MODE_INIT(&GLOB);
532 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test05. FP. Unavoidable in hybrid scheme.");
535 printf("\tGLOB=%d\n", GLOB);
543 int GLOB = 0;
549 // 3. MU.Lock() a. write(GLOB)
557 // 6. write(GLOB)
562 GLOB = 1;
581 GLOB = 2;
586 printf("\tGLOB=%d\n", GLOB);
594 int GLOB = 0;
596 // Two write accesses to GLOB are synchronized via conditional critical section.
603 // a. write(GLOB)
609 // 5. write(GLOB)
613 GLOB = 1;
627 GLOB = 2; // If LockWhen didn't catch the signal, a race may be reported here.
633 printf("\tGLOB=%d\n", GLOB);
640 int GLOB = 0;
641 // Three accesses to GLOB are separated by thread start/join.
644 // 1. write(GLOB)
646 // a. write(GLOB)
648 // 4. write(GLOB)
650 GLOB = 2;
655 GLOB = 1;
658 GLOB = 3;
663 printf("\tGLOB=%d\n", GLOB);
671 int GLOB = 0;
677 GLOB = 3;
680 CHECK(GLOB != -777);
684 ANNOTATE_TRACE_MEMORY(&GLOB);
685 FAST_MODE_INIT(&GLOB);
686 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test09. TP.");
691 printf("\tGLOB=%d\n", GLOB);
699 int GLOB = 0;
705 // 1. write(GLOB) a. sleep(long enough so that GLOB
707 // b. read(GLOB)
714 GLOB = 3;
718 CHECK(GLOB != -777);
722 FAST_MODE_INIT(&GLOB);
723 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test10. TP. FN in MSMHelgrind.");
728 printf("\tGLOB=%d\n", GLOB);
739 // 1. Start(workers) a. read(GLOB)
744 // 5. write(GLOB)
747 int GLOB = 0;
751 CHECK(GLOB != 777);
771 GLOB = 2;
777 // ANNOTATE_EXPECT_RACE(&GLOB, "test11. FP. Fixed by MSMProp1.");
780 printf("\tGLOB=%d\n", GLOB);
788 int GLOB = 0;
792 // First, we write to GLOB under MU, then we synchronize via PCQ,
797 // 2. write(GLOB) <---- MU ----> b. write(GLOB)
800 // e. write(GLOB)
807 GLOB++;
815 GLOB++;
819 GLOB++;
823 // ANNOTATE_EXPECT_RACE(&GLOB, "test12. FP. Fixed by MSMProp1.");
828 printf("\tGLOB=%d\n", GLOB);
836 int GLOB = 0;
842 // 2. write(GLOB) <---------- MU ----------> b. write(GLOB)
850 // f. write(GLOB)
855 GLOB++;
866 GLOB++;
871 GLOB++;
875 // ANNOTATE_EXPECT_RACE(&GLOB, "test13. FP. Fixed by MSMProp1.");
883 printf("\tGLOB=%d\n", GLOB);
891 int GLOB = 0;
898 // 1. read(GLOB) a. read(GLOB)
902 // C. write(GLOB)
906 CHECK(GLOB != 777);
910 CHECK(GLOB != 777);
916 GLOB++;
919 // ANNOTATE_EXPECT_RACE(&GLOB, "test14. FP. Fixed by MSMProp1.");
924 printf("\tGLOB=%d\n", GLOB);
933 // 1. write(GLOB)
938 // c. read(GLOB)
940 int GLOB = 0;
944 GLOB = 2;
955 CHECK(GLOB != 777);
965 printf("\tGLOB=%d\n", GLOB);
975 // 2. write(GLOB) <------------ MU ----------> b. write(GLOB)
982 // 9. read(GLOB) h. MU2.Unlock()
983 // i. read(GLOB)
992 int GLOB = 0;
998 GLOB++;
1007 CHECK(GLOB == 2);
1011 // ANNOTATE_EXPECT_RACE(&GLOB, "test16. FP. Fixed by MSMProp1 + Barrier support.");
1017 printf("\tGLOB=%d\n", GLOB);
1026 int GLOB = 0;
1032 GLOB++;
1041 CHECK(GLOB == 3);
1045 // ANNOTATE_EXPECT_RACE(&GLOB, "test17. FP. Fixed by MSMProp1 + Barrier support.");
1051 printf("\tGLOB=%d\n", GLOB);
1059 int GLOB = 0;
1065 GLOB = 1;
1081 GLOB = 2;
1086 printf("\tGLOB=%d\n", GLOB);
1093 int GLOB = 0;
1098 GLOB = 1;
1114 GLOB = 2;
1119 printf("\tGLOB=%d\n", GLOB);
1126 int GLOB = 0;
1130 GLOB = 1;
1143 GLOB = 2;
1146 FAST_MODE_INIT(&GLOB);
1147 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test20. TP.");
1150 printf("\tGLOB=%d\n", GLOB);
1157 int GLOB = 0;
1161 GLOB = 1;
1173 GLOB = 2;
1176 FAST_MODE_INIT(&GLOB);
1177 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test21. TP.");
1180 printf("\tGLOB=%d\n", GLOB);
1187 int GLOB = 0;
1191 GLOB = 1;
1209 GLOB = 2;
1212 FAST_MODE_INIT(&GLOB);
1213 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test22. TP.");
1216 printf("\tGLOB=%d\n", GLOB);
1224 int GLOB = 0;
1230 GLOB++;
1243 CHECK(GLOB != 777);
1255 CHECK(GLOB != 777);
1264 GLOB++;
1279 printf("\tGLOB=%d\n", GLOB);
1286 int GLOB = 0;
1292 GLOB = 1;
1306 GLOB = 2;
1311 printf("\tGLOB=%d\n", GLOB);
1318 int GLOB = 0;
1325 GLOB = 1;
1339 GLOB = 2;
1344 printf("\tGLOB=%d\n", GLOB);
1351 int GLOB = 0;
1356 GLOB = 1;
1367 GLOB = 2;
1370 FAST_MODE_INIT(&GLOB);
1371 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test26. TP");
1374 printf("\tGLOB=%d\n", GLOB);
1383 int GLOB = 0;
1387 GLOB++;
1397 printf("\tGLOB=%d\n", GLOB);
1408 // 2. write(GLOB) B. write(GLOB)
1412 // 6. read(GLOB) b. Q.Get() <---------/ F. read(GLOB)
1414 // c. read(GLOB)
1416 int GLOB = 0;
1421 GLOB++;
1427 CHECK(GLOB != 777);
1435 CHECK(GLOB == 2);
1443 printf("\tGLOB=%d\n", GLOB);
1454 int GLOB = 0;
1458 GLOB++;
1465 CHECK(GLOB != 777);
1477 CHECK(GLOB == 2);
1488 printf("\tGLOB=%d\n", GLOB);
1502 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1504 // 3. BOUNDARY++; c. read(GLOB[i]: i < n)
1507 // no actual races on accesses to GLOB[]:
1508 // Writer writes to GLOB[i] where i>=BOUNDARY and then increments BOUNDARY.
1509 // Readers read BOUNDARY and read GLOB[i] where i<BOUNDARY.
1512 // accesses to GLOB since compilers and CPUs
1519 static int GLOB[N];
1526 GLOB[j] = j;
1541 CHECK(GLOB[i] == i);
1554 printf("\tGLOB=%d\n", GLOB[N-1]);
1566 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1568 // 3. BOUNDARY++; c. write(GLOB[i]: i < n)
1572 static int GLOB[N];
1579 GLOB[j] = j;
1594 if(GLOB[i] == i) {
1595 GLOB[i]++;
1609 printf("\tGLOB=%d\n", GLOB[N-1]);
1624 // b. write(GLOB)
1628 // C. read(GLOB)
1631 // 5. write(GLOB)
1637 int GLOB = 0;
1642 GLOB = 1;
1649 CHECK(GLOB != 777);
1662 GLOB = 2;
1666 // ANNOTATE_EXPECT_RACE(&GLOB, "test32. FP. Fixed by MSMProp1.");
1669 printf("\tGLOB=%d\n", GLOB);
1678 int GLOB = 0;
1690 int n = ++GLOB;
1724 GLOB, ARR[1], ARR[7], ARR[N-1]);
1733 int GLOB = 0;
1763 printf("\tGLOB=%d\n", GLOB);
1823 // 2. write(GLOB) B. write(GLOB)
1828 // 7. write(GLOB) G. write(GLOB)
1832 // d. write(GLOB)
1835 int GLOB = 0;
1840 GLOB++;
1847 GLOB++;
1857 GLOB++;
1866 printf("\tGLOB=%d\n", GLOB);
1874 int GLOB = 0;
1887 GLOB = 3;
1893 CHECK(GLOB != -777);
1902 printf("\tGLOB=%d\n", GLOB);
1914 // write(GLOB) write(GLOB)
1920 // write(GLOB) write(GLOB)
1926 // write(GLOB) write(GLOB)
1932 int GLOB = 0;
1937 GLOB++;
1945 GLOB++;
1960 GLOB++;
1973 printf("\tGLOB=%d\n", GLOB);
1984 int GLOB = 0;
1991 GLOB++;
1994 CHECK(GLOB == N_threads);
1997 ANNOTATE_TRACE_MEMORY(&GLOB);
1998 // ANNOTATE_EXPECT_RACE(&GLOB, "test39. FP. Fixed by MSMProp1. Barrier.");
2007 printf("\tGLOB=%d\n", GLOB);
2020 // write(GLOB) write(GLOB)
2027 // write(GLOB) write(GLOB)
2032 // write(GLOB) write(GLOB)
2038 int GLOB = 0;
2043 GLOB++;
2052 GLOB++;
2066 GLOB++;
2073 // ANNOTATE_EXPECT_RACE(&GLOB, "test40. FP. Fixed by MSMProp1. Complex Stuff.");
2080 printf("\tGLOB=%d\n", GLOB);
2104 int GLOB = 0;
2110 GLOB=1;
2123 GLOB=3;
2135 GLOB=2;
2145 // ANNOTATE_EXPECT_RACE(&GLOB, "test42. TN. debugging.");
2150 printf("\tGLOB=%d\n", GLOB);
2165 int GLOB = 0;
2168 GLOB = 1;
2170 CHECK(GLOB == 1);
2175 CHECK(GLOB == 1);
2182 printf("\tGLOB=%d\n", GLOB);
2200 int GLOB = 0;
2204 CHECK(GLOB == 0);
2207 GLOB = 1;
2214 GLOB = 1;
2218 // ANNOTATE_EXPECT_RACE(&GLOB, "test44. FP. Fixed by MSMProp1.");
2223 printf("\tGLOB=%d\n", GLOB);
2241 int GLOB = 0;
2245 CHECK(GLOB == 0);
2248 GLOB++;
2255 CHECK(GLOB <= 1);
2263 printf("\tGLOB=%d\n", GLOB);
2280 int GLOB = 0;
2283 GLOB++;
2285 GLOB++;
2291 GLOB++;
2298 printf("\tGLOB=%d\n", GLOB);
2302 ANNOTATE_TRACE_MEMORY(&GLOB);
2323 int GLOB = 0;
2326 GLOB=1;
2334 GLOB++;
2337 FAST_MODE_INIT(&GLOB);
2339 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test47. TP. Not detected by pure HB.");
2344 printf("\tGLOB=%d\n", GLOB);
2352 int GLOB = 0;
2359 // 1. write(GLOB) a. sleep(long enough so that GLOB
2361 // b. read(GLOB)
2368 GLOB = 3;
2372 CHECK(GLOB != -777);
2376 FAST_MODE_INIT(&GLOB);
2377 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test48. TP. FN in MSMHelgrind.");
2382 printf("\tGLOB=%d\n", GLOB);
2390 int GLOB = 0;
2396 // 1. write(GLOB) a. sleep(long enough so that GLOB
2398 // b. read(GLOB)
2399 // c. read(GLOB)
2400 // d. read(GLOB)
2401 // e. read(GLOB)
2408 GLOB = 3;
2412 CHECK(GLOB != -777);
2413 CHECK(GLOB != -777);
2414 CHECK(GLOB != -777);
2415 CHECK(GLOB != -777);
2419 FAST_MODE_INIT(&GLOB);
2420 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test49. TP. FN in MSMHelgrind.");
2425 printf("\tGLOB=%d\n", GLOB);
2433 int GLOB = 0;
2435 // Two last write accesses to GLOB are not synchronized
2440 // 3. MU.Lock() a. write(GLOB)
2447 // 6. write(GLOB) f. MU.Lock()
2448 // g. write(GLOB)
2455 GLOB = 1;
2464 GLOB = 3;
2480 GLOB = 2;
2483 FAST_MODE_INIT(&GLOB);
2484 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test50. TP.");
2487 printf("\tGLOB=%d\n", GLOB);
2495 int GLOB = 0;
2509 // 5. write(GLOB) \ a. write(GLOB)
2515 // f. write(GLOB)
2526 GLOB = 1;
2535 GLOB = 2;
2555 GLOB = 3;
2558 FAST_MODE_INIT(&GLOB);
2559 ANNOTATE_EXPECT_RACE(&GLOB, "test51. TP.");
2562 printf("\tGLOB=%d\n", GLOB);
2570 int GLOB = 0;
2579 // a. write(GLOB)
2588 // 4. MU.Unlock() \ f. write(GLOB)
2589 // 5. write(GLOB) \ .
2597 GLOB = 1;
2606 GLOB = 2;
2626 GLOB = 3;
2629 FAST_MODE_INIT(&GLOB);
2630 ANNOTATE_EXPECT_RACE(&GLOB, "test52. TP.");
2633 printf("\tGLOB=%d\n", GLOB);
2650 // 2. write(GLOB)
2658 // f. write(GLOB)
2662 int GLOB = 0;
2668 GLOB = 1000;
2682 // at this point Initializer will not access GLOB again
2684 CHECK(GLOB >= 1000);
2685 GLOB++;
2690 FAST_MODE_INIT(&GLOB);
2692 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test53. FP. Implicit semaphore");
2697 printf("\tGLOB=%d\n", GLOB);
2706 int GLOB = 0;
2712 GLOB = 1000;
2714 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
2727 // at this point Initializer will not access GLOB again
2728 ANNOTATE_CONDVAR_WAIT(&GLOB);
2730 CHECK(GLOB >= 1000);
2731 GLOB++;
2740 printf("\tGLOB=%d\n", GLOB);
2753 int GLOB = 0;
2757 GLOB = 1;
2771 GLOB = 2;
2779 printf("\tGLOB=%d\n", GLOB);
2789 // a race on GLOB as a benign race.
2790 int GLOB = 0;
2794 GLOB++;
2798 ANNOTATE_BENIGN_RACE(&GLOB, "test56. Use of ANNOTATE_BENIGN_RACE.");
2804 printf("\tGLOB=%d\n", GLOB);
2812 int GLOB = 0;
2815 AtomicIncrement(&GLOB, 1);
2820 while (GLOB < 20) usleep(1000);
2827 CHECK(GLOB == 20);
2828 printf("\tGLOB=%d\n", GLOB);
2975 int GLOB = 0;
2986 P1 = &GLOB;
3012 printf("\tGLOB=%d\n", GLOB);
3083 // 1. read(GLOB) (sleep)
3084 // a. read(GLOB)
3086 // B. write(GLOB)
3090 int GLOB = 0;
3094 CHECK(GLOB == 0);
3099 CHECK(GLOB == 0);
3105 GLOB = 1;
3110 FAST_MODE_INIT(&GLOB);
3111 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test64: TP.");
3116 printf("\tGLOB=%d\n", GLOB);
3129 // 2. write(GLOB)
3132 // b. write(GLOB)
3135 // B. write(GLOB)
3139 int GLOB = 0;
3145 GLOB++;
3152 GLOB++;
3159 GLOB = 1;
3164 FAST_MODE_INIT(&GLOB);
3166 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test65. TP.");
3171 printf("\tGLOB=%d\n", GLOB);
3236 int GLOB = 0;
3242 GLOB = 1;
3269 GLOB = 2;
3273 FAST_MODE_INIT(&GLOB);
3274 ANNOTATE_EXPECT_RACE(&GLOB, "test67. FN. Race between Signaller1 and Waiter2");
3279 printf("\tGLOB=%d\n", GLOB);
3287 // In this test, all writes to GLOB are protected by a mutex
3292 int GLOB = 0;
3300 GLOB++;
3313 CHECK(GLOB >= 0);
3325 FAST_MODE_INIT(&GLOB);
3326 ANNOTATE_EXPECT_RACE(&GLOB, "TP. Writes are protected, reads are not.");
3331 printf("\tGLOB=%d\n", GLOB);
3340 // We do not want to annotate GLOB as a benign race
3344 int GLOB = 0;
3353 GLOB++;
3367 CHECK(GLOB >= 0);
3384 printf("\tGLOB=%d\n", GLOB);
3391 int GLOB = 0;
3394 ANNOTATE_TRACE_MEMORY(&GLOB);
3395 GLOB = 1;
3396 printf("\tGLOB=%d\n", GLOB);
3461 int GLOB = 0;
3472 int n = ++GLOB;
3529 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3541 int GLOB = 0;
3563 int n = ++GLOB;
3621 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3645 int GLOB = 0;
3649 GLOB = 1;
3656 CHECK(GLOB==1);
3661 CHECK(GLOB==1);
3675 GLOB = 2;
3681 printf("\tGLOB=%d\n", GLOB);
3763 int GLOB = 0;
3790 int GLOB = 0;
3817 int GLOB = 0;
3942 int GLOB = 0;
3968 int GLOB = 0;
4133 int GLOB = 0;
4301 int GLOB = 0;
4304 GLOB = 1;
4311 GLOB = 1;
4313 printf("\tGLOB=%d\n", GLOB);
4399 int *GLOB = 0;
4404 GLOB = (int*)memalign(64, sizeof(int));
4405 *GLOB = 777;
4407 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test90. FP. This is a false positve");
4416 int *p = GLOB;
4430 printf("\t*GLOB=%d\n", *GLOB);
4431 free(GLOB);
4446 int *GLOB = 0;
4451 GLOB = (int*)memalign(64, sizeof(int));
4452 *GLOB = 777;
4454 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test91. FP. This is a false positve");
4462 int *p = GLOB;
4479 printf("\t*GLOB=%d\n", *GLOB);
4480 free(GLOB);
4494 // 2. Create GLOB.
4495 // 3. ANNOTATE_PUBLISH_...(GLOB) -------\ .
4498 // \ b. Get GLOB
4500 // \--> d. Access GLOB
4503 // accesses to GLOB.
4509 ObjType *GLOB = 0;
4514 GLOB = new ObjType;
4516 GLOB->arr[i] = 777;
4519 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB, sizeof(*GLOB));
4526 ObjType *p = GLOB;
4547 printf("\t*GLOB=%d\n", GLOB->arr[0]);
4555 int GLOB = 0;
4558 CHECK(GLOB == 0);
4564 ANNOTATE_PUBLISH_MEMORY_RANGE(&GLOB, sizeof(GLOB));
4572 printf("\tGLOB=%d\n", GLOB);
4580 int GLOB;
4590 GLOB = 1; // WRITE
4617 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4620 FAST_MODE_INIT(&GLOB);
4621 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test94: TP.");
4626 printf("\tGLOB=%d\n", GLOB);
4633 int GLOB = 0;
4644 GLOB = 1; // WRITE
4670 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4673 FAST_MODE_INIT(&GLOB);
4674 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test95: TP.");
4679 printf("\tGLOB=%d\n", GLOB);
4689 int GLOB = 0;
4696 GLOB++;
4702 GLOB++;
4708 GLOB++;
4713 ANNOTATE_TRACE_MEMORY(&GLOB);
4717 CHECK(GLOB == 3);
4718 printf("\tGLOB=%d\n", GLOB);
4731 int * GLOB = &array[ARRAY_SIZE/2];
4733 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4739 CHECK(777 == *GLOB);
4745 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test97: TP. FN with --fast-mode=yes");
4749 *GLOB = 777;
4768 int GLOB = 0;
4774 GLOB = 1;
4784 GLOB = 2;
4808 printf("\tGLOB=%d\n", GLOB);
4823 bool GLOB = false;
4828 mu.LockWhenWithTimeout(Condition(&ArgIsTrue, &GLOB), 5);
4829 GLOB = false;
4898 int GLOB = 0;
4910 GLOB = 1;
4933 GLOB = 2;
4942 printf("\tGLOB=%d\n", GLOB);
4955 int * GLOB = &array[ARRAY_SIZE/2];
4957 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4963 CHECK(777 == GLOB[0]);
4965 CHECK(777 == GLOB[1]);
4971 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+0, "test102: TP. FN with --fast-mode=yes");
4972 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+1, "test102: TP");
4976 GLOB[0] = 777;
4978 GLOB[1] = 777;
5025 int *GLOB = NULL;
5027 *GLOB = 1;
5034 *GLOB = 2;
5038 GLOB = (int*)memalign(64, sizeof(int));
5039 *GLOB = 0;
5040 ANNOTATE_EXPECT_RACE(GLOB, "test104. TP.");
5041 ANNOTATE_TRACE_MEMORY(GLOB);
5044 printf("\tGLOB=%d\n", *GLOB);
5045 free(GLOB);
5053 int GLOB = 0;
5078 printf("\tGLOB=%d\n", GLOB);
5086 int *GLOB = NULL;
5089 GLOB = new int;
5090 ANNOTATE_TRACE_MEMORY(GLOB);
5091 *GLOB = 777;
5100 CHECK(*GLOB == 777);
5109 printf("\tGLOB=%d\n", *GLOB);
5117 int GLOB = 0;
5120 ANNOTATE_EXPECT_RACE(&GLOB, "No race in fact. Just checking the tool.");
5121 printf("\tGLOB=%d\n", GLOB);
5180 static int GLOB[N];
5184 // printf("--Worker : %ld %p\n", (int*)a - GLOB, (void*)pthread_self());
5193 t[i] = new MyThread(Worker, &GLOB[i]);
5196 ANNOTATE_TRACE_MEMORY(&GLOB[i]);
5197 GLOB[i] = 1;
5205 GLOB[i]++;
5209 printf("\tGLOB=%d\n", GLOB[13]);
5217 int GLOB = 0;
5235 GLOB++;
5272 FAST_MODE_INIT(&GLOB);
5273 ANNOTATE_EXPECT_RACE(&GLOB, "real race on global object");
5303 CHECK(GLOB <= 3);
5323 char *GLOB = 0;
5380 char *GLOB = 0;
5403 GLOB[i]++;
5413 ANNOTATE_NEW_MEMORY(GLOB + b, e - b);
5414 ANNOTATE_TRACE_MEMORY(GLOB + b);
5416 GLOB[j] = 0;
5418 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB + b, e - b);
5432 GLOB = new char [N];
5452 printf("GLOB = %d\n", (int)GLOB[0]);
5508 int GLOB = 0;
5525 GLOB = 1;
5536 CHECK(GLOB == 1);
5635 int GLOB = 0;
5639 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
5643 ANNOTATE_CONDVAR_WAIT(&GLOB);
5653 printf("\tGLOB=%d\n", GLOB);
5661 int GLOB = 0;
5663 GLOB = 1;
5669 GLOB = 2;
5673 FAST_MODE_INIT(&GLOB);
5675 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true race");
5679 printf("\tGLOB=%d\n", GLOB);
5687 int GLOB = 0;
5690 GLOB = 1; // write
5691 CHECK(GLOB); // read
5696 CHECK(GLOB >= 0); // read
5700 FAST_MODE_INIT(&GLOB);
5701 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "TP (T1: write then read, T2: read)");
5704 GLOB = 1;
5707 printf("\tGLOB=%d\n", GLOB);
5943 int GLOB = 0;
5952 GLOB = 1;
5960 printf("\tGLOB=%d\n", GLOB);
5970 // (GLOB[thread_num]) and we take a *writer* lock when we
5980 int GLOB[n_threads];
5988 GLOB[my_num]++;
5996 sum += GLOB[i];
6029 int GLOB = 0;
6032 CHECK(GLOB == 0);
6041 GLOB = 1;
6043 printf("\tGLOB=%d\n", GLOB);
6072 int GLOB = 0;
6076 GLOB++;
6080 GLOB++;
6093 int GLOB = 0;
6096 *param = GLOB; // a write into Waiter's memory
6097 return GLOB > 0;
6103 CHECK(GLOB > 0);
6109 GLOB++;
6118 printf("\tGLOB=%d\n", GLOB);
6201 int GLOB = 0;
6202 void Worker() { GLOB = 1; }
6205 FAST_MODE_INIT(&GLOB);
6206 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test132");
6207 printf("test132: positive; &GLOB=%p\n", &GLOB);
6208 ANNOTATE_TRACE_MEMORY(&GLOB);
6209 GLOB = 7;
6226 int GLOB = 0;
6227 void Worker() { GLOB = 1; }
6230 FAST_MODE_INIT(&GLOB);
6231 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test133");
6232 printf("test133: positive; &GLOB=%p\n", &GLOB);
6233 ANNOTATE_TRACE_MEMORY(&GLOB);
6234 GLOB = 7;
6348 int GLOB = 0;
6377 int GLOB = 0;
6381 GLOB++;
6385 FAST_MODE_INIT(&GLOB);
6405 int GLOB = 0;
6409 GLOB++; // First access.
6416 GLOB++; // Second access.
6420 FAST_MODE_INIT(&GLOB);
6646 // We have a race on GLOB between Putter and one of the Getters.
6651 int GLOB = 0;
6656 GLOB = 1;
6663 CHECK(GLOB == 1); // Race here
6669 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true races");
6684 int GLOB = 0;
6721 // In this test we have many different accesses to GLOB and only one access
6723 int GLOB = 0;
6732 MU1.Lock(); CHECK(GLOB >= 0); MU1.Unlock();
6736 MU2.Lock(); CHECK(GLOB >= 0); MU2.Unlock();
6740 MU1.Lock(); CHECK(GLOB >= 0); MU1.Unlock();
6744 MU1.Lock(); GLOB++; MU1.Unlock();
6766 int GLOB = 0;
6769 void Worker1() { CHECK(GLOB >= 0); }
6770 void Worker2() { MU.Lock(); GLOB=1; MU.Unlock();}
6774 ANNOTATE_TRACE_MEMORY(&GLOB);
6827 int GLOB = 0;
6829 // In this test GLOB is protected by MU1 and MU2, but inconsistently.
6837 // which mutex is supposed to protect GLOB.
6840 void Worker1() { MU1.Lock(); MU2.Lock(); GLOB=1; MU2.Unlock(); MU1.Unlock(); }
6841 void Worker2() { MU1.Lock(); GLOB=2; MU1.Unlock(); }
6842 void Worker3() { MU1.Lock(); MU2.Lock(); GLOB=3; MU2.Unlock(); MU1.Unlock(); }
6843 void Worker4() { MU2.Lock(); GLOB=4; MU2.Unlock(); }
6846 ANNOTATE_TRACE_MEMORY(&GLOB);
6860 int GLOB = 0;
6866 void Worker1() { MU1.Lock(); MU2.Lock(); GLOB=1; MU2.Unlock(); MU1.Unlock(); }
6867 void Worker2() { MU1.Lock(); MU2.Lock(); GLOB=3; MU2.Unlock(); MU1.Unlock(); }
6868 void Worker3() { GLOB=4; }
6871 ANNOTATE_TRACE_MEMORY(&GLOB);
6884 int *GLOB = 0;
6898 (*GLOB)++; // "--keep-history=2" will point here (experimental).
6911 GLOB = new int;
6912 *GLOB = 1;
6965 string GLOB;
6968 GLOB="Thread1";
6972 GLOB="Booooooooooo";
7114 int GLOB = 0;
7115 void RaceyWrite() { GLOB++; }
7148 int GLOB = 0;
7150 // Worker(N) will do 2^N increments of GLOB, each increment in a separate thread
7159 GLOB++; // Race here
7165 printf("\tGLOB=%d\n", GLOB);
7294 int GLOB = 0;
7306 GLOB++;
7352 int GLOB = 0;
7357 GLOB++;
7396 int GLOB[ARRAY_SIZE];
7409 GLOB[i]++;
7411 if (myId == 0 && GLOB[0] > GLOB_limit) {
7416 nextQ.Put(GLOB);
7424 Q[0]->Put(GLOB);
7545 int GLOB = 0;
7554 GLOB++;
7571 CHECK(GLOB == N_threads * ITERATIONS);
7696 int GLOB = 0;
7702 GLOB++;
7708 //ANNOTATE_BENIGN_RACE(&GLOB, "Test");
7723 int GLOB = 0;
7727 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
7729 GLOB++;
7730 ANNOTATE_CONDVAR_WAIT(&GLOB);
7740 int GLOB = 0;
7748 GLOB++;