Skip to content

Commit 606557d

Browse files
author
Wael Yehia
committed
[PGO] use atomics for profile counters in instrprof-dlopen-norpath.test
When two threads dlopen a shared library, one instance of the library is loaded. Hence, code inside the library needs to be thread safe, so use atomic updates for profile counters.
1 parent 53abbce commit 606557d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler-rt/test/profile/Posix/instrprof-dlopen-norpath.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
RUN: rm -rf %t && split-file %s %t && cd %t
2-
RUN: %clang_pgogen -fPIC foo.c -c -Xclang -fprofile-instrument-path="default_foo_%m.profraw"
3-
RUN: %clang_pgogen -fPIC foo2.c -c -Xclang -fprofile-instrument-path="default_foo2_%m.profraw"
4-
RUN: %clang_pgogen -shared foo.o -o shr_foo.o %if target={{.*aix.*}} %{ -bcdtors:mbr %}
5-
RUN: %clang_pgogen -shared foo2.o -o shr_foo2.o
2+
RUN: %clang_pgogen -fprofile-update=atomic -fPIC foo.c -c -Xclang -fprofile-instrument-path="default_foo_%m.profraw"
3+
RUN: %clang_pgogen -fprofile-update=atomic -fPIC foo2.c -c -Xclang -fprofile-instrument-path="default_foo2_%m.profraw"
4+
RUN: %clang_pgogen -fprofile-update=atomic -shared foo.o -o shr_foo.o %if target={{.*aix.*}} %{ -bcdtors:mbr %}
5+
RUN: %clang_pgogen -fprofile-update=atomic -shared foo2.o -o shr_foo2.o
66

77
RUN: %clang_pgogen common.c -c
88

0 commit comments

Comments
 (0)