| 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 -v %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 |
; This was pulled from clang's debug-info-template-recursive.cpp test. |
| 14 |
; class base { }; |
| 15 |
|
| 16 |
; template <class T> class foo : public base { |
| 17 |
; void operator=(const foo r) { } |
| 18 |
; }; |
| 19 |
|
| 20 |
; class bar : public foo<void> { }; |
| 21 |
; bar filters; |
| 22 |
|
| 23 |
; CHECK: DW_TAG_template_type_parameter [{{.*}}] |
| 24 |
; CHECK-NEXT: DW_AT_name{{.*}}"T" |
| 25 |
; CHECK-NOT: DW_AT_type |
| 26 |
; CHECK: {{DW_TAG|NULL}} |
| 27 |
|
| 28 |
source_filename = "test/DebugInfo/Generic/template-recursive-void.ll" |
| 29 |
|
| 30 |
%class.bar = type { i8 } |
| 31 |
|
| 32 |
@filters = global %class.bar zeroinitializer, align 1, !dbg !0 |
| 33 |
|
| 34 |
!llvm.dbg.cu = !{!29} |
| 35 |
!llvm.module.flags = !{!32, !33} |
| 36 |
|
| 37 |
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 38 |
!1 = !DIGlobalVariable(name: "filters", scope: null, file: !2, line: 10, type: !3, isLocal: false, isDefinition: true) |
| 39 |
!2 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp") |
| 40 |
!3 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", file: !2, line: 9, size: 8, align: 8, elements: !4) |
| 41 |
!4 = !{!5, !25} |
| 42 |
!5 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !3, baseType: !6) |
| 43 |
!6 = !DICompositeType(tag: DW_TAG_class_type, name: "foo<void>", file: !2, line: 5, size: 8, align: 8, elements: !7, templateParams: !23) |
| 44 |
!7 = !{!8, !15, !20} |
| 45 |
!8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9) |
| 46 |
!9 = !DICompositeType(tag: DW_TAG_class_type, name: "base", file: !2, line: 3, size: 8, align: 8, elements: !10) |
| 47 |
!10 = !{!11} |
| 48 |
!11 = !DISubprogram(name: "base", scope: !9, file: !2, line: 3, type: !12, isLocal: false, isDefinition: false, scopeLine: 3, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
| 49 |
!12 = !DISubroutineType(types: !13) |
| 50 |
!13 = !{null, !14} |
| 51 |
!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 52 |
!15 = !DISubprogram(name: "operator=", linkageName: "_ZN3fooIvEaSES0_", scope: !6, file: !2, line: 6, type: !16, isLocal: false, isDefinition: false, scopeLine: 6, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false) |
| 53 |
!16 = !DISubroutineType(types: !17) |
| 54 |
!17 = !{null, !18, !19} |
| 55 |
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 56 |
!19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6) |
| 57 |
!20 = !DISubprogram(name: "foo", scope: !6, file: !2, line: 5, type: !21, isLocal: false, isDefinition: false, scopeLine: 5, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
| 58 |
!21 = !DISubroutineType(types: !22) |
| 59 |
!22 = !{null, !18} |
| 60 |
!23 = !{!24} |
| 61 |
!24 = !DITemplateTypeParameter(name: "T", type: null) |
| 62 |
!25 = !DISubprogram(name: "bar", scope: !3, file: !2, line: 9, type: !26, isLocal: false, isDefinition: false, scopeLine: 9, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
| 63 |
!26 = !DISubroutineType(types: !27) |
| 64 |
!27 = !{null, !28} |
| 65 |
!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 66 |
!29 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !30, retainedTypes: !30, globals: !31, imports: !30) |
| 67 |
!30 = !{} |
| 68 |
!31 = !{!0} |
| 69 |
!32 = !{i32 2, !"Dwarf Version", i32 3} |
| 70 |
!33 = !{i32 1, !"Debug Info Version", i32 3} |
| 71 |
|