Home | History | Annotate | Download | only in unittest

Lines Matching defs:GLOB

82 int     GLOB = 0;
85 printf("\tGLOB=%d\n", GLOB);
93 int GLOB = 0;
96 GLOB = 1;
100 GLOB = 2;
104 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test01. TP.");
105 ANNOTATE_TRACE_MEMORY(&GLOB);
110 printf("\tGLOB=%d\n", GLOB);
118 int GLOB = 0;
119 // Two write accesses to GLOB are synchronized because
125 // 3. MU.Lock() a. write(GLOB)
132 // 6. write(GLOB)
137 GLOB = 1;
154 GLOB = 2;
159 printf("\tGLOB=%d\n", GLOB);
167 int GLOB = 0;
168 // Two write accesses to GLOB are synchronized via conditional critical section.
174 // a. write(GLOB)
180 // 5. write(GLOB)
185 GLOB = 1;
199 GLOB = 2;
204 printf("\tGLOB=%d\n", GLOB);
211 int GLOB = 0;
213 // Two write accesses to GLOB are separated by PCQ Put/Get.
216 // 1. write(GLOB)
219 // b. write(GLOB)
223 GLOB = 1;
229 GLOB = 2;
237 printf("\tGLOB=%d\n", GLOB);
246 int GLOB = 0;
247 // Two write accesses to GLOB are synchronized via CondVar.
255 // 3. MU.Lock() a. write(GLOB)
262 // 6. write(GLOB)
266 GLOB = 1;
279 GLOB = 2;
285 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test05. FP. Unavoidable in hybrid scheme.");
289 printf("\tGLOB=%d\n", GLOB);
297 int GLOB = 0;
303 // 3. MU.Lock() a. write(GLOB)
311 // 6. write(GLOB)
316 GLOB = 1;
335 GLOB = 2;
340 printf("\tGLOB=%d\n", GLOB);
348 int GLOB = 0;
350 // Two write accesses to GLOB are synchronized via conditional critical section.
357 // a. write(GLOB)
363 // 5. write(GLOB)
367 GLOB = 1;
381 GLOB = 2; // If LockWhen didn't catch the signal, a race may be reported here.
387 printf("\tGLOB=%d\n", GLOB);
394 int GLOB = 0;
395 // Three accesses to GLOB are separated by thread start/join.
398 // 1. write(GLOB)
400 // a. write(GLOB)
402 // 4. write(GLOB)
404 GLOB = 2;
409 GLOB = 1;
412 GLOB = 3;
417 printf("\tGLOB=%d\n", GLOB);
425 int GLOB = 0;
431 GLOB = 3;
434 CHECK(GLOB != -777);
438 ANNOTATE_TRACE_MEMORY(&GLOB);
439 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test09. TP.");
444 printf("\tGLOB=%d\n", GLOB);
452 int GLOB = 0;
458 // 1. write(GLOB) a. sleep(long enough so that GLOB
460 // b. read(GLOB)
467 GLOB = 3;
471 CHECK(GLOB != -777);
475 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test10. TP. FN in MSMHelgrind.");
480 printf("\tGLOB=%d\n", GLOB);
488 int GLOB = 0;
492 // First, we write to GLOB under MU, then we synchronize via PCQ,
497 // 2. write(GLOB) <---- MU ----> b. write(GLOB)
500 // e. write(GLOB)
507 GLOB++;
515 GLOB++;
519 GLOB++;
523 // ANNOTATE_EXPECT_RACE(&GLOB, "test12. FP. Fixed by MSMProp1.");
528 printf("\tGLOB=%d\n", GLOB);
536 int GLOB = 0;
542 // 2. write(GLOB) <---------- MU ----------> b. write(GLOB)
550 // f. write(GLOB)
555 GLOB++;
566 GLOB++;
571 GLOB++;
575 // ANNOTATE_EXPECT_RACE(&GLOB, "test13. FP. Fixed by MSMProp1.");
583 printf("\tGLOB=%d\n", GLOB);
591 int GLOB = 0;
598 // 1. read(GLOB) a. read(GLOB)
602 // C. write(GLOB)
606 CHECK(GLOB != 777);
610 CHECK(GLOB != 777);
616 GLOB++;
619 // ANNOTATE_EXPECT_RACE(&GLOB, "test14. FP. Fixed by MSMProp1.");
624 printf("\tGLOB=%d\n", GLOB);
633 // 1. write(GLOB)
638 // c. read(GLOB)
640 int GLOB = 0;
644 GLOB = 2;
655 CHECK(GLOB != 777);
665 printf("\tGLOB=%d\n", GLOB);
675 // 2. write(GLOB) <------------ MU ----------> b. write(GLOB)
682 // 9. read(GLOB) h. MU2.Unlock()
683 // i. read(GLOB)
692 int GLOB = 0;
698 GLOB++;
707 CHECK(GLOB == 2);
711 // ANNOTATE_EXPECT_RACE(&GLOB, "test16. FP. Fixed by MSMProp1 + Barrier support.");
717 printf("\tGLOB=%d\n", GLOB);
726 int GLOB = 0;
732 GLOB++;
741 CHECK(GLOB == 3);
750 printf("\tGLOB=%d\n", GLOB);
758 int GLOB = 0;
764 GLOB = 1;
780 GLOB = 2;
785 printf("\tGLOB=%d\n", GLOB);
792 int GLOB = 0;
797 GLOB = 1;
813 GLOB = 2;
818 printf("\tGLOB=%d\n", GLOB);
825 int GLOB = 0;
829 GLOB = 1;
837 GLOB = 2;
842 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test20. TP.");
846 printf("\tGLOB=%d\n", GLOB);
853 int GLOB = 0;
857 GLOB = 1;
864 GLOB = 2;
869 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test21. TP.");
873 printf("\tGLOB=%d\n", GLOB);
880 int GLOB = 0;
884 GLOB = 1;
897 GLOB = 2;
902 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test22. TP.");
906 printf("\tGLOB=%d\n", GLOB);
914 int GLOB = 0;
920 GLOB++;
933 CHECK(GLOB != 777);
945 CHECK(GLOB != 777);
954 GLOB++;
969 printf("\tGLOB=%d\n", GLOB);
976 int GLOB = 0;
982 GLOB = 1;
996 GLOB = 2;
1001 printf("\tGLOB=%d\n", GLOB);
1008 int GLOB = 0;
1015 GLOB = 1;
1029 GLOB = 2;
1034 printf("\tGLOB=%d\n", GLOB);
1041 int GLOB = 0;
1046 GLOB = 1;
1053 GLOB = 2;
1058 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test26. TP");
1062 printf("\tGLOB=%d\n", GLOB);
1071 int GLOB = 0;
1075 GLOB++;
1085 printf("\tGLOB=%d\n", GLOB);
1096 // 2. write(GLOB) B. write(GLOB)
1100 // 6. read(GLOB) b. Q.Get() <---------/ F. read(GLOB)
1102 // c. read(GLOB)
1104 int GLOB = 0;
1109 GLOB++;
1115 CHECK(GLOB != 777);
1123 CHECK(GLOB == 2);
1131 printf("\tGLOB=%d\n", GLOB);
1142 int GLOB = 0;
1146 GLOB++;
1153 CHECK(GLOB != 777);
1165 CHECK(GLOB == 2);
1176 printf("\tGLOB=%d\n", GLOB);
1190 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1192 // 3. BOUNDARY++; c. read(GLOB[i]: i < n)
1195 // no actual races on accesses to GLOB[]:
1196 // Writer writes to GLOB[i] where i>=BOUNDARY and then increments BOUNDARY.
1197 // Readers read BOUNDARY and read GLOB[i] where i<BOUNDARY.
1200 // accesses to GLOB since compilers and CPUs
1207 static int GLOB[N];
1214 GLOB[j] = j;
1229 CHECK(GLOB[i] == i);
1241 printf("\tGLOB=%d\n", GLOB[N-1]);
1253 // 1. write(GLOB[i]: i >= BOUNDARY) a. n = BOUNDARY
1255 // 3. BOUNDARY++; c. write(GLOB[i]: i < n)
1259 static int GLOB[N];
1266 GLOB[j] = j;
1281 if(GLOB[i] == i) {
1282 GLOB[i]++;
1295 printf("\tGLOB=%d\n", GLOB[N-1]);
1310 // b. write(GLOB)
1314 // C. read(GLOB)
1317 // 5. write(GLOB)
1323 int GLOB = 0;
1328 GLOB = 1;
1335 CHECK(GLOB != 777);
1348 GLOB = 2;
1352 // ANNOTATE_EXPECT_RACE(&GLOB
1355 printf("\tGLOB=%d\n", GLOB);
1364 int GLOB = 0;
1376 int n = ++GLOB;
1410 GLOB, ARR[1], ARR[7], ARR[N-1]);
1419 int GLOB = 0;
1449 printf("\tGLOB=%d\n", GLOB);
1509 // 2. write(GLOB) B. write(GLOB)
1514 // 7. write(GLOB) G. write(GLOB)
1518 // d. write(GLOB)
1521 int GLOB = 0;
1526 GLOB++;
1533 GLOB++;
1543 GLOB++;
1552 printf("\tGLOB=%d\n", GLOB);
1560 int GLOB = 0;
1573 GLOB = 3;
1579 CHECK(GLOB != -777);
1588 printf("\tGLOB=%d\n", GLOB);
1600 // write(GLOB) write(GLOB)
1606 // write(GLOB) write(GLOB)
1612 // write(GLOB) write(GLOB)
1618 int GLOB = 0;
1623 GLOB++;
1631 GLOB++;
1646 GLOB++;
1659 printf("\tGLOB=%d\n", GLOB);
1669 int GLOB = 0;
1676 GLOB++;
1679 CHECK(GLOB == N_threads);
1683 ANNOTATE_TRACE_MEMORY(&GLOB);
1691 CHECK(GLOB == 3);
1703 // write(GLOB) write(GLOB)
1710 // write(GLOB) write(GLOB)
1715 // write(GLOB) write(GLOB)
1721 int GLOB = 0;
1726 GLOB++;
1735 GLOB++;
1749 GLOB++;
1756 // ANNOTATE_EXPECT_RACE(&GLOB, "test40. FP. Fixed by MSMProp1. Complex Stuff.");
1763 printf("\tGLOB=%d\n", GLOB);
1787 int GLOB = 0;
1793 GLOB=1;
1806 GLOB=3;
1818 GLOB=2;
1828 // ANNOTATE_EXPECT_RACE(&GLOB, "test42. TN. debugging.");
1833 printf("\tGLOB=%d\n", GLOB);
1848 int GLOB = 0;
1851 GLOB = 1;
1853 CHECK(GLOB == 1);
1858 CHECK(GLOB == 1);
1865 printf("\tGLOB=%d\n", GLOB);
1883 int GLOB = 0;
1887 CHECK(GLOB == 0);
1890 GLOB = 1;
1897 GLOB = 1;
1901 // ANNOTATE_EXPECT_RACE(&GLOB, "test44. FP. Fixed by MSMProp1.");
1906 printf("\tGLOB=%d\n", GLOB);
1924 int GLOB = 0;
1928 CHECK(GLOB == 0);
1931 GLOB++;
1938 CHECK(GLOB <= 1);
1946 printf("\tGLOB=%d\n", GLOB);
1963 int GLOB = 0;
1966 GLOB++;
1968 GLOB++;
1974 GLOB++;
1981 printf("\tGLOB=%d\n", GLOB);
1985 ANNOTATE_TRACE_MEMORY(&GLOB);
2006 int GLOB = 0;
2009 GLOB=1;
2017 GLOB++;
2021 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test47. TP. Not detected by pure HB.");
2026 printf("\tGLOB=%d\n", GLOB);
2034 int GLOB = 0;
2041 // 1. write(GLOB) a. sleep(long enough so that GLOB
2043 // b. read(GLOB)
2050 GLOB = 3;
2054 CHECK(GLOB != -777);
2058 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test48. TP. FN in MSMHelgrind.");
2063 printf("\tGLOB=%d\n", GLOB);
2071 int GLOB = 0;
2077 // 1. write(GLOB) a. sleep(long enough so that GLOB
2079 // b. read(GLOB)
2080 // c. read(GLOB)
2081 // d. read(GLOB)
2082 // e. read(GLOB)
2089 GLOB = 3;
2093 CHECK(GLOB != -777);
2094 CHECK(GLOB != -777);
2095 CHECK(GLOB != -777);
2096 CHECK(GLOB != -777);
2100 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test49. TP. FN in MSMHelgrind.");
2105 printf("\tGLOB=%d\n", GLOB);
2113 int GLOB = 0;
2115 // Two last write accesses to GLOB are not synchronized
2120 // 3. MU.Lock() a. write(GLOB)
2127 // 6. write(GLOB) f. MU.Lock()
2128 // g. write(GLOB)
2135 GLOB = 1;
2144 GLOB = 3;
2155 GLOB = 2;
2160 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test50. TP.");
2164 printf("\tGLOB=%d\n", GLOB);
2172 int GLOB = 0;
2186 // 5. write(GLOB) \ a. write(GLOB)
2192 // f. write(GLOB)
2202 GLOB = 1;
2211 GLOB = 2;
2226 GLOB = 3;
2230 ANNOTATE_EXPECT_RACE(&GLOB, "test51. TP.");
2235 printf("\tGLOB=%d\n", GLOB);
2243 int GLOB = 0;
2253 // a. write(GLOB)
2262 // 4. MU.Unlock() \ f. write(GLOB)
2263 // 5. write(GLOB) \ .
2271 GLOB = 1;
2281 GLOB = 2;
2298 GLOB = 3;
2302 ANNOTATE_EXPECT_RACE(&GLOB, "test52. TP.");
2306 printf("\tGLOB=%d\n", GLOB);
2323 // 2. write(GLOB)
2331 // f. write(GLOB)
2335 int GLOB = 0;
2341 GLOB = 1000;
2355 // at this point Initializer will not access GLOB again
2357 CHECK(GLOB >= 1000);
2358 GLOB++;
2364 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test53. FP. Implicit semaphore");
2369 printf("\tGLOB=%d\n", GLOB);
2378 int GLOB = 0;
2384 GLOB = 1000;
2386 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
2399 // at this point Initializer will not access GLOB again
2400 ANNOTATE_CONDVAR_WAIT(&GLOB);
2402 CHECK(GLOB >= 1000);
2403 GLOB++;
2412 printf("\tGLOB=%d\n", GLOB);
2425 int GLOB = 0;
2429 GLOB = 1;
2443 GLOB = 2;
2451 printf("\tGLOB=%d\n", GLOB);
2461 // a race on GLOB as a benign race.
2462 int GLOB = 0;
2466 GLOB++;
2470 ANNOTATE_BENIGN_RACE(&GLOB, "test56. Use of ANNOTATE_BENIGN_RACE.");
2476 printf("\tGLOB=%d\n", GLOB);
2484 int GLOB = 0;
2487 AtomicIncrement(&GLOB, 1);
2492 while (GLOB < 20) usleep(1000);
2499 CHECK(GLOB == 20);
2500 printf("\tGLOB=%d\n", GLOB);
2647 int GLOB = 0;
2658 P1 = &GLOB;
2684 printf("\tGLOB=%d\n", GLOB);
2755 // 1. read(GLOB) (sleep)
2756 // a. read(GLOB)
2758 // B. write(GLOB)
2762 int GLOB = 0;
2766 CHECK(GLOB == 0);
2771 CHECK(GLOB == 0);
2777 GLOB = 1;
2782 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test64: TP.");
2787 printf("\tGLOB=%d\n", GLOB);
2800 // 2. write(GLOB)
2803 // b. write(GLOB)
2806 // B. write(GLOB)
2810 int GLOB = 0;
2816 GLOB++;
2823 GLOB++;
2830 GLOB = 1;
2836 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test65. TP.");
2841 printf("\tGLOB=%d\n", GLOB);
2906 int GLOB = 0;
2912 GLOB = 1;
2939 GLOB = 2;
2943 ANNOTATE_EXPECT_RACE(&GLOB, "test67. FN. Race between Signaller1 and Waiter2");
2948 printf("\tGLOB=%d\n", GLOB);
2956 // In this test, all writes to GLOB are protected by a mutex
2961 int GLOB = 0;
2969 GLOB++;
2982 CHECK(GLOB >= 0);
2994 ANNOTATE_EXPECT_RACE(&GLOB, "TP. Writes are protected, reads are not.");
2999 printf("\tGLOB=%d\n", GLOB);
3008 // We do not want to annotate GLOB as a benign race
3012 int GLOB = 0;
3021 GLOB++;
3035 CHECK(GLOB >= 0);
3052 printf("\tGLOB=%d\n", GLOB);
3059 int GLOB = 0;
3062 ANNOTATE_TRACE_MEMORY(&GLOB);
3063 GLOB = 1;
3064 printf("\tGLOB=%d\n", GLOB);
3239 int *GLOB = NULL;
3242 *GLOB = 1;
3252 *GLOB = 2;
3256 GLOB = new int(0);
3257 ANNOTATE_EXPECT_RACE(GLOB, "TP: PositiveTests.MutexDtorNoSyncTest");
3262 delete GLOB;
3266 *GLOB = 1;
3280 *GLOB = 2;
3284 GLOB = new int(0);
3285 ANNOTATE_EXPECT_RACE(GLOB, "TP: PositiveTests.MutexDtorNoSyncTest2");
3290 delete GLOB;
3298 int *GLOB;
3302 *GLOB = 1;
3308 *GLOB = 2;
3314 GLOB = new int;
3315 ANNOTATE_EXPECT_RACE(GLOB, "TP: PositiveTests.FprintfThreadCreateTest");
3325 delete GLOB;
3337 int GLOB = 0;
3348 int n = ++GLOB;
3398 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3410 int GLOB = 0;
3421 int n = ++GLOB;
3479 GLOB, (int)ARR1[1], (int)ARR1[7], (int)ARR1[N-1]);*/
3570 int GLOB = 0;
3597 int GLOB = 0;
3624 int GLOB = 0;
3749 int GLOB = 0;
3775 int GLOB = 0;
4257 int *GLOB = 0;
4264 GLOB = (int*)malloc(128 * sizeof(int));
4265 ANNOTATE_TRACE_MEMORY(&GLOB[42]);
4266 GLOB[42] = 777;
4268 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB[42], "test90. FP. This is a false positve");
4278 int *p = &GLOB[42];
4292 free(GLOB);
4307 int *GLOB = 0;
4312 GLOB = (int*)malloc(128 * sizeof(int));
4313 GLOB[42] = 777;
4315 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB[42], "test91. FP. This is a false positve");
4323 int *p = &GLOB[42];
4340 free(GLOB);
4354 // 2. Create GLOB.
4355 // 3. ANNOTATE_PUBLISH_...(GLOB) -------\ .
4358 // \ b. Get GLOB
4360 // \--> d. Access GLOB
4363 // accesses to GLOB.
4369 ObjType *GLOB = 0;
4374 GLOB = new ObjType;
4376 GLOB->arr[i] = 777;
4379 ANNOTATE_PUBLISH_MEMORY_RANGE(GLOB, sizeof(*GLOB));
4386 ObjType *p = GLOB;
4407 printf("\t*GLOB=%d\n", GLOB->arr[0]);
4415 int GLOB = 0;
4418 CHECK(GLOB == 0);
4424 ANNOTATE_PUBLISH_MEMORY_RANGE(&GLOB, sizeof(GLOB));
4432 printf("\tGLOB=%d\n", GLOB);
4440 int GLOB;
4452 GLOB = 1; // WRITE
4484 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4487 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test94: TP.");
4492 printf("\tGLOB=%d\n", GLOB);
4499 int GLOB = 0;
4510 GLOB = 1; // WRITE
4536 GLOB = 2; // READ: no HB-relation between CV.Signal and CV2.Wait !
4539 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test95: TP.");
4544 printf("\tGLOB=%d\n", GLOB);
4554 int GLOB = 0;
4561 GLOB++;
4567 GLOB++;
4573 GLOB++;
4578 ANNOTATE_TRACE_MEMORY(&GLOB);
4582 CHECK(GLOB == 3);
4583 printf("\tGLOB=%d\n", GLOB);
4596 int * GLOB = &array[ARRAY_SIZE/2];
4598 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4604 CHECK(0 != *GLOB);
4610 ANNOTATE_TRACE_MEMORY(GLOB);
4611 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, __FUNCTION__);
4614 *GLOB = 0x12345;
4625 bool GLOB = false;
4630 mu.LockWhenWithTimeout(Condition(&ArgIsTrue, &GLOB), 5);
4631 GLOB = false;
4700 int GLOB = 0;
4712 GLOB = 1;
4735 GLOB = 2;
4744 printf("\tGLOB=%d\n", GLOB);
4757 int * GLOB = &array[ARRAY_SIZE/2];
4759 We use sizeof(array) == 4 * HG_CACHELINE_SIZE to be sure that GLOB points
4767 CHECK(777 == GLOB[0]);
4770 CHECK(777 == GLOB[1]);
4775 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+0, "test102: TP. FN with --fast-mode=yes");
4776 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB+1, "test102: TP");
4780 GLOB[0] = 777;
4783 GLOB[1] = 777;
4831 int *GLOB = NULL;
4833 GLOB[42] = 1;
4840 GLOB[42] = 2;
4844 GLOB = (int*)malloc(128 * sizeof(int));
4845 GLOB[42] = 0;
4846 ANNOTATE_EXPECT_RACE(&GLOB[42], "test104. TP.");
4847 ANNOTATE_TRACE_MEMORY(&GLOB[42]);
4850 printf("\tGLOB=%d\n", GLOB[42]);
4851 free(GLOB);
4859 int GLOB = 0;
4886 printf("\tGLOB=%d\n", GLOB);
4894 int GLOB = 0;
4897 ANNOTATE_EXPECT_RACE(&GLOB, "No race in fact. Just checking the tool.");
4898 printf("\tGLOB=%d\n", GLOB);
4959 static int GLOB[N];
4963 // printf("--Worker : %ld %p\n", (int*)a - GLOB, (void*)pthread_self());
4972 t[i] = new MyThread(Worker, &GLOB[i]);
4975 ANNOTATE_TRACE_MEMORY(&GLOB[i]);
4976 GLOB[i] = 1;
4984 GLOB[i]++;
4988 printf("\tGLOB=%d\n", GLOB[13]);
4996 char *GLOB = 0;
5046 char *GLOB = 0;
5069 GLOB[i]++;
5079 ANNOTATE_NEW_MEMORY(GLOB + b, e - b);
5080 ANNOTATE_TRACE_MEMORY(GLOB + b);
5082 GLOB[j] = 0;
5084 GLOB + b, e - b);
5098 GLOB = new char [N];
5118 printf("GLOB = %d\n", (int)GLOB[0]);
5245 int GLOB = 0;
5249 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
5253 ANNOTATE_CONDVAR_WAIT(&GLOB);
5263 printf("\tGLOB=%d\n", GLOB);
5270 int GLOB = 0;
5272 GLOB = 1;
5278 GLOB = 2;
5283 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true race");
5287 printf("\tGLOB=%d\n", GLOB);
5295 int GLOB = 0;
5298 GLOB = 1; // write
5299 CHECK(GLOB); // read
5304 CHECK(GLOB >= 0); // read
5308 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "TP (T1: write then read, T2: read)");
5311 GLOB = 1;
5314 printf("\tGLOB=%d\n", GLOB);
5525 int GLOB = 0;
5534 GLOB = 1;
5542 printf("\tGLOB=%d\n", GLOB);
5551 int GLOB = 0;
5554 CHECK(GLOB == 0);
5563 GLOB = 1;
5565 printf("\tGLOB=%d\n", GLOB);
5594 int GLOB = 0;
5598 GLOB++;
5602 GLOB++;
5615 int GLOB = 0;
5618 *param = GLOB; // a write into Waiter's memory
5619 return GLOB > 0;
5625 CHECK(GLOB > 0);
5631 GLOB++;
5640 printf("\tGLOB=%d\n", GLOB);
5732 int GLOB = 0;
5733 void Worker() { GLOB = 1; }
5736 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test132");
5737 printf("test132: positive; &GLOB=%p\n", &GLOB);
5738 ANNOTATE_TRACE_MEMORY(&GLOB);
5739 GLOB = 7;
5756 int GLOB = 0;
5757 void Worker() { GLOB = 1; }
5760 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "test133");
5761 printf("test133: positive; &GLOB=%p\n", &GLOB);
5762 ANNOTATE_TRACE_MEMORY(&GLOB);
5763 GLOB = 7;
5827 int GLOB = 0;
5901 int GLOB = 0;
5905 GLOB++; // First access.
5912 GLOB++; // Second access.
6011 // We have a race on GLOB between Putter and one of the Getters.
6016 int GLOB = 0;
6022 GLOB = 1;
6030 CHECK(GLOB == 1); // Race here
6036 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "true races");
6052 struct Foo GLOB;
6053 int &RACEY = GLOB.a;
6064 // This line resets GLOB's creator_tid (bug).
6065 ANNOTATE_NEW_MEMORY(&GLOB.b, sizeof(GLOB.b));
6083 struct Foo *GLOB;
6093 GLOB = new Foo;
6094 RACEY = &(GLOB->a);
6098 // This line resets GLOB's creator_tid (bug).
6099 ANNOTATE_NEW_MEMORY(&(GLOB->b), sizeof(GLOB->b));
6104 delete GLOB;
6121 int GLOB = 0;
6128 GLOB = 1;
6140 GLOB = 2;
6147 GLOB = 3;
6182 int GLOB = 0;
6184 void Writer1() { GLOB++; }
6187 GLOB++;
6190 ANNOTATE_EXPECT_RACE_FOR_TSAN(&GLOB, "real race");
6198 printf("\tGLOB=%d\n", GLOB);
6229 int GLOB = 0;
6233 GLOB++;
6237 GLOB++;
6252 int GLOB = 0;
6257 GLOB++;
6263 GLOB++;
6321 char *GLOB;
6324 memcpy(GLOB, GLOB + 1, 1);
6328 memmove(GLOB, GLOB + 1, 1);
6332 GLOB[0] = 'z';
6336 CHECK(strlen(GLOB) == 3);
6340 CHECK(strcpy(GLOB, "zzz") == GLOB);
6344 CHECK(strchr(GLOB, 'o') == (GLOB + 1));
6348 CHECK(memchr(GLOB, 'o', 4) == (GLOB + 1));
6352 CHECK(strrchr(GLOB, '!') == NULL);
6356 CHECK(strcmp(GLOB, "xxx") != 0);
6360 CHECK(strncmp(GLOB, "xxx", 3) != 0);
6365 GLOB = mem;
6366 strcpy(GLOB, "foo");
6367 ANNOTATE_EXPECT_RACE_FOR_TSAN(GLOB, "expected race");
6604 int GLOB = 0;
6606 // Worker(N) will do 2^N increments of GLOB, each increment in a separate thread
6617 GLOB++; // Race here
6622 ANNOTATE_EXPECT_RACE(&GLOB, "StressTests.ThreadTree3 race");
6623 ANNOTATE_TRACE_MEMORY(&GLOB);
6628 ANNOTATE_EXPECT_RACE(&GLOB, "StressTests.ThreadTree7 race");
6629 ANNOTATE_TRACE_MEMORY(&GLOB);
6721 int GLOB[size];
6726 GLOB[j]++;
7014 int GLOB = 0;
7019 GLOB++;
7058 int GLOB[ARRAY_SIZE];
7071 GLOB[i]++;
7073 if (myId == 0 && GLOB[0] > GLOB_limit) {
7078 nextQ.Put(GLOB);
7086 Q[0]->Put(GLOB);
7210 int GLOB = 0;
7219 GLOB++;
7236 CHECK(GLOB == N_threads * ITERATIONS);
7361 int GLOB = 0;
7367 GLOB++;
7373 //ANNOTATE_BENIGN_RACE(&GLOB, "Test");
7388 int GLOB = 0;
7392 ANNOTATE_CONDVAR_SIGNAL(&GLOB);
7394 GLOB++;
7395 ANNOTATE_CONDVAR_WAIT(&GLOB);
7407 int GLOB[DATA_SIZE];
7416 ANNOTATE_CONDVAR_SIGNAL(&GLOB); // Force new segment
7418 GLOB[k] = 42;
7527 int GLOB = 0;
7531 GLOB++;
7565 int GLOB = 0;
7570 GLOB = 1;
7580 GLOB = 2;
7585 ANNOTATE_EXPECT_RACE(&GLOB, "MutexNotPhbTest. TP.");
7593 int GLOB = 0;
7596 GLOB = 1;
7600 GLOB = 2;
7604 ANNOTATE_EXPECT_RACE(&GLOB, "SimpleRace.");
7613 int GLOB = 0;
7616 if (!GLOB)
7617 GLOB = 1;
7623 GLOB = 2;
7627 ANNOTATE_EXPECT_RACE(&GLOB, "SimpleRace. UNVERIFIABLE.");