summaryrefslogtreecommitdiff
path: root/test/tsan/thread_end_with_ignore.cc
blob: 438a738e20c4a5883eb5f3499d716f99df8a854c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <pthread.h>
#include <stdio.h>

extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l);

void *Thread(void *x) {
  AnnotateIgnoreReadsBegin("", 0);
  return 0;
}

int main() {
  pthread_t t;
  pthread_create(&t, 0, Thread, 0);
  pthread_join(t, 0);
}

// CHECK: ThreadSanitizer: thread T1  finished with ignores enabled, created at:
// CHECK:     #0 pthread_create
// CHECK:     #1 main
// CHECK:   Ignore was enabled at:
// CHECK:     #0 AnnotateIgnoreReadsBegin
// CHECK:     #1 Thread