summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/go/test.c
blob: 7d6a8ce3ea9543546c49559c7ec6305dce214573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>

void __tsan_init();
void __tsan_fini();
void __tsan_event(int typ, int tid, void *pc, void *addr, int info);

int __tsan_symbolize(void *pc, char **img, char **rtn, char **file, int *l) {
  return 0;
}

int main(void) {
  __tsan_init();
  __tsan_event(1, 0, 0, &main, 0);  // READ
  __tsan_event(11, 1, 0, 0, 0);  // THR_START
  __tsan_event(11, 0, 0, &main, 0);  // READ
  __tsan_event(13, 1, 0, 0, 0);  // THR_END
  printf("OK\n");
  __tsan_fini();
  return 0;
}
OpenPOWER on IntegriCloud