1#include <sys/types.h>
2#include <thread>
3#include <unistd.h>
4
5template <typename T>
6void launcher(T func) {
7 auto t1 = std::thread(func);
8 auto t2 = std::thread(func);
9
10 t1.join();
11 t2.join();
12}
13
14void g() {}
15
16void f() {
17 fork();
18 launcher<>(func: g);
19}
20
21int main() {
22 launcher<>(func: f);
23
24 return 0;
25}
26

source code of compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp