[tsan] Debug failing test on PPC bot

llvm-svn: 353617
This commit is contained in:
Vitaly Buka 2019-02-09 16:28:41 +00:00
parent ab28321768
commit 9419b5bd04
1 changed files with 5 additions and 1 deletions

View File

@ -1,17 +1,21 @@
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1
// | FileCheck %s
#include "test.h"
int var;
void *Thread(void *x) {
fprintf(stderr, "Thread\n");
pthread_exit(&var);
return 0;
}
int main() {
fprintf(stderr, "MAIN\n");
pthread_t t;
pthread_create(&t, 0, Thread, 0);
void *retval = 0;
fprintf(stderr, "JOIN\n");
pthread_join(t, &retval);
if (retval != &var) {
fprintf(stderr, "Unexpected return value\n");