| 1 |
; RUN: llvm-as < %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 3 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll |
| 4 |
|
| 5 |
; RUN: llc %t.ll -mtriple=x86_64-pc-linux-gnu -O0 -filetype=obj -o %t |
| 6 |
; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s |
| 7 |
|
| 8 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 9 |
target triple = "spir64-unknown-unknown" |
| 10 |
|
| 11 |
; If stack is realigned, we shouldn't describe locations of local |
| 12 |
; variables by giving offset from the frame pointer (%rbp): |
| 13 |
; push %rpb |
| 14 |
; mov %rsp,%rbp |
| 15 |
; and ALIGNMENT,%rsp ; (%rsp and %rbp are different now) |
| 16 |
; It's better to use offset from %rsp instead. |
| 17 |
|
| 18 |
; DW_AT_location of variable "x" shouldn't be equal to |
| 19 |
; (DW_OP_fbreg: .*): DW_OP_fbreg has code 0x91 |
| 20 |
|
| 21 |
; CHECK: {{0x.* DW_TAG_variable}} |
| 22 |
; CHECK-NOT: {{DW_AT_location.*DW_FORM_block1.*0x.*91}} |
| 23 |
; CHECK: NULL |
| 24 |
|
| 25 |
define void @_Z3runv() nounwind uwtable !dbg !5 { |
| 26 |
entry: |
| 27 |
%x = alloca i32, align 32 |
| 28 |
call void @llvm.dbg.declare(metadata i32* %x, metadata !9, metadata !DIExpression()), !dbg !12 |
| 29 |
ret void, !dbg !13 |
| 30 |
} |
| 31 |
|
| 32 |
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
| 33 |
|
| 34 |
!llvm.dbg.cu = !{!0} |
| 35 |
!llvm.module.flags = !{!15} |
| 36 |
|
| 37 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 155696:155697) (llvm/trunk 155696)", isOptimized: false, emissionKind: FullDebug, file: !14, enums: !1, retainedTypes: !1, globals: !1, imports: !1) |
| 38 |
!1 = !{} |
| 39 |
!5 = distinct !DISubprogram(name: "run", linkageName: "_Z3runv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !14, scope: !6, type: !7, retainedNodes: !1) |
| 40 |
!6 = !DIFile(filename: "test.cc", directory: "/home/samsonov/debuginfo") |
| 41 |
!7 = !DISubroutineType(types: !8) |
| 42 |
!8 = !{null} |
| 43 |
!9 = !DILocalVariable(name: "x", line: 2, scope: !10, file: !6, type: !11) |
| 44 |
!10 = distinct !DILexicalBlock(line: 1, column: 12, file: !14, scope: !5) |
| 45 |
!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 46 |
!12 = !DILocation(line: 2, column: 7, scope: !10) |
| 47 |
!13 = !DILocation(line: 3, column: 1, scope: !10) |
| 48 |
!14 = !DIFile(filename: "test.cc", directory: "/home/samsonov/debuginfo") |
| 49 |
!15 = !{i32 1, !"Debug Info Version", i32 3} |