| 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 | llvm-dwarfdump -v -debug-info - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s |
| 8 |
|
| 9 |
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" |
| 10 |
target triple = "spir64-unknown-unknown" |
| 11 |
|
| 12 |
; Generated from the following source: |
| 13 |
; namespace ns { |
| 14 |
; void f(); |
| 15 |
; } |
| 16 |
; inline __attribute__((always_inline)) void f1() { |
| 17 |
; using ns::f; |
| 18 |
; f(); |
| 19 |
; } |
| 20 |
; void f2() { f1(); } |
| 21 |
|
| 22 |
; Ensure that top level imported declarations don't produce an extra degenerate |
| 23 |
; concrete subprogram definition. |
| 24 |
|
| 25 |
; FIXME: imported entities should only be emitted to the abstract origin if one is present |
| 26 |
|
| 27 |
; CHECK: DW_TAG_compile_unit |
| 28 |
; CHECK: DW_TAG_subprogram |
| 29 |
; CHECK: DW_AT_name {{.*}} "f1" |
| 30 |
; CHECK: DW_TAG_imported_declaration |
| 31 |
; CHECK: NULL |
| 32 |
; CHECK: DW_TAG_namespace |
| 33 |
; CHECK: DW_TAG_subprogram |
| 34 |
; CHECK: NULL |
| 35 |
; CHECK: DW_TAG_subprogram |
| 36 |
; CHECK: DW_AT_name {{.*}} "f2" |
| 37 |
; CHECK: DW_TAG_inlined_subroutine |
| 38 |
; CHECK: DW_TAG_imported_declaration |
| 39 |
; CHECK: NULL |
| 40 |
; CHECK: NULL |
| 41 |
; CHECK: NULL |
| 42 |
|
| 43 |
; Function Attrs: noinline |
| 44 |
define void @_Z2f2v() noinline !dbg !14 { |
| 45 |
entry: |
| 46 |
call void @_ZN2ns1fEv(), !dbg !15 |
| 47 |
ret void, !dbg !17 |
| 48 |
} |
| 49 |
|
| 50 |
declare void @_ZN2ns1fEv() |
| 51 |
|
| 52 |
!llvm.dbg.cu = !{!0} |
| 53 |
!llvm.module.flags = !{!10, !11, !12} |
| 54 |
!llvm.ident = !{!13} |
| 55 |
|
| 56 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 309061) (llvm/trunk 309076)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !3) |
| 57 |
!1 = !DIFile(filename: "imported-name-inlined.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") |
| 58 |
!2 = !{} |
| 59 |
!3 = !{!4} |
| 60 |
!4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !8, file: !1, line: 5) |
| 61 |
!5 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) |
| 62 |
!6 = !DISubroutineType(types: !7) |
| 63 |
!7 = !{null} |
| 64 |
!8 = !DISubprogram(name: "f", linkageName: "_ZN2ns1fEv", scope: !9, file: !1, line: 2, type: !6, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false) |
| 65 |
!9 = !DINamespace(name: "ns", scope: null) |
| 66 |
!10 = !{i32 2, !"Dwarf Version", i32 4} |
| 67 |
!11 = !{i32 2, !"Debug Info Version", i32 3} |
| 68 |
!12 = !{i32 1, !"wchar_size", i32 4} |
| 69 |
!13 = !{!"clang version 6.0.0 (trunk 309061) (llvm/trunk 309076)"} |
| 70 |
!14 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 8, type: !6, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) |
| 71 |
!15 = !DILocation(line: 6, column: 3, scope: !5, inlinedAt: !16) |
| 72 |
!16 = distinct !DILocation(line: 8, column: 13, scope: !14) |
| 73 |
!17 = !DILocation(line: 8, column: 19, scope: !14) |