xref: /aosp_15_r20/external/llvm/test/DebugInfo/Generic/constant-pointers.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; REQUIRES: object-emission
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; RUN: %llc_dwarf -O0 -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; Ensure that pointer constants are emitted as unsigned data. Alternatively,
6*9880d681SAndroid Build Coastguard Worker; these could be signless data (dataN).
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; Built with Clang from:
9*9880d681SAndroid Build Coastguard Worker; template <void *V, void (*F)(), int i>
10*9880d681SAndroid Build Coastguard Worker; void func() {}
11*9880d681SAndroid Build Coastguard Worker; template void func<nullptr, nullptr, 42>();
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_subprogram
14*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_TAG_template_value_parameter
15*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_AT_name {{.*}} "V"
16*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_AT_const_value [DW_FORM_udata] (0)
17*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_TAG_template_value_parameter
18*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_AT_name {{.*}} "F"
19*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_AT_const_value [DW_FORM_udata] (0)
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
22*9880d681SAndroid Build Coastguard Workerdefine weak_odr void @_Z4funcILPv0ELPFvvE0ELi42EEvv() #0 !dbg !4 {
23*9880d681SAndroid Build Coastguard Workerentry:
24*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !18
25*9880d681SAndroid Build Coastguard Worker}
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerattributes #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" }
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
30*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!15, !16}
31*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!17}
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker!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)
34*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
35*9880d681SAndroid Build Coastguard Worker!2 = !{}
36*9880d681SAndroid Build Coastguard Worker!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, variables: !2)
37*9880d681SAndroid Build Coastguard Worker!5 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
38*9880d681SAndroid Build Coastguard Worker!6 = !DISubroutineType(types: !7)
39*9880d681SAndroid Build Coastguard Worker!7 = !{null}
40*9880d681SAndroid Build Coastguard Worker!8 = !{!9, !11, !13}
41*9880d681SAndroid Build Coastguard Worker!9 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "V", type: !10, value: i8 0)
42*9880d681SAndroid Build Coastguard Worker!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
43*9880d681SAndroid Build Coastguard Worker!11 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "F", type: !12, value: i8 0)
44*9880d681SAndroid Build Coastguard Worker!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6)
45*9880d681SAndroid Build Coastguard Worker!13 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, name: "i", type: !14, value: i32 42)
46*9880d681SAndroid Build Coastguard Worker!14 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
47*9880d681SAndroid Build Coastguard Worker!15 = !{i32 2, !"Dwarf Version", i32 4}
48*9880d681SAndroid Build Coastguard Worker!16 = !{i32 2, !"Debug Info Version", i32 3}
49*9880d681SAndroid Build Coastguard Worker!17 = !{!"clang version 3.5.0 "}
50*9880d681SAndroid Build Coastguard Worker!18 = !DILocation(line: 3, scope: !4)
51