blob: c5aba2b76b89081798432328fb97215b71a9f228 [file] [log] [blame]
Matt Arsenaultc5746862015-08-12 09:04:44 +00001; RUN: llc -O0 -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -verify-machineinstrs < %s | FileCheck %s
2
3; CHECK-LABEL: {{^}}test_debug_value:
4; CHECK: s_load_dwordx2
Dan Gohman7aa4aba2015-11-17 16:01:28 +00005; CHECK: DEBUG_VALUE: test_debug_value:globalptr_arg <- %SGPR0_SGPR1
Matt Arsenaultc5746862015-08-12 09:04:44 +00006; CHECK: buffer_store_dword
7; CHECK: s_endpgm
Peter Collingbourned4bff302015-11-05 22:03:56 +00008define void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 !dbg !4 {
Matt Arsenaultc5746862015-08-12 09:04:44 +00009entry:
10 tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %globalptr_arg, i64 0, metadata !10, metadata !13), !dbg !14
11 store i32 123, i32 addrspace(1)* %globalptr_arg, align 4
12 ret void
13}
14
15declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
16
17attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
18attributes #1 = { nounwind readnone }
19
20!llvm.dbg.cu = !{!0}
21!llvm.module.flags = !{!11, !12}
22
23!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 244715) (llvm/trunk 244718)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3)
24!1 = !DIFile(filename: "/tmp/test_debug_value.cl", directory: "/Users/matt/src/llvm/build_debug")
25!2 = !{}
26!3 = !{!4}
Peter Collingbourned4bff302015-11-05 22:03:56 +000027!4 = distinct !DISubprogram(name: "test_debug_value", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !9)
Matt Arsenaultc5746862015-08-12 09:04:44 +000028!5 = !DISubroutineType(types: !6)
29!6 = !{null, !7}
30!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 32)
31!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
32!9 = !{!10}
33!10 = !DILocalVariable(name: "globalptr_arg", arg: 1, scope: !4, file: !1, line: 1, type: !7)
34!11 = !{i32 2, !"Dwarf Version", i32 4}
35!12 = !{i32 2, !"Debug Info Version", i32 3}
36!13 = !DIExpression()
Duncan P. N. Exon Smith814b8e92015-08-28 20:26:49 +000037!14 = !DILocation(line: 1, column: 42, scope: !4)