| 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 -filetype=obj < %t.ll > %t |
| 8 |
; RUN: llvm-dwarfdump %t | FileCheck %s |
| 9 |
|
| 10 |
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" |
| 11 |
target triple = "spir64-unknown-unknown" |
| 12 |
|
| 13 |
; IR generated from clang -O -g with the following source |
| 14 |
; |
| 15 |
; void f1(int x, int y); |
| 16 |
; void f3(int line); |
| 17 |
; void f2() { |
| 18 |
; f1(1, 2); |
| 19 |
; } |
| 20 |
; void f1(int x, int y) { |
| 21 |
; f3(y); |
| 22 |
; } |
| 23 |
|
| 24 |
; CHECK: DW_AT_name{{.*}}"f1" |
| 25 |
; CHECK: DW_TAG_formal_parameter |
| 26 |
; CHECK-NOT: DW_TAG |
| 27 |
; CHECK: DW_AT_name{{.*}}"x" |
| 28 |
; CHECK: DW_TAG_formal_parameter |
| 29 |
; CHECK-NOT: DW_TAG |
| 30 |
; CHECK: DW_AT_name{{.*}}"y" |
| 31 |
|
| 32 |
; Function Attrs: uwtable |
| 33 |
define void @_Z2f2v() #0 !dbg !4 { |
| 34 |
tail call void @llvm.dbg.value(metadata i32 undef, metadata !16, metadata !DIExpression()), !dbg !18 |
| 35 |
tail call void @llvm.dbg.value(metadata i32 2, metadata !20, metadata !DIExpression()), !dbg !18 |
| 36 |
tail call void @_Z2f3i(i32 2), !dbg !21 |
| 37 |
ret void, !dbg !22 |
| 38 |
} |
| 39 |
|
| 40 |
; Function Attrs: uwtable |
| 41 |
define void @_Z2f1ii(i32 %x, i32 %y) #0 !dbg !8 { |
| 42 |
tail call void @llvm.dbg.value(metadata i32 %x, metadata !13, metadata !DIExpression()), !dbg !23 |
| 43 |
tail call void @llvm.dbg.value(metadata i32 %y, metadata !14, metadata !DIExpression()), !dbg !23 |
| 44 |
tail call void @_Z2f3i(i32 %y), !dbg !24 |
| 45 |
ret void, !dbg !25 |
| 46 |
} |
| 47 |
|
| 48 |
declare void @_Z2f3i(i32) #1 |
| 49 |
|
| 50 |
; Function Attrs: nounwind readnone |
| 51 |
declare void @llvm.dbg.value(metadata, metadata, metadata) #2 |
| 52 |
|
| 53 |
attributes #0 = { 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" } |
| 54 |
attributes #1 = { "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" } |
| 55 |
attributes #2 = { nounwind readnone } |
| 56 |
|
| 57 |
!llvm.dbg.cu = !{!0} |
| 58 |
!llvm.module.flags = !{!26} |
| 59 |
|
| 60 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) |
| 61 |
!1 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") |
| 62 |
!2 = !{} |
| 63 |
!4 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, retainedNodes: !2) |
| 64 |
!5 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") |
| 65 |
!6 = !DISubroutineType(types: !7) |
| 66 |
!7 = !{null} |
| 67 |
!8 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1ii", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !9, retainedNodes: !12) |
| 68 |
!9 = !DISubroutineType(types: !10) |
| 69 |
!10 = !{null, !11, !11} |
| 70 |
!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 71 |
!12 = !{!13, !14} |
| 72 |
!13 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) |
| 73 |
!14 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) |
| 74 |
!15 = !{i32 undef} |
| 75 |
!16 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) |
| 76 |
!17 = !DILocation(line: 4, scope: !4) |
| 77 |
!18 = !DILocation(line: 6, scope: !8, inlinedAt: !17) |
| 78 |
!19 = !{i32 2} |
| 79 |
!20 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) |
| 80 |
!21 = !DILocation(line: 7, scope: !8, inlinedAt: !17) |
| 81 |
!22 = !DILocation(line: 5, scope: !4) |
| 82 |
!23 = !DILocation(line: 6, scope: !8) |
| 83 |
!24 = !DILocation(line: 7, scope: !8) |
| 84 |
!25 = !DILocation(line: 8, scope: !8) |
| 85 |
!26 = !{i32 1, !"Debug Info Version", i32 3} |