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;
340 GLOB = 2;
344 FAST_MODE_INIT(&GLOB);
345 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test01. TP.");
346 ANNOTATE_TRACE_MEMORY(&GLOB);
349 const int tmp = GLOB;
358 int GLOB = 0;
359 // Two write accesses to GLOB are synchronized because
365 // 3. MU.Lock() a. write(GLOB)
372 // 6. write(GLOB)
377 GLOB = 1;
394 GLOB = 2;
399 printf("\tGLOB=%d\n", GLOB);
407 int GLOB = 0;
408 // Two write accesses to GLOB are synchronized via conditional critical section.
414 // a. write(GLOB)
420 // 5. write(GLOB)
425 GLOB = 1;
439 GLOB = 2;
444 printf("\tGLOB=%d\n", GLOB);
451 int GLOB = 0;
453 // Two write accesses to GLOB are separated by PCQ Put/Get.
456 // 1. write(GLOB)
459 // b. write(GLOB)
463 GLOB = 1;
469 GLOB = 2;
477 printf("\tGLOB=%d\n", GLOB);
486 int GLOB = 0;
487 // Two write accesses to GLOB are synchronized via CondVar.
495 // 3. MU.Lock() a. write(GLOB)
502 // 6. write(GLOB)
506 GLOB = 1;
523 GLOB = 2;
526 FAST_MODE_INIT(&GLOB);
528 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test05. FP. Unavoidable in hybrid scheme.");
531 printf("\tGLOB=%d\n", GLOB);
539 int GLOB = 0;
545 // 3. MU.Lock() a. write(GLOB)
553 // 6. write(GLOB)
558 GLOB = 1;
577 GLOB = 2;
582 printf("\tGLOB=%d\n", GLOB);
590 int GLOB = 0;
592 // Two write accesses to GLOB are synchronized via conditional critical section.
599 // a. write(GLOB)
605 // 5. write(GLOB)
609 GLOB = 1;
623 GLOB = 2; // If LockWhen didn't catch the signal, a race may be reported here.
629 printf("\tGLOB=%d\n", GLOB);
636 int GLOB = 0;
637 // Three accesses to GLOB are separated by thread start/join.
640 // 1. write(GLOB)
642 // a. write(GLOB)
644 // 4. write(GLOB)
646 GLOB = 2;
651 GLOB = 1;
654 GLOB = 3;
659 printf("\tGLOB=%d\n", GLOB);
667 int GLOB = 0;
673 GLOB = 3;
676 CHECK(GLOB != -777);
680 ANNOTATE_TRACE_MEMORY(&GLOB);
681 FAST_MODE_INIT(&GLOB);
682 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test09. TP.");
687 printf("\tGLOB=%d\n", GLOB);
695 int GLOB = 0;
701 // 1. write(GLOB) a. sleep(long enough so that GLOB
703 // b. read(GLOB)
710 GLOB = 3;
714 CHECK(GLOB != -777);
718 FAST_MODE_INIT(&GLOB);
719 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test10. TP. FN in MSMHelgrind.");
724 printf("\tGLOB=%d\n", GLOB);
735 // 1. Start(workers) a. read(GLOB)
740 // 5. write(GLOB)
743 int GLOB = 0;
747 CHECK(GLOB != 777);
767 GLOB = 2;
773 // ANNOTATE_EXPECT_RACE(&GLOB, "test11. FP. Fixed by MSMProp1.");
776 printf("\tGLOB=%d\n", GLOB);
784 int GLOB = 0;
788 // First, we write to GLOB under MU, then we synchronize via PCQ,
793 // 2. write(GLOB) <---- MU ----> b. write(GLOB)
796 // e. write(GLOB)
803 GLOB++;
811 GLOB++;
815 GLOB++;
819 // ANNOTATE_EXPECT_RACE(&GLOB, "test12. FP. Fixed by MSMProp1.");
824 printf("\tGLOB=%d\n", GLOB);
832 int GLOB = 0;
838 // 2. write(GLOB) <---------- MU ----------> b. write(GLOB)
846 // f. write(GLOB)
851 GLOB++;
862 GLOB++;
867 GLOB++;
871 // ANNOTATE_EXPECT_RACE(&GLOB, "test13. FP. Fixed by MSMProp1.");
879 printf("\tGLOB=%d\n", GLOB);
887 int GLOB = 0;
894 // 1. read(GLOB) a. read(GLOB)
898 // C. write(GLOB)
902 CHECK(GLOB != 777);
906 CHECK(GLOB != 777);
912 GLOB++;
915 // ANNOTATE_EXPECT_RACE(&GLOB, "test14. FP. Fixed by MSMProp1.");
920 printf("\tGLOB=%d\n", GLOB);
929 // 1. write(GLOB)
934 // c. read(GLOB)
936 int GLOB = 0;
940 GLOB = 2;
951 CHECK(GLOB != 777);
961 printf("\tGLOB=%d\n", GLOB);
971 // 2. write(GLOB) <------------ MU ----------> b. write(GLOB)
978 // 9. read(GLOB) h. MU2.Unlock()
979 // i. read(GLOB)
988 int GLOB = 0;
994 GLOB++;
1003 CHECK(GLOB == 2);
1007 // ANNOTATE_EXPECT_RACE(&GLOB, "test16. FP. Fixed by MSMProp1 + Barrier support.");
1013 printf("\tGLOB=%d\n", GLOB);
1022 int GLOB = 0;
1028 GLOB++;
1037 CHECK(GLOB == 3);
1041 // ANNOTATE_EXPECT_RACE(&GLOB, "test17. FP. Fixed by MSMProp1 + Barrier support.");
1047 printf("\tGLOB=%d\n", GLOB);
1055 int GLOB = 0;
1061 GLOB = 1;
1077 GLOB = 2;
1082 printf("\tGLOB=%d\n", GLOB);
1089 int GLOB = 0;
1094 GLOB = 1;
1110 GLOB = 2;
1115 printf("\tGLOB=%d\n", GLOB);
1122 int GLOB = 0;
1126 GLOB = 1;
1139 GLOB = 2;
1142 FAST_MODE_INIT(&GLOB);
1143 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test20. TP.");
1146 printf("\tGLOB=%d\n", GLOB);
1153 int GLOB = 0;
1157 GLOB = 1;
1169 GLOB = 2;
1172 FAST_MODE_INIT(&GLOB);
1173 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test21. TP.");
1176 printf("\tGLOB=%d\n", GLOB);
1183 int GLOB = 0;
1187 GLOB = 1;
1205 GLOB = 2;
1208 FAST_MODE_INIT(&GLOB);
1209 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test22. TP.");
1212 printf("\tGLOB=%d\n", GLOB);
1220 int GLOB = 0;
1226 GLOB++;
1239 CHECK(GLOB != 777);
1251 CHECK(GLOB != 777);
1260 GLOB++;
1275 printf("\tGLOB=%d\n", GLOB);
1282 int GLOB = 0;
1288 GLOB = 1;
1302 GLOB = 2;
1307 printf("\tGLOB=%d\n", GLOB);
1314 int GLOB = 0;
1321 GLOB = 1;
1335 GLOB = 2;
1340 printf("\tGLOB=%d\n", GLOB);
1347 int GLOB = 0;
1352 GLOB = 1;
1363 GLOB = 2;
1366 FAST_MODE_INIT(&GLOB);
1367 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test26. TP");
1370 printf("\tGLOB=%d\n", GLOB);
1379 int GLOB = 0;
1383 GLOB++;
1393 printf("\tGLOB=%d\n", GLOB);
1404 // 2. write(GLOB) B. write(GLOB)
1408 // 6. read(GLOB) b. Q.Get() <---------/ F. read(GLOB)
1410 // c. read(GLOB)
1412 int GLOB = 0;
1417 GLOB++;
1423 CHECK(GLOB != 777);
1431 CHECK(GLOB == 2);
1439 printf("\tGLOB=%d\n", GLOB);
1450 int GLOB = 0;
1454 GLOB++;
1461 CHECK(GLOB != 777);
1473 CHECK(GLOB == 2);
1484 printf("\tGLOB=%d\n", GLOB);
1498 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1500 // 3. BOUNDARY++; c. read(GLOB[i]: i < n)
1503 // no actual races on accesses to GLOB[]:
1504 // Writer writes to GLOB[i] where i>=BOUNDARY and then increments BOUNDARY.
1505 // Readers read BOUNDARY and read GLOB[i] where i<BOUNDARY.
1508 // accesses to GLOB since compilers and CPUs
1515 static int GLOB[N];
1522 GLOB[j] = j;
1537 CHECK(GLOB[i] == i);
1550 printf("\tGLOB=%d\n", GLOB[N-1]);
1562 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1564 // 3. BOUNDARY++; c. write(GLOB[i]: i < n)
1568 static int GLOB[N];
1575 GLOB[j] = j;
1590 if(GLOB[i] == i) {
1591 GLOB[i]++;
1605 printf("\tGLOB=%d\n", GLOB[N-1]);
1620 // b. write(GLOB)
1624 // C. read(GLOB)
1627 // 5. write(GLOB)
1633 int GLOB = 0;
1638 GLOB = 1;
1645 CHECK(GLOB != 777);
1658 GLOB = 2;
1662 // ANNOTATE_EXPECT_RACE(&GLOB, "test32. FP. Fixed by MSMProp1.");
1665 printf("\tGLOB=%d\n", GLOB);
1674 int GLOB = 0;
1686 int n = ++GLOB;
1720 GLOB, ARR[1], ARR[7], ARR[N-1]);
1729 int GLOB = 0;
1759 printf("\tGLOB=%d\n", GLOB);
1819 // 2. write(GLOB) B. write(GLOB)
1824 // 7. write(GLOB) G. write(GLOB)
1828 // d. write(GLOB)
1831 int GLOB = 0;
1836 GLOB++;
1843 GLOB++;
1853 GLOB++;
1862 printf("\tGLOB=%d\n", GLOB);
1870 int GLOB = 0;
1883 GLOB = 3;
1889 CHECK(GLOB != -777);
1898 printf("\tGLOB=%d\n", GLOB);
1910 // write(GLOB) write(GLOB)
1916 // write(GLOB) write(GLOB)
1922 // write(GLOB) write(GLOB)
1928 int GLOB = 0;
1933 GLOB++;
1941 GLOB++;
1956 GLOB++;
1969 printf("\tGLOB=%d\n", GLOB);
1980 int GLOB = 0;
1987 GLOB++;
1990 CHECK(GLOB == N_threads);
1993 ANNOTATE_TRACE_MEMORY(&GLOB);
1994 // ANNOTATE_EXPECT_RACE(&GLOB, "test39. FP. Fixed by MSMProp1. Barrier.");
2003 printf("\tGLOB=%d\n", GLOB);
2016 // write(GLOB) write(GLOB)
2023 // write(GLOB) write(GLOB)
2028 // write(GLOB) write(GLOB)
2034 int GLOB = 0;
2039 GLOB++;
2048 GLOB++;
2062 GLOB++;
2069 // ANNOTATE_EXPECT_RACE(&GLOB, "test40. FP. Fixed by MSMProp1. Complex Stuff.");
2076 printf("\tGLOB=%d\n", GLOB);
2100 int GLOB = 0;
2106 GLOB=1;
2119 GLOB=3;
2131 GLOB=2;
2141 // ANNOTATE_EXPECT_RACE(&GLOB, "test42. TN. debugging.");
2146 printf("\tGLOB=%d\n", GLOB);
2161 int GLOB = 0;
2164 GLOB = 1;
2166 CHECK(GLOB == 1);
2171 CHECK(GLOB == 1);
2178 printf("\tGLOB=%d\n", GLOB);
2196 int GLOB = 0;
2200 CHECK(GLOB == 0);
2203 GLOB = 1;
2210 GLOB = 1;
2214 // ANNOTATE_EXPECT_RACE(&GLOB, "test44. FP. Fixed by MSMProp1.");
2219 printf("\tGLOB=%d\n", GLOB);
2237 int GLOB = 0;
2241 CHECK(GLOB == 0);
2244 GLOB++;
2251 CHECK(GLOB <= 1);
2259 printf("\tGLOB=%d\n", GLOB);
2276 int GLOB = 0;
2279 GLOB++;
2281 GLOB++;
2287 GLOB++;
2294 printf("\tGLOB=%d\n", GLOB);
2298 ANNOTATE_TRACE_MEMORY(&GLOB);
2319 int GLOB = 0;
2322 GLOB=1;
2330 GLOB++;
2333 FAST_MODE_INIT(&GLOB);
2335 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test47. TP. Not detected by pure HB.");
2340 printf("\tGLOB=%d\n", GLOB);
2348 int GLOB = 0;
2355 // 1. write(GLOB) a. sleep(long enough so that GLOB
2357 // b. read(GLOB)
2364 GLOB = 3;
2368 CHECK(GLOB != -777);
2372 FAST_MODE_INIT(&GLOB);
2373 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test48. TP. FN in MSMHelgrind.");
2378 printf("\tGLOB=%d\n", GLOB);
2386 int GLOB = 0;
2392 // 1. write(GLOB) a. sleep(long enough so that GLOB
2394 // b. read(GLOB)
2395 // c. read(GLOB)
2396 // d. read(GLOB)
2397 // e. read(GLOB)
2404 GLOB = 3;
2408 CHECK(GLOB != -777);
2409 CHECK(GLOB != -777);
2410 CHECK(GLOB != -777);
2411 CHECK(GLOB != -777);
2415 FAST_MODE_INIT(&GLOB);
2416 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test49. TP. FN in MSMHelgrind.");
2421 printf("\tGLOB=%d\n", GLOB);
2429 int GLOB = 0;
2431 // Two last write accesses to GLOB are not synchronized
2436 // 3. MU.Lock() a. write(GLOB)
2443 // 6. write(GLOB) f. MU.Lock()
2444 // g. write(GLOB)
2451 GLOB = 1;
2460 GLOB = 3;
2476 GLOB = 2;
2479 FAST_MODE_INIT(&GLOB);
2480 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test50. TP.");
2483 printf("\tGLOB=%d\n", GLOB);
2491 int GLOB = 0;
2505 // 5. write(GLOB) \ a. write(GLOB)
2511 // f. write(GLOB)
2522 GLOB = 1;
2531 GLOB = 2;
2551 GLOB = 3;
2554 FAST_MODE_INIT(&GLOB);
2555 ANNOTATE_EXPECT_RACE(&GLOB, "test51. TP.");
2558 printf("\tGLOB=%d\n", GLOB);
2566 int GLOB = 0;
2575 // a. write(GLOB)
2584 // 4. MU.Unlock() \ f. write(GLOB)
2585 // 5. write(GLOB) \ .
2593 GLOB = 1;
2602 GLOB = 2;
2622 GLOB = 3;
2625 FAST_MODE_INIT(&GLOB);
2626 ANNOTATE_EXPECT_RACE(&GLOB, "test52. TP.");
2629 printf("\tGLOB=%d\n", GLOB);
2646 // 2. write(GLOB)
2654 // f. write(GLOB)
2658 int GLOB = 0;
2664 GLOB = 1000;
2678 // at this point Initializer will not access GLOB again
2680 CHECK(GLOB >= 1000);
2681 GLOB++;
2686 FAST_MODE_INIT(&GLOB);
2688 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test53. FP. Implicit semaphore");
2693 printf("\tGLOB=%d\n", GLOB);
2702 int GLOB = 0;
2708 GLOB = 1000;
2710 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
2723 // at this point Initializer will not access GLOB again
2724 ANNOTATE_CONDVAR_WAIT(&GLOB);
2726 CHECK(GLOB >= 1000);
2727 GLOB++;
2736 printf("\tGLOB=%d\n", GLOB);
2749 int GLOB = 0;
2753 GLOB = 1;
2767 GLOB = 2;
2775 printf("\tGLOB=%d\n", GLOB);
2785 // a race on GLOB as a benign race.
2786 int GLOB = 0;
2790 GLOB++;
2794 ANNOTATE_BENIGN_RACE(&GLOB, "test56. Use of ANNOTATE_BENIGN_RACE.");
2800 printf("\tGLOB=%d\n", GLOB);
2808 int GLOB = 0;
2811 AtomicIncrement(&GLOB, 1);
2816 while (GLOB < 20) usleep(1000);
2823 CHECK(GLOB == 20);
2824 printf("\tGLOB=%d\n", GLOB);
2971 int GLOB = 0;
2982 P1 = &GLOB;
3008 printf("\tGLOB=%d\n", GLOB);
3079 // 1. read(GLOB) (sleep)
3080 // a. read(GLOB)
3082 // B. write(GLOB)
3086 int GLOB = 0;
3090 CHECK(GLOB == 0);
3095 CHECK(GLOB == 0);
3101 GLOB = 1;
3106 FAST_MODE_INIT(&GLOB);
3107 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test64: TP.");
3112 printf("\tGLOB=%d\n", GLOB);
3125 // 2. write(GLOB)
3128 // b. write(GLOB)
3131 // B. write(GLOB)
3135 int GLOB = 0;
3141 GLOB++;
3148 GLOB++;
3155 GLOB = 1;
3160 FAST_MODE_INIT(&GLOB);
3162 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test65. TP.");
3167 printf("\tGLOB=%d\n", GLOB);
3232 int GLOB = 0;
3238 GLOB = 1;
3265 GLOB = 2;
3269 FAST_MODE_INIT(&GLOB);
3270 ANNOTATE_EXPECT_RACE(&GLOB, "test67. FN. Race between Signaller1 and Waiter2");
3275 printf("\tGLOB=%d\n", GLOB);
3283 // In this test, all writes to GLOB are protected by a mutex
3288 int GLOB = 0;
3296 GLOB++;
3309 CHECK(GLOB >= 0);
3321 FAST_MODE_INIT(&GLOB);
3322 ANNOTATE_EXPECT_RACE(&GLOB, "TP. Writes are protected, reads are not.");
3327 printf("\tGLOB=%d\n", GLOB);
3336 // We do not want to annotate GLOB as a benign race
3340 int GLOB = 0;
3349 GLOB++;
3363 CHECK(GLOB >= 0);
3380 printf("\tGLOB=%d\n", GLOB);
3387 int GLOB = 0;
3390 ANNOTATE_TRACE_MEMORY(&GLOB);
3391 GLOB = 1;
3392 printf("\tGLOB=%d\n", GLOB);
3457 int GLOB = 0;
3468 int n = ++GLOB;
3525 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3537 int GLOB = 0;
3559 int n = ++GLOB;
3617 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3641 int GLOB = 0;
3645 GLOB = 1;
3652 CHECK(GLOB==1);
3657 CHECK(GLOB==1);
3671 GLOB = 2;
3677 printf("\tGLOB=%d\n", GLOB);
3759 int GLOB = 0;
3786 int GLOB = 0;
3813 int GLOB = 0;
3938 int GLOB = 0;
3964 int GLOB = 0;
4129 int GLOB = 0;
4297 int GLOB = 0;
4300 GLOB = 1;
4307 GLOB = 1;
4309 printf("\tGLOB=%d\n", GLOB);
4395 int *GLOB = 0;
4400 GLOB = (int*)memalign(64, sizeof(int));
4401 *GLOB = 777;
4403 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test90. FP. This is a false positve");
4412 int *p = GLOB;
4426 printf("\t*GLOB=%d\n", *GLOB);
4427 free(GLOB);
4442 int *GLOB = 0;
4447 GLOB = (int*)memalign(64, sizeof(int));
4448 *GLOB = 777;
4450 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test91. FP. This is a false positve");
4458 int *p = GLOB;
4475 printf("\t*GLOB=%d\n", *GLOB);
4476 free(GLOB);
4490 // 2. Create GLOB.
4491 // 3. ANNOTATE_PUBLISH_...(GLOB) -------\ .
4494 // \ b. Get GLOB
4496 // \--> d. Access GLOB
4499 // accesses to GLOB.
4505 ObjType *GLOB = 0;
4510 GLOB = new ObjType;
4512 GLOB->arr[i] = 777;
4515 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB, sizeof(*GLOB));
4522 ObjType *p = GLOB;
4543 printf("\t*GLOB=%d\n", GLOB->arr[0]);
4551 int GLOB = 0;
4554 CHECK(GLOB == 0);
4560 ANNOTATE_PUBLISH_MEMORY_RANGE(&GLOB, sizeof(GLOB));
4568 printf("\tGLOB=%d\n", GLOB);
4576 int GLOB;
4586 GLOB = 1; // WRITE
4613 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4616 FAST_MODE_INIT(&GLOB);
4617 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test94: TP.");
4622 printf("\tGLOB=%d\n", GLOB);
4629 int GLOB = 0;
4640 GLOB = 1; // WRITE
4666 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4669 FAST_MODE_INIT(&GLOB);
4670 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test95: TP.");
4675 printf("\tGLOB=%d\n", GLOB);
4685 int GLOB = 0;
4692 GLOB++;
4698 GLOB++;
4704 GLOB++;
4709 ANNOTATE_TRACE_MEMORY(&GLOB);
4713 CHECK(GLOB == 3);
4714 printf("\tGLOB=%d\n", GLOB);
4727 int * GLOB = &array[ARRAY_SIZE/2];
4729 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4735 CHECK(777 == *GLOB);
4741 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "test97: TP. FN with --fast-mode=yes");
4745 *GLOB = 777;
4764 int GLOB = 0;
4770 GLOB = 1;
4780 GLOB = 2;
4804 printf("\tGLOB=%d\n", GLOB);
4819 bool GLOB = false;
4824 mu.LockWhenWithTimeout(Condition(&ArgIsTrue, &GLOB), 5);
4825 GLOB = false;
4894 int GLOB = 0;
4906 GLOB = 1;
4929 GLOB = 2;
4938 GLOB);
4951 int * GLOB = &array[ARRAY_SIZE/2];
4953 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4959 CHECK(777 == GLOB[0]);
4961 CHECK(777 == GLOB[1]);
4967 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+0, "test102: TP. FN with --fast-mode=yes");
4968 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+1, "test102: TP");
4972 GLOB[0] = 777;
4974 GLOB[1] = 777;
5021 int *GLOB = NULL;
5023 *GLOB = 1;
5030 *GLOB = 2;
5034 GLOB = (int*)memalign(64, sizeof(int));
5035 *GLOB = 0;
5036 ANNOTATE_EXPECT_RACE(GLOB, "test104. TP.");
5037 ANNOTATE_TRACE_MEMORY(GLOB);
5040 printf("\tGLOB=%d\n", *GLOB);
5041 free(GLOB);
5049 int GLOB = 0;
5074 printf("\tGLOB=%d\n", GLOB);
5082 int *GLOB = NULL;
5085 GLOB = new int;
5086 ANNOTATE_TRACE_MEMORY(GLOB);
5087 *GLOB = 777;
5096 CHECK(*GLOB == 777);
5105 printf("\tGLOB=%d\n", *GLOB);
5113 int GLOB = 0;
5116 ANNOTATE_EXPECT_RACE(&GLOB, "No race in fact. Just checking the tool.");
5117 printf("\tGLOB=%d\n", GLOB);
5176 static int GLOB[N];
5180 // printf("--Worker : %ld %p\n", (int*)a - GLOB, (void*)pthread_self());
5189 t[i] = new MyThread(Worker, &GLOB[i]);
5192 ANNOTATE_TRACE_MEMORY(&GLOB[i]);
5193 GLOB[i] = 1;
5201 GLOB[i]++;
5205 printf("\tGLOB=%d\n", GLOB[13]);
5213 int GLOB = 0;
5231 GLOB++;
5268 FAST_MODE_INIT(&GLOB);
5269 ANNOTATE_EXPECT_RACE(&GLOB, "real race on global object");
5299 CHECK(GLOB <= 3);
5319 char *GLOB = 0;
5376 char *GLOB = 0;
5399 GLOB[i]++;
5409 ANNOTATE_NEW_MEMORY(GLOB + b, e - b);
5410 ANNOTATE_TRACE_MEMORY(GLOB + b);
5412 GLOB[j] = 0;
5414 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB + b, e - b);
5428 GLOB = new char [N];
5448 printf("GLOB = %d\n", (int)GLOB[0]);
5504 int GLOB = 0;
5521 GLOB = 1;
5532 CHECK(GLOB == 1);
5631 int GLOB = 0;
5635 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
5639 ANNOTATE_CONDVAR_WAIT(&GLOB);
5649 printf("\tGLOB=%d\n", GLOB);
5657 int GLOB = 0;
5659 GLOB = 1;
5665 GLOB = 2;
5669 FAST_MODE_INIT(&GLOB);
5671 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true race");
5675 printf("\tGLOB=%d\n", GLOB);
5683 int GLOB = 0;
5686 GLOB = 1; // write
5687 CHECK(GLOB); // read
5692 CHECK(GLOB >= 0); // read
5696 FAST_MODE_INIT(&GLOB);
5697 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "TP (T1: write then read, T2: read)");
5700 GLOB = 1;
5703 printf("\tGLOB=%d\n", GLOB);
5939 int GLOB = 0;
5948 GLOB = 1;
5956 printf("\tGLOB=%d\n", GLOB);
5966 // (GLOB[thread_num]) and we take a *writer* lock when we
5976 int GLOB[n_threads];
5984 GLOB[my_num]++;
5992 sum += GLOB[i];
6025 int GLOB = 0;
6028 CHECK(GLOB == 0);
6037 GLOB = 1;
6039 printf("\tGLOB=%d\n", GLOB);
6068 int GLOB = 0;
6072 GLOB++;
6076 GLOB++;
6089 int GLOB = 0;
6092 *param = GLOB; // a write into Waiter's memory
6093 return GLOB > 0;
6099 CHECK(GLOB > 0);
6105 GLOB++;
6114 printf("\tGLOB=%d\n", GLOB);
6197 int GLOB = 0;
6198 void Worker() { GLOB = 1; }
6201 FAST_MODE_INIT(&GLOB);
6202 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test132");
6203 printf("test132: positive; &GLOB=%p\n", &GLOB);
6204 ANNOTATE_TRACE_MEMORY(&GLOB);
6205 GLOB = 7;
6222 int GLOB = 0;
6223 void Worker() { GLOB = 1; }
6226 FAST_MODE_INIT(&GLOB);
6227 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test133");
6228 printf("test133: positive; &GLOB=%p\n", &GLOB);
6229 ANNOTATE_TRACE_MEMORY(&GLOB);
6230 GLOB = 7;
6344 int GLOB = 0;
6373 int GLOB = 0;
6377 GLOB++;
6381 FAST_MODE_INIT(&GLOB);
6401 int GLOB = 0;
6405 GLOB++; // First access.
6412 GLOB++; // Second access.
6416 FAST_MODE_INIT(&GLOB);
6642 // We have a race on GLOB between Putter and one of the Getters.
6647 int GLOB = 0;
6652 GLOB = 1;
6659 CHECK(GLOB == 1); // Race here
6665 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true races");
6680 int GLOB = 0;
6717 // In this test we have many different accesses to GLOB and only one access
6719 int GLOB = 0;
6728 MU1.Lock(); CHECK(GLOB >= 0); MU1.Unlock();
6732 MU2.Lock(); CHECK(GLOB >= 0); MU2.Unlock();
6736 MU1.Lock(); CHECK(GLOB >= 0); MU1.Unlock();
6740 MU1.Lock(); GLOB++; MU1.Unlock();
6762 int GLOB = 0;
6765 void Worker1() { CHECK(GLOB >= 0); }
6766 void Worker2() { MU.Lock(); GLOB=1; MU.Unlock();}
6770 ANNOTATE_TRACE_MEMORY(&GLOB);
6823 int GLOB = 0;
6825 // In this test GLOB is protected by MU1 and MU2, but inconsistently.
6833 // which mutex is supposed to protect GLOB.
6836 void Worker1() { MU1.Lock(); MU2.Lock(); GLOB=1; MU2.Unlock(); MU1.Unlock(); }
6837 void Worker2() { MU1.Lock(); GLOB=2; MU1.Unlock(); }
6838 void Worker3() { MU1.Lock(); MU2.Lock(); GLOB=3; MU2.Unlock(); MU1.Unlock(); }
6839 void Worker4() { MU2.Lock(); GLOB=4; MU2.Unlock(); }
6842 ANNOTATE_TRACE_MEMORY(&GLOB);
6856 int GLOB = 0;
6862 void Worker1() { MU1.Lock(); MU2.Lock(); GLOB=1; MU2.Unlock(); MU1.Unlock(); }
6863 void Worker2() { MU1.Lock(); MU2.Lock(); GLOB=3; MU2.Unlock(); MU1.Unlock(); }
6864 void Worker3() { GLOB=4; }
6867 ANNOTATE_TRACE_MEMORY(&GLOB);
6880 int *GLOB = 0;
6894 (*GLOB)++; // "--keep-history=2" will point here (experimental).
6907 GLOB = new int;
6908 *GLOB = 1;
6961 string GLOB;
6964 GLOB="Thread1";
6968 GLOB="Booooooooooo";
7110 int GLOB = 0;
7111 void RaceyWrite() { GLOB++; }
7144 int GLOB = 0;
7146 // Worker(N) will do 2^N increments of GLOB, each increment in a separate thread
7155 GLOB++; // Race here
7161 printf("\tGLOB=%d\n", GLOB);
7290 int GLOB = 0;
7302 GLOB++;
7348 int GLOB = 0;
7353 GLOB++;
7392 int GLOB[ARRAY_SIZE];
7405 GLOB[i]++;
7407 if (myId == 0 && GLOB[0] > GLOB_limit) {
7412 nextQ.Put(GLOB);
7420 Q[0]->Put(GLOB);
7541 int GLOB = 0;
7550 GLOB++;
7567 CHECK(GLOB == N_threads * ITERATIONS);
7692 int GLOB = 0;
7698 GLOB++;
7704 //ANNOTATE_BENIGN_RACE(&GLOB, "Test");
7719 int GLOB = 0;
7723 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
7725 GLOB++;
7726 ANNOTATE_CONDVAR_WAIT(&GLOB);
7736 int GLOB = 0;
7744 GLOB++;