Files
TheRock/compiler/amd-llvm/llvm/test/tools/dsymutil/X86/inlined-static-variable.cpp
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

71 lines
2.1 KiB
C++

// RUN: dsymutil --linker classic -f -y %p/dummy-debug-map.map -oso-prepend-path \
// RUN: %p/../Inputs/inlined-static-variable -o - -keep-function-for-static \
// RUN: | llvm-dwarfdump - | FileCheck %s --implicit-check-not \
// RUN: "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}" \
// RUN: --check-prefixes=CHECK
//
// RUN: dsymutil --linker parallel --no-odr -f -y %p/dummy-debug-map.map \
// RUN: -oso-prepend-path %p/../Inputs/inlined-static-variable -o - \
// RUN: -keep-function-for-static | llvm-dwarfdump - | FileCheck %s \
// RUN: --implicit-check-not \
// RUN: "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}" \
// RUN: --check-prefixes=CHECK
// clang -g -c inlined-static-variable.cpp -o 4.o
// The functions removed and not_removed are not in the debug map and are
// considered dead, but they are also inlined into the function foo which is
// in the debug map. Those function-local globals are alive and thus should
// have locations in the debug info even if their functions do not.
inline __attribute__((always_inline)) int removed() {
static int a = 0;
return ++a;
}
__attribute__((always_inline)) int not_removed() {
static int b = 0;
return ++b;
}
int unused() {
static int c = 0;
return ++c;
}
int foo() {
return removed() + not_removed();
}
// CHECK: DW_TAG_compile_unit
// CHECK: DW_AT_low_pc
// CHECK: DW_AT_high_pc
// CHECK: DW_TAG_subprogram
// CHECK: DW_AT_name ("removed")
// CHECK: DW_TAG_variable
// CHECK: DW_AT_name ("a")
// CHECK: DW_AT_location
// CHECK: NULL
// CHECK: DW_TAG_base_type
// CHECK: DW_TAG_subprogram
// CHECK: DW_AT_name ("not_removed")
// CHECK: DW_TAG_variable
// CHECK: DW_AT_name ("b")
// CHECK: DW_AT_location
// CHECK: NULL
// CHECK: DW_TAG_subprogram
// CHECK: DW_AT_low_pc
// CHECK: DW_AT_high_pc
// CHECK: DW_AT_name ("foo")
// CHECK: DW_TAG_inlined_subroutine
// CHECK: DW_AT_low_pc
// CHECK: DW_AT_high_pc
// CHECK: DW_TAG_inlined_subroutine
// CHECK: DW_AT_low_pc
// CHECK: DW_AT_high_pc
// CHECK: NULL
// CHECK: NULL