summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalixte Denizet <calixte.denizet@gmail.com>2020-05-08 11:04:17 +0200
committerTom Stellard <tstellar@redhat.com>2020-06-23 15:43:11 -0700
commit5ccc104c206c02e712dec68cc0daef6379f51861 (patch)
tree00eed10b28bde2b963929f28b9a460007f03ee66
parentcaa755f90e3711443180adec834fd544e3646e2e (diff)
[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 0da37bedc2667da371eda30595a06210595881d0)
-rw-r--r--compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp b/compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp
index 94db50fc8265..0f043caedf3e 100644
--- a/compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp
+++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-multithread_fork.cpp
@@ -1,27 +1,17 @@
#include <sys/types.h>
#include <thread>
#include <unistd.h>
-#include <vector>
template <typename T>
void launcher(T func) {
- std::vector<std::thread> pool;
+ auto t1 = std::thread(func);
+ auto t2 = std::thread(func);
- for (int i = 0; i < 10; i++) {
- pool.emplace_back(std::thread(func));
- }
-
- for (auto &t : pool) {
- t.join();
- }
+ t1.join();
+ t2.join();
}
-void h() {}
-
-void g() {
- fork();
- launcher<>(h);
-}
+void g() {}
void f() {
fork();