[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / tsan / sunrpc.cc
bloba621c5f65400db1fb4f5dbb66fec51a01a15fbfc
1 // RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s
3 #include <pthread.h>
4 #include <rpc/xdr.h>
5 #include <stdio.h>
7 void *thr(void *p) {
8 XDR xdrs;
9 char buf[100];
10 xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE);
11 xdr_destroy(&xdrs);
12 return 0;
15 int main(int argc, char *argv[]) {
16 pthread_t th[2];
17 pthread_create(&th[0], 0, thr, 0);
18 pthread_create(&th[1], 0, thr, 0);
19 pthread_join(th[0], 0);
20 pthread_join(th[1], 0);
21 printf("DONE\n");
22 // CHECK: DONE
23 return 0;