| 1 |
; REQUIRES: object-emission |
| 2 |
|
| 3 |
; RUN: llvm-as < %s -o %t.bc |
| 4 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 5 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll |
| 6 |
|
| 7 |
; RUN: llc -mtriple=%triple -O0 -filetype=obj < %t.ll > %t |
| 8 |
; RUN: llvm-dwarfdump %t | FileCheck %s |
| 9 |
|
| 10 |
; Also test that the null streamer doesn't crash with debug info. |
| 11 |
; RUN: llc -mtriple=%triple -O0 -filetype=null < %t.ll |
| 12 |
|
| 13 |
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" |
| 14 |
target triple = "spir64-unknown-unknown" |
| 15 |
|
| 16 |
; generated from the following source compiled to bitcode with clang -g -O1 |
| 17 |
; static int i; |
| 18 |
; int main() { |
| 19 |
; (void)&i; |
| 20 |
; } |
| 21 |
|
| 22 |
; CHECK: debug_info contents |
| 23 |
; CHECK: DW_TAG_variable |
| 24 |
|
| 25 |
source_filename = "test/DebugInfo/Generic/global.ll" |
| 26 |
|
| 27 |
; Function Attrs: nounwind readnone uwtable |
| 28 |
define i32 @main() #0 !dbg !9 { |
| 29 |
entry: |
| 30 |
ret i32 0, !dbg !12 |
| 31 |
} |
| 32 |
|
| 33 |
attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 34 |
|
| 35 |
!llvm.dbg.cu = !{!0} |
| 36 |
!llvm.module.flags = !{!7, !8} |
| 37 |
|
| 38 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.4 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2) |
| 39 |
!1 = !DIFile(filename: "global.cpp", directory: "/tmp") |
| 40 |
!2 = !{} |
| 41 |
!3 = !{!4} |
| 42 |
!4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression()) |
| 43 |
!5 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", scope: null, file: !1, line: 1, type: !6, isLocal: true, isDefinition: true) |
| 44 |
!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 45 |
!7 = !{i32 2, !"Dwarf Version", i32 3} |
| 46 |
!8 = !{i32 1, !"Debug Info Version", i32 3} |
| 47 |
!9 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2) |
| 48 |
!10 = !DISubroutineType(types: !11) |
| 49 |
!11 = !{!6} |
| 50 |
!12 = !DILocation(line: 4, scope: !9) |
| 51 |
|