1// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2
3// Crashes on powerpc64be
4// UNSUPPORTED: powerpc64
5
6#include "test.h"
7
8int var;
9
10void *Thread(void *x) {
11 pthread_exit(&var);
12 return 0;
13}
14
15int 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);
23 }
24 fprintf(stderr, "PASS\n");
25 return 0;
26}
27
28// CHECK-NOT: WARNING: ThreadSanitizer:
29// CHECK: PASS
30