]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/tsan/sunrpc.cc
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / tsan / sunrpc.cc
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2
3 #include <pthread.h>
4 #include <rpc/types.h>
5 #include <rpc/xdr.h>
6 #include <stdio.h>
7
8 void *thr(void *p) {
9 XDR xdrs;
10 char buf[100];
11 xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE);
12 xdr_destroy(&xdrs);
13 return 0;
14 }
15
16 int main(int argc, char *argv[]) {
17 pthread_t th[2];
18 pthread_create(&th[0], 0, thr, 0);
19 pthread_create(&th[1], 0, thr, 0);
20 pthread_join(th[0], 0);
21 pthread_join(th[1], 0);
22 printf("DONE\n");
23 // CHECK: DONE
24 return 0;
25 }