In https://github.com/llvm/llvm-project/pull/109837, it sets a global variable(`PGOInstrumentColdFunctionOnly`) in PassBuilderPipelines.cpp which introduced a data race detected by TSan. To fix this, I decouple the flag setting, the flags are now set separately(`instrument-cold-function-only-path` is required to be used with `--pgo-instrument-cold-function-only`).
10 lines
530 B
C
10 lines
530 B
C
// RUN: %clang -### -c -fprofile-generate-cold-function-coverage %s 2>&1 | FileCheck %s
|
|
// CHECK: "--instrument-cold-function-only-path=default_%m.profraw"
|
|
// CHECK: "--pgo-instrument-cold-function-only"
|
|
// CHECK: "--pgo-function-entry-coverage"
|
|
// CHECK-NOT: "-fprofile-instrument"
|
|
// CHECK-NOT: "-fprofile-instrument-path=
|
|
|
|
// RUN: %clang -### -c -fprofile-generate-cold-function-coverage=dir %s 2>&1 | FileCheck %s --check-prefix=CHECK-EQ
|
|
// CHECK-EQ: "--instrument-cold-function-only-path=dir{{/|\\\\}}default_%m.profraw"
|