Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / suppress_same_address.cpp
blob3ec13ee8302fc7dc5ce7cb2a011997e6dd5693c2
1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
2 #include "test.h"
4 volatile int X;
6 void *Thread1(void *x) {
7 barrier_wait(&barrier);
8 X = 42;
9 X = 66;
10 X = 78;
11 return 0;
14 void *Thread2(void *x) {
15 X = 11;
16 X = 99;
17 X = 73;
18 barrier_wait(&barrier);
19 return 0;
22 int main() {
23 barrier_init(&barrier, 2);
24 pthread_t t;
25 pthread_create(&t, 0, Thread1, 0);
26 Thread2(0);
27 pthread_join(t, 0);
30 // CHECK: ThreadSanitizer: reported 1 warnings