Skip to content

Commit 5ccc104

Browse files
calixtemantstellar
authored andcommitted
[compiler-rt] Reduce the number of threads in gcov test to avoid failure
Summary: Patch in D78477 introduced a new test for gcov and this test is failing on arm: - http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-full-sh/builds/4752/steps/ninja%20check%202/logs/stdio - http://lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/10501/steps/ninja%20check%202/logs/stdio So try to fix it in reducing the number of threads. Reviewers: marco-c Reviewed By: marco-c Subscribers: dberris, kristof.beyls, #sanitizers, serge-sans-paille, sylvestre.ledru Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D79621 (cherry picked from commit 0da37be)
1 parent caa755f commit 5ccc104

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
#include <sys/types.h>
22
#include <thread>
33
#include <unistd.h>
4-
#include <vector>
54

65
template <typename T>
76
void launcher(T func) {
8-
std::vector<std::thread> pool;
7+
auto t1 = std::thread(func);
8+
auto t2 = std::thread(func);
99

10-
for (int i = 0; i < 10; i++) {
11-
pool.emplace_back(std::thread(func));
12-
}
13-
14-
for (auto &t : pool) {
15-
t.join();
16-
}
10+
t1.join();
11+
t2.join();
1712
}
1813

19-
void h() {}
20-
21-
void g() {
22-
fork();
23-
launcher<>(h);
24-
}
14+
void g() {}
2515

2616
void f() {
2717
fork();

0 commit comments

Comments
 (0)