[compiler-rt] 47481cb - [test] Deflake test/profile/ContinuousSyncMode/online-merging.c
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 13:32:22 PDT 2020
Author: Vedant Kumar
Date: 2020-07-02T13:31:56-07:00
New Revision: 47481cbffbefb399e672cf056c15323917bf43bf
URL: https://github.com/llvm/llvm-project/commit/47481cbffbefb399e672cf056c15323917bf43bf
DIFF: https://github.com/llvm/llvm-project/commit/47481cbffbefb399e672cf056c15323917bf43bf.diff
LOG: [test] Deflake test/profile/ContinuousSyncMode/online-merging.c
This test spawns 32 child processes which race to update counters on
shared memory pages. On some Apple-internal machines, two processes race
to perform an update in approximately 0.5% of the test runs, leading to
dropped counter updates. Deflake the test by using atomic increments.
Tested with:
```
$ for I in $(seq 1 1000); do echo ":: Test run $I..."; ./bin/llvm-lit projects/compiler-rt/test/profile/Profile-x86_64h/ContinuousSyncMode/online-merging.c -av || break; done
```
rdar://64956774
Added:
Modified:
compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
Removed:
################################################################################
diff --git a/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c b/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
index a9f32b9c51e1..b3c33f339713 100644
--- a/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
+++ b/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c
@@ -8,9 +8,9 @@
// Create two DSOs and a driver program that uses them.
// RUN: echo "void dso1(void) {}" > dso1.c
// RUN: echo "void dso2(void) {}" > dso2.c
-// RUN: %clang_pgogen -dynamiclib -o %t.dir/dso1.dylib dso1.c
-// RUN: %clang_pgogen -dynamiclib -o %t.dir/dso2.dylib dso2.c
-// RUN: %clang_pgogen -o main.exe %s %t.dir/dso1.dylib %t.dir/dso2.dylib
+// RUN: %clang_pgogen -dynamiclib -o %t.dir/dso1.dylib dso1.c -mllvm -instrprof-atomic-counter-update-all=1
+// RUN: %clang_pgogen -dynamiclib -o %t.dir/dso2.dylib dso2.c -mllvm -instrprof-atomic-counter-update-all=1
+// RUN: %clang_pgogen -o main.exe %s %t.dir/dso1.dylib %t.dir/dso2.dylib -mllvm -instrprof-atomic-counter-update-all=1
//
// === Round 1 ===
// Test merging+continuous mode without any file contention.
More information about the llvm-commits
mailing list