1- // RUN: %libomptarget-compile-generic -fprofile-generate
1+ // RUN: %libomptarget-compile-generic -fprofile-generate \
2+ // RUN: -fprofile-update=atomic
23// RUN: env LLVM_PROFILE_FILE=%basename_t.llvm.profraw \
34// RUN: %libomptarget-run-generic 2>&1
45// RUN: llvm-profdata show --all-functions --counts \
89// RUN: %target_triple.%basename_t.llvm.profraw \
910// RUN: | %fcheck-generic --check-prefix="LLVM-DEVICE"
1011
11- // RUN: %libomptarget-compile-generic -fprofile-instr-generate
12+ // RUN: %libomptarget-compile-generic -fprofile-instr-generate \
13+ // RUN: -fprofile-update=atomic
1214// RUN: env LLVM_PROFILE_FILE=%basename_t.clang.profraw \
1315// RUN: %libomptarget-run-generic 2>&1
1416// RUN: llvm-profdata show --all-functions --counts \
1820// RUN: %target_triple.%basename_t.clang.profraw | \
1921// RUN: %fcheck-generic --check-prefix="CLANG-DEV"
2022
21- // RUN: %libomptarget-compile-generic -Xarch_host -fprofile-generate
23+ // RUN: %libomptarget-compile-generic -Xarch_host -fprofile-generate \
24+ // RUN: -fprofile-update=atomic
2225// RUN: env LLVM_PROFILE_FILE=%basename_t.nogpu.profraw \
2326// RUN: %libomptarget-run-generic 2>&1
2427// RUN: llvm-profdata show --all-functions --counts \
2730// RUN: not test -e %target_triple.%basename_t.nogpu.profraw
2831
2932// RUN: %libomptarget-compile-generic -Xarch_host -fprofile-generate \
30- // RUN: -Xarch_device -fprofile-instr-generate
33+ // RUN: -Xarch_device -fprofile-instr-generate -fprofile-update=atomic
3134// RUN: env LLVM_PROFILE_FILE=%basename_t.hidf.profraw \
3235// RUN: %libomptarget-run-generic 2>&1
3336// RUN: llvm-profdata show --all-functions --counts \
3841// RUN: | %fcheck-generic --check-prefix="CLANG-DEV"
3942
4043// RUN: %libomptarget-compile-generic -Xarch_device -fprofile-generate \
41- // RUN: -Xarch_host -fprofile-instr-generate
44+ // RUN: -Xarch_host -fprofile-instr-generate -fprofile-update=atomic
4245// RUN: env LLVM_PROFILE_FILE=%basename_t.hfdi.profraw \
4346// RUN: %libomptarget-run-generic 2>&1
4447// RUN: llvm-profdata show --all-functions --counts \
@@ -59,8 +62,10 @@ int main() {
5962
6063 int device_var = 1 ;
6164#pragma omp target
62- for (int i = 0 ; i < 10 ; i ++ ) {
63- device_var *= i ;
65+ {
66+ for (int i = 0 ; i < 10 ; i ++ ) {
67+ device_var *= i ;
68+ }
6469 }
6570}
6671
@@ -78,7 +83,7 @@ int main() {
7883// LLVM-DEVICE-LABEL: __omp_offloading_{{[_0-9a-zA-Z]*}}_main_{{[_0-9a-zA-Z]*}}:
7984// LLVM-DEVICE: Hash: {{0[xX][0-9a-fA-F]+}}
8085// LLVM-DEVICE: Counters: 3
81- // LLVM-DEVICE: Block counts: [10, 2 , 1]
86+ // LLVM-DEVICE: Block counts: [10, {{.*}} , 1]
8287// LLVM-DEVICE: Instrumentation level: IR
8388
8489// CLANG-HOST-LABEL: main:
@@ -97,6 +102,5 @@ int main() {
97102// CLANG-DEV-LABEL: __omp_offloading_{{[_0-9a-zA-Z]*}}_main_{{[_0-9a-zA-Z]*}}:
98103// CLANG-DEV: Hash: {{0[xX][0-9a-fA-F]+}}
99104// CLANG-DEV: Counters: 2
100- // CLANG-DEV: Function count: 0
101- // CLANG-DEV: Block counts: [11]
105+ // CLANG-DEV: Block counts: [10]
102106// CLANG-DEV: Instrumentation level: Front-end
0 commit comments