summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp
blob: 0f043caedf3edfb1983d0ac52754593ce3f83a1a (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
25
#include <sys/types.h>
#include <thread>
#include <unistd.h>

template <typename T>
void launcher(T func) {
  auto t1 = std::thread(func);
  auto t2 = std::thread(func);

  t1.join();
  t2.join();
}

void g() {}

void f() {
  fork();
  launcher<>(g);
}

int main() {
  launcher<>(f);

  return 0;
}
OpenPOWER on IntegriCloud