Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / thread_exit.c
blob9c97672ff7c891a0d5f655e58132786d8bb454f8
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 // Crashes on powerpc64be
4 // UNSUPPORTED: target=powerpc64{{.*}}
6 #include "test.h"
8 int var;
10 void *Thread(void *x) {
11 pthread_exit(&var);
12 return 0;
15 int main() {
16 pthread_t t;
17 pthread_create(&t, 0, Thread, 0);
18 void *retval = 0;
19 pthread_join(t, &retval);
20 if (retval != &var) {
21 fprintf(stderr, "Unexpected return value\n");
22 exit(1);
24 fprintf(stderr, "PASS\n");
25 return 0;
28 // CHECK-NOT: WARNING: ThreadSanitizer:
29 // CHECK: PASS