blob: c4a76de5989c21533da25c591ded2a723d6879a6 [file] [log] [blame]
Sam Kolton6e795292017-04-07 10:53:12 +00001; RUN: llc -O0 -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -verify-machineinstrs -mattr=-flat-for-global < %s | FileCheck %s
Matt Arsenaultc5746862015-08-12 09:04:44 +00002
3; CHECK-LABEL: {{^}}test_debug_value:
Matt Arsenault26f8f3d2015-11-30 21:16:03 +00004; CHECK: s_load_dwordx2 s[4:5]
Matt Arsenault640c44b2016-11-29 19:39:53 +00005
6; FIXME: Why is the SGPR4_SGPR5 reference being removed from DBG_VALUE?
7; CHECK: ; kill: %SGPR4_SGPR5<def> %SGPR4_SGPR5<kill>
8; CHECK-NEXT: ;DEBUG_VALUE: test_debug_value:globalptr_arg <- undef
9
Rafael Espindola4b0d24c2015-12-22 19:46:44 +000010; CHECK: buffer_store_dword
Matt Arsenaultc5746862015-08-12 09:04:44 +000011; CHECK: s_endpgm
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000012define amdgpu_kernel void @test_debug_value(i32 addrspace(1)* nocapture %globalptr_arg) #0 !dbg !4 {
Matt Arsenaultc5746862015-08-12 09:04:44 +000013entry:
14 tail call void @llvm.dbg.value(metadata i32 addrspace(1)* %globalptr_arg, i64 0, metadata !10, metadata !13), !dbg !14
15 store i32 123, i32 addrspace(1)* %globalptr_arg, align 4
16 ret void
17}
18
19declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
20
Matt Arsenault45f82162016-07-11 23:35:48 +000021attributes #0 = { nounwind }
Matt Arsenaultc5746862015-08-12 09:04:44 +000022attributes #1 = { nounwind readnone }
23
24!llvm.dbg.cu = !{!0}
25!llvm.module.flags = !{!11, !12}
26
Adrian Prantl75819ae2016-04-15 15:57:41 +000027!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: FullDebug, enums: !2)
Matt Arsenaultc5746862015-08-12 09:04:44 +000028!1 = !DIFile(filename: "/tmp/test_debug_value.cl", directory: "/Users/matt/src/llvm/build_debug")
29!2 = !{}
Adrian Prantl75819ae2016-04-15 15:57:41 +000030!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, unit: !0, variables: !9)
Matt Arsenaultc5746862015-08-12 09:04:44 +000031!5 = !DISubroutineType(types: !6)
32!6 = !{null, !7}
33!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 32)
34!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
35!9 = !{!10}
36!10 = !DILocalVariable(name: "globalptr_arg", arg: 1, scope: !4, file: !1, line: 1, type: !7)
37!11 = !{i32 2, !"Dwarf Version", i32 4}
38!12 = !{i32 2, !"Debug Info Version", i32 3}
39!13 = !DIExpression()
Duncan P. N. Exon Smith814b8e92015-08-28 20:26:49 +000040!14 = !DILocation(line: 1, column: 42, scope: !4)