CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
60 lines
2.5 KiB
C++
60 lines
2.5 KiB
C++
// Tests for instrumentation of C++11 lambdas
|
|
|
|
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instrument=clang > %tgen
|
|
// RUN: FileCheck -allow-deprecated-dag-overlap --input-file=%tgen -check-prefix=PGOGEN %s
|
|
// RUN: FileCheck -allow-deprecated-dag-overlap --input-file=%tgen -check-prefix=LMBGEN %s
|
|
|
|
// RUN: llvm-profdata merge %S/Inputs/cxx-lambda.proftext -o %t.profdata
|
|
// RUN: %clang_cc1 -x c++ %s -triple %itanium_abi_triple -main-file-name cxx-lambda.cpp -std=c++11 -o - -emit-llvm -fprofile-instrument-use=clang -fprofile-instrument-use-path=%t.profdata > %tuse
|
|
// RUN: FileCheck -allow-deprecated-dag-overlap --input-file=%tuse -check-prefix=PGOUSE %s
|
|
// RUN: FileCheck -allow-deprecated-dag-overlap --input-file=%tuse -check-prefix=LMBUSE %s
|
|
|
|
// PGOGEN: @[[LWC:__profc__Z7lambdasv]] = {{(private|internal)}} global [4 x i64] zeroinitializer
|
|
// PGOGEN: @[[MAC:__profc_main]] = {{(private|internal)}} global [1 x i64] zeroinitializer
|
|
// LMBGEN: @[[LFC:"__profc_cxx_lambda.cpp__ZZ7lambdasvENK3\$_0clEi"]] = {{(private|internal)}} global [4 x i64] zeroinitializer
|
|
|
|
// PGOGEN-LABEL: define {{.*}}void @_Z7lambdasv()
|
|
// PGOUSE-LABEL: define {{.*}}void @_Z7lambdasv()
|
|
// PGOGEN: store {{.*}} @[[LWC]]
|
|
void lambdas() {
|
|
int i = 1;
|
|
|
|
// LMBGEN-LABEL: define internal{{( [0-9_a-z]*cc)?( noundef)?( zeroext)?}} i1 @"_ZZ7lambdasvENK3$_0clEi"(
|
|
// LMBUSE-LABEL: define internal{{( [0-9_a-z]*cc)?( noundef)?( zeroext)?}} i1 @"_ZZ7lambdasvENK3$_0clEi"(
|
|
// LMBGEN: store {{.*}} @[[LFC]]
|
|
auto f = [&i](int k) {
|
|
// LMBGEN: store {{.*}} @[[LFC]], i32 0, i32 1
|
|
// LMBUSE: br {{.*}} !prof ![[LF1:[0-9]+]]
|
|
if (i > 0) {
|
|
}
|
|
// LMBGEN: store {{.*}} @[[LFC]], i32 0, i32 2
|
|
// LMBUSE: br {{.*}} !prof ![[LF2:[0-9]+]]
|
|
return k && i;
|
|
};
|
|
|
|
// PGOGEN: store {{.*}} @[[LWC]], i32 0, i32 1
|
|
// PGOUSE: br {{.*}} !prof ![[LW1:[0-9]+]]
|
|
if (i) {}
|
|
|
|
// PGOGEN: store {{.*}} @[[LWC]], i32 0, i32 2
|
|
// PGOUSE: br {{.*}} !prof ![[LW2:[0-9]+]]
|
|
for (i = 0; i < 10; ++i)
|
|
f(9 - i);
|
|
|
|
// PGOGEN: store {{.*}} @[[LWC]], i32 0, i32 3
|
|
// PGOUSE: br {{.*}} !prof ![[LW3:[0-9]+]]
|
|
if (i) {}
|
|
}
|
|
|
|
// PGOUSE-DAG: ![[LW1]] = !{!"branch_weights", i32 2, i32 1}
|
|
// PGOUSE-DAG: ![[LW2]] = !{!"branch_weights", i32 11, i32 2}
|
|
// PGOUSE-DAG: ![[LW3]] = !{!"branch_weights", i32 2, i32 1}
|
|
|
|
// LMBUSE-DAG: ![[LF1]] = !{!"branch_weights", i32 10, i32 2}
|
|
// LMBUSE-DAG: ![[LF2]] = !{!"branch_weights", i32 10, i32 2}
|
|
|
|
int main(int argc, const char *argv[]) {
|
|
lambdas();
|
|
return 0;
|
|
}
|