Files
TheRock/compiler/spirv-llvm-translator/test/DebugInfo/NonSemantic/Shader200/InlineNamespace.ll
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

73 lines
3.3 KiB
LLVM

; RUN: llvm-spirv -spirv-text %s -o %t.spt --spirv-debug-info-version=nonsemantic-shader-200
; RUN: FileCheck < %t.spt %s -check-prefix=CHECK-SPIRV
; RUN: llvm-spirv -to-binary %t.spt -o %t.spv
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
; RUN: FileCheck < %t.rev.ll %s -check-prefix=CHECK-LLVM
; Source:
; -- inline-namespace.cxx -----------------------------------------------------
; 1 inline namespace Outer {
; 2 namespace Inner {
; 3 int global;
; 4 }
; 5 }
; 6
; 7 void foo() {
; 8 Inner::global++;
; 9 }
; -- inline-namespace.cxx -----------------------------------------------------
; CHECK-SPIRV: String [[#StrOuter:]] "Outer"
; CHECK-SPIRV: String [[#StrInner:]] "Inner"
; CHECK-SPIRV: TypeVoid [[#VoidTy:]]
; CHECK-SPIRV: TypeBool [[#TypeBool:]]
; CHECK-SPIRV: ConstantTrue [[#TypeBool]] [[#ConstTrue:]]
; CHECK-SPIRV: ConstantFalse [[#TypeBool]] [[#ConstFalse:]]
; Void-returning function: ReturnType must be VoidTy, not DebugInfoNone.
; CHECK-SPIRV: ExtInst [[#VoidTy]] [[#]] [[#]] DebugTypeFunction [[#]] [[#VoidTy]]
; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugLexicalBlock [[#]] [[#]] [[#]] [[#]] [[#StrOuter]] [[#ConstTrue]]
; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugLexicalBlock [[#]] [[#]] [[#]] [[#]] [[#StrInner]] [[#ConstFalse]]
; CHECK-LLVM: !DINamespace(name: "Inner", scope: ![[#OuterSpace:]])
; CHECK-LLVM: ![[#OuterSpace]] = !DINamespace(name: "Outer", scope: null, exportSymbols: true)
; ModuleID = 'inline-namespace.cxx'
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "spir64-unknown-unknown"
@_ZN5Outer5Inner6globalE = dso_local addrspace(1) global i32 0, align 4, !dbg !0
; Function Attrs: noinline nounwind optnone uwtable mustprogress
define dso_local void @_Z3foov() #0 !dbg !11 {
entry:
%0 = load i32, ptr addrspace(1) @_ZN5Outer5Inner6globalE, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
store i32 %inc, ptr addrspace(1) @_ZN5Outer5Inner6globalE, align 4, !dbg !14
ret void, !dbg !15
}
attributes #0 = { noinline nounwind optnone uwtable mustprogress }
!llvm.dbg.cu = !{!6}
!llvm.module.flags = !{!9, !10}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "global", linkageName: "_ZN5Outer5Inner6globalE", scope: !2, file: !4, line: 3, type: !5, isLocal: false, isDefinition: true)
!2 = !DINamespace(name: "Inner", scope: !3)
!3 = !DINamespace(name: "Outer", scope: null, exportSymbols: true)
!4 = !DIFile(filename: "inlined-namespace.cxx", directory: "/path/to")
!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !4, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !7, globals: !8, splitDebugInlining: false, nameTableKind: None)
!7 = !{}
!8 = !{!0}
!9 = !{i32 7, !"Dwarf Version", i32 4}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !4, file: !4, line: 7, type: !12, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !7)
!12 = !DISubroutineType(types: !13)
!13 = !{null}
!14 = !DILocation(line: 8, column: 16, scope: !11)
!15 = !DILocation(line: 9, column: 1, scope: !11)