2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
|
2014-04-11 20:29:24 +08:00
|
|
|
|
|
|
|
#include <pthread.h>
|
2014-10-15 20:47:48 +08:00
|
|
|
#include <rpc/types.h>
|
2014-04-11 20:29:24 +08:00
|
|
|
#include <rpc/xdr.h>
|
2014-04-11 21:01:20 +08:00
|
|
|
#include <stdio.h>
|
2014-04-11 20:29:24 +08:00
|
|
|
|
|
|
|
void *thr(void *p) {
|
|
|
|
XDR xdrs;
|
|
|
|
char buf[100];
|
|
|
|
xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE);
|
|
|
|
xdr_destroy(&xdrs);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
pthread_t th[2];
|
|
|
|
pthread_create(&th[0], 0, thr, 0);
|
|
|
|
pthread_create(&th[1], 0, thr, 0);
|
|
|
|
pthread_join(th[0], 0);
|
|
|
|
pthread_join(th[1], 0);
|
2016-04-15 20:34:00 +08:00
|
|
|
fprintf(stderr, "DONE\n");
|
2014-04-11 21:01:20 +08:00
|
|
|
// CHECK: DONE
|
2014-04-11 20:29:24 +08:00
|
|
|
return 0;
|
|
|
|
}
|