// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s

// Crashes on powerpc64be
// XFAIL: target-is-powerpc64be

#include "test.h"

int var;

void *Thread(void *x) {
  pthread_exit(&var);
  return 0;
}

int main() {
  pthread_t t;
  pthread_create(&t, 0, Thread, 0);
  void *retval = 0;
  pthread_join(t, &retval);
  if (retval != &var) {
    fprintf(stderr, "Unexpected return value\n");
    exit(1);
  }
  fprintf(stderr, "PASS\n");
  return 0;
}

// CHECK-NOT: WARNING: ThreadSanitizer:
// CHECK: PASS

// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s

// Crashes on powerpc64be
// UNSUPPORTED: powerpc64

#include "test.h"

int var;

void *Thread(void *x) {
  pthread_exit(&var);
  return 0;
}

int main() {
  pthread_t t;
  pthread_create(&t, 0, Thread, 0);
  void *retval = 0;
  pthread_join(t, &retval);
  if (retval != &var) {
    fprintf(stderr, "Unexpected return value\n");
    exit(1);
  }
  fprintf(stderr, "PASS\n");
  return 0;
}

// CHECK-NOT: WARNING: ThreadSanitizer:
// CHECK: PASS

Remove debug logging and disable test on ppc64be
[tsan] Remove debug logging and disable test on ppc64be

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@353624 91177308-0d34-0410-b5e6-96231b3b80d8
