| 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 -o - | llvm-dwarfdump -v -debug-info - | FileCheck %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 |
; Ensure that pointer constants are emitted as unsigned data. Alternatively, |
| 13 |
; these could be signless data (dataN). |
| 14 |
|
| 15 |
; Built with Clang from: |
| 16 |
; template <void *V, void (*F)(), int i> |
| 17 |
; void func() {} |
| 18 |
; template void func<nullptr, nullptr, 42>(); |
| 19 |
|
| 20 |
; CHECK: DW_TAG_subprogram |
| 21 |
; CHECK: DW_TAG_template_value_parameter |
| 22 |
; CHECK: DW_AT_name {{.*}} "V" |
| 23 |
; CHECK: DW_AT_const_value [DW_FORM_udata] (0) |
| 24 |
; CHECK: DW_TAG_template_value_parameter |
| 25 |
; CHECK: DW_AT_name {{.*}} "F" |
| 26 |
; CHECK: DW_AT_const_value [DW_FORM_udata] (0) |
| 27 |
|
| 28 |
; Function Attrs: nounwind uwtable |
| 29 |
define weak_odr void @_Z4funcILPv0ELPFvvE0ELi42EEvv() #0 !dbg !4 { |
| 30 |
entry: |
| 31 |
ret void, !dbg !18 |
| 32 |
} |
| 33 |
|
| 34 |
attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 35 |
|
| 36 |
!llvm.dbg.cu = !{!0} |
| 37 |
!llvm.module.flags = !{!15, !16} |
| 38 |
!llvm.ident = !{!17} |
| 39 |
|
| 40 |
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) |
| 41 |
!1 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo") |
| 42 |
!2 = !{} |
| 43 |
!4 = distinct !DISubprogram(name: "func<nullptr, nullptr, 42>", linkageName: "_Z4funcILPv0ELPFvvE0ELi42EEvv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, templateParams: !8, retainedNodes: !2) |
| 44 |
!5 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo") |
| 45 |
!6 = !DISubroutineType(types: !7) |
| 46 |
!7 = !{null} |
| 47 |
!8 = !{!9, !11, !13} |
| 48 |
!9 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "V", type: !10, value: i8 0) |
| 49 |
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) |
| 50 |
!11 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "F", type: !12, value: i8 0) |
| 51 |
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6) |
| 52 |
!13 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "i", type: !14, value: i32 42) |
| 53 |
!14 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 54 |
!15 = !{i32 2, !"Dwarf Version", i32 4} |
| 55 |
!16 = !{i32 2, !"Debug Info Version", i32 3} |
| 56 |
!17 = !{!"clang version 3.5.0 "} |
| 57 |
!18 = !DILocation(line: 3, scope: !4) |