| 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 -mtriple=%triple -stop-after=livedebugvalues -o - %t.ll \ |
| 6 |
; RUN: | FileCheck %s --check-prefix=SANITY |
| 7 |
; RUN: llc -mtriple=%triple -march=x86-64 -o - %t.ll -filetype=obj \ |
| 8 |
; RUN: | llvm-dwarfdump -v -all - | FileCheck %s |
| 9 |
; |
| 10 |
; CHECK: .debug_info contents: |
| 11 |
; CHECK: DW_TAG_variable |
| 12 |
; CHECK-NEXT: DW_AT_location [DW_FORM_data4] ( |
| 13 |
; CHECK-NEXT: {{.*}}: DW_OP_reg0 RAX) |
| 14 |
; CHECK-NEXT: DW_AT_name{{.*}}"a" |
| 15 |
|
| 16 |
; SANITY: DBG_VALUE |
| 17 |
; SANITY-NOT: DBG_VALUE |
| 18 |
|
| 19 |
; Compiled with -O: |
| 20 |
; void h(int); |
| 21 |
; int g(); |
| 22 |
; void f() { |
| 23 |
; h(0); |
| 24 |
; int a = g(); |
| 25 |
; h(a); |
| 26 |
; } |
| 27 |
|
| 28 |
; ModuleID = 'test.ll' |
| 29 |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 30 |
target triple = "spir64-unknown-unknown" |
| 31 |
|
| 32 |
; Function Attrs: nounwind ssp uwtable |
| 33 |
define void @f() #0 !dbg !4 { |
| 34 |
entry: |
| 35 |
tail call void @h(i32 0) #2, !dbg !14 |
| 36 |
%call = tail call i32 (...) @g() #2, !dbg !15 |
| 37 |
tail call void @llvm.dbg.value(metadata i32 %call, metadata !8, metadata !16), !dbg !17 |
| 38 |
tail call void @h(i32 %call) #2, !dbg !18 |
| 39 |
ret void, !dbg !19 |
| 40 |
} |
| 41 |
|
| 42 |
declare void @h(i32) |
| 43 |
|
| 44 |
declare i32 @g(...) |
| 45 |
|
| 46 |
; Function Attrs: nounwind readnone |
| 47 |
declare void @llvm.dbg.value(metadata, metadata, metadata) #1 |
| 48 |
|
| 49 |
attributes #0 = { nounwind ssp uwtable "no-frame-pointer-elim"="true" } |
| 50 |
attributes #1 = { nounwind readnone } |
| 51 |
attributes #2 = { nounwind } |
| 52 |
|
| 53 |
!llvm.dbg.cu = !{!0} |
| 54 |
!llvm.module.flags = !{!10, !11, !12} |
| 55 |
!llvm.ident = !{!13} |
| 56 |
|
| 57 |
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 58 |
!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm") |
| 59 |
!2 = !{} |
| 60 |
!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !7) |
| 61 |
!5 = !DISubroutineType(types: !6) |
| 62 |
!6 = !{null} |
| 63 |
!7 = !{!8} |
| 64 |
!8 = !DILocalVariable(name: "a", scope: !4, file: !1, line: 5, type: !9) |
| 65 |
!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 66 |
!10 = !{i32 2, !"Dwarf Version", i32 2} |
| 67 |
!11 = !{i32 2, !"Debug Info Version", i32 3} |
| 68 |
!12 = !{i32 1, !"PIC Level", i32 2} |
| 69 |
!13 = !{!"clang version 3.9.0 "} |
| 70 |
!14 = !DILocation(line: 4, column: 3, scope: !4) |
| 71 |
!15 = !DILocation(line: 5, column: 11, scope: !4) |
| 72 |
!16 = !DIExpression() |
| 73 |
!17 = !DILocation(line: 5, column: 7, scope: !4) |
| 74 |
!18 = !DILocation(line: 6, column: 3, scope: !4) |
| 75 |
!19 = !DILocation(line: 7, column: 1, scope: !4) |