From 47481cbffbefb399e672cf056c15323917bf43bf Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 2 Jul 2020 13:28:48 -0700 Subject: [PATCH] [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 --- compiler-rt/test/profile/ContinuousSyncMode/online-merging.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c b/compiler-rt/test/profile/ContinuousSyncMode/online-merging.c index a9f32b9..b3c33f3 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. -- 2.7.4