Files
TheRock/compiler/amd-llvm/llvm/test/DebugInfo/Generic/global-var-in-abstract-lexical-block.ll
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

64 lines
2.9 KiB
LLVM

; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info --name=static_local --show-parents - | FileCheck %s --implicit-check-not=DW_TAG
;; Derived from a CUDA program like:
;;
;; __forceinline__ __device__ void foo(int *p) {
;; { // lexical block -- scope of the static local
;; static __shared__ int static_local;
;; *p = static_local;
;; }
;; }
;;
;; __global__ void bar(int *q) {
;; {
;; foo(q); // foo is inlined here
;; }
;; }
;;
;; __forceinline__ causes foo to be inlined, so an abstract subprogram
;; origin is created for it. The `static __shared__` variable compiles to an
;; addrspace(3) global (not a local variable) whose DI scope is the
;; DILexicalBlock inside foo. When the abstract scope tree is built,
;; skipLexicalScope() may elide that lexical block because it has no local
;; variables -- but the global still needs the block as its context DIE.
;; The abstract "foo" subprogram must contain a DW_TAG_lexical_block holding
;; the "static_local" variable.
; CHECK: DW_TAG_compile_unit
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_name ("foo")
; CHECK: DW_AT_inline (DW_INL_inlined)
; CHECK: DW_TAG_lexical_block
; CHECK: DW_TAG_variable
; CHECK: DW_AT_name ("static_local")
@static_local = internal addrspace(3) global i32 0, align 4, !dbg !0
define void @_Z3barPi(ptr %q) !dbg !14 {
entry:
ret void, !dbg !17
}
!llvm.dbg.cu = !{!10}
!llvm.module.flags = !{!13}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "static_local", linkageName: "_ZZ3fooPiE12static_local", scope: !2, file: !3, line: 3, type: !9, isLocal: true, isDefinition: true)
!2 = distinct !DILexicalBlock(scope: !4, file: !3, line: 2, column: 1)
!3 = !DIFile(filename: "test.cu", directory: "/")
!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooPi", scope: !3, file: !3, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !10, retainedNodes: !12)
!5 = !DISubroutineType(types: !6)
!6 = !{!7, !8}
!7 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "void")
!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, addressSpace: 12)
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "lgenfe: EDG 6.8", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !11)
!11 = !{!0}
!12 = !{}
!13 = !{i32 1, !"Debug Info Version", i32 3}
!14 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barPi", scope: !3, file: !3, line: 9, type: !5, scopeLine: 9, spFlags: DISPFlagDefinition, unit: !10, retainedNodes: !12)
!15 = distinct !DILocation(line: 11, column: 3, scope: !16)
!16 = distinct !DILexicalBlock(scope: !14, file: !3, line: 10, column: 1)
!17 = !DILocation(line: 4, column: 3, scope: !2, inlinedAt: !15)