Files
TheRock/compiler/amd-llvm/llvm/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.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

79 lines
2.8 KiB
LLVM

; RUN: llc -filetype=asm -asm-verbose=0 -arm-atomic-cfg-tidy=0 < %s | FileCheck %s
; int main()
; {
; int x = 0;
; if (x > 0)
; return x;
; x = -1; // <== this line should have correct debug location
; return -1;
; }
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7--linux-gnueabihf"
; Function Attrs: nounwind
define i32 @main() !dbg !4 {
entry:
%retval = alloca i32, align 4
%x = alloca i32, align 4
store i32 0, ptr %retval
call void @llvm.dbg.declare(metadata ptr %x, metadata !10, metadata !11), !dbg !12
store i32 0, ptr %x, align 4, !dbg !12
%0 = load i32, ptr %x, align 4, !dbg !13
%cmp = icmp sgt i32 %0, 0, !dbg !15
br i1 %cmp, label %if.then, label %if.end, !dbg !16
if.then: ; preds = %entry
%1 = load i32, ptr %x, align 4, !dbg !17
store i32 %1, ptr %retval, !dbg !18
br label %return, !dbg !18
if.end: ; preds = %entry
; Materialize the constant.
; CHECK: .loc 1 6 7
; CHECK-NEXT: mvn r0, #0
; The backend performs the store to %retval first, for some reason.
; CHECK-NEXT: .loc 1 7 5
; CHECK-NEXT: str r0, [sp, #4]
store i32 -1, ptr %x, align 4, !dbg !19
; CHECK-NEXT: .loc 1 6 7
; CHECK-NEXT: str r0, [sp]
store i32 -1, ptr %retval, !dbg !20
br label %return, !dbg !20
return: ; preds = %if.end, %if.then
%2 = load i32, ptr %retval, !dbg !21
ret i32 %2, !dbg !21
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, emissionKind: FullDebug)
!1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
!2 = !{}
!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{!7}
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !{i32 2, !"Dwarf Version", i32 4}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !7)
!11 = !DIExpression()
!12 = !DILocation(line: 3, column: 9, scope: !4)
!13 = !DILocation(line: 4, column: 9, scope: !14)
!14 = distinct !DILexicalBlock(scope: !4, file: !1, line: 4, column: 9)
!15 = !DILocation(line: 4, column: 11, scope: !14)
!16 = !DILocation(line: 4, column: 9, scope: !4)
!17 = !DILocation(line: 5, column: 13, scope: !14)
!18 = !DILocation(line: 5, column: 9, scope: !14)
!19 = !DILocation(line: 6, column: 7, scope: !4)
!20 = !DILocation(line: 7, column: 5, scope: !4)
!21 = !DILocation(line: 8, column: 1, scope: !4)