Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / tiny_race.c
blobb6937febd1170c7ff1f913ab589f5985a500252d
1 // RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
2 #include "test.h"
4 int Global;
6 void *Thread1(void *x) {
7 barrier_wait(&barrier);
8 Global = 42;
9 return x;
12 int main() {
13 barrier_init(&barrier, 2);
14 pthread_t t;
15 pthread_create(&t, 0, Thread1, 0);
16 Global = 43;
17 barrier_wait(&barrier);
18 pthread_join(t, 0);
19 return Global;
22 // CHECK: WARNING: ThreadSanitizer: data race