blob: df97efb417c7a85051ba8402ef4f48919a5fa065 [file] [log] [blame]
Duncan P. N. Exon Smithed356a92015-02-13 01:26:47 +00001; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
2; RUN: verify-uselistorder %s
3
Peter Collingbourne5f220be2015-11-05 22:03:56 +00004; CHECK: define void @_Z3foov() !dbg !9
5define void @_Z3foov() !dbg !9 {
6 ret void
7}
Duncan P. N. Exon Smithed356a92015-02-13 01:26:47 +00008
Paul Robinsonccefd882018-11-28 21:14:32 +00009; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15}
10!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15}
Duncan P. N. Exon Smithed356a92015-02-13 01:26:47 +000011
Duncan P. N. Exon Smithd397a522015-03-28 02:26:45 +000012!0 = !{null}
Duncan P. N. Exon Smithe56023a2015-04-29 16:38:44 +000013!1 = distinct !DICompositeType(tag: DW_TAG_structure_type)
14!2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
15!3 = !DISubroutineType(types: !0)
16!4 = distinct !DICompositeType(tag: DW_TAG_structure_type)
Duncan P. N. Exon Smithed356a92015-02-13 01:26:47 +000017!5 = distinct !{}
Duncan P. N. Exon Smitha5ae7c12015-08-28 20:26:49 +000018!6 = distinct !{}
Duncan P. N. Exon Smithed356a92015-02-13 01:26:47 +000019
Paul Robinsonccefd882018-11-28 21:14:32 +000020; CHECK: !7 = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: !8)
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000021!7 = distinct !DISubprogram(unit: !8)
Duncan P. N. Exon Smithed356a92015-02-13 01:26:47 +000022
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000023!8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
Davide Italiano5b62b452016-04-04 02:11:34 +000024 file: !2,
25 isOptimized: true, flags: "-O2",
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000026 splitDebugFilename: "abc.debug", emissionKind: 2)
27
Paul Robinsonccefd882018-11-28 21:14:32 +000028; CHECK: !9 = !DISubprogram(scope: null, spFlags: 0)
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000029!9 = !DISubprogram(isDefinition: false)
30
Paul Robinsonccefd882018-11-28 21:14:32 +000031; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, scopeLine: 8, containingType: !4, virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !8, templateParams: !5, declaration: !9, retainedNodes: !6)
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000032!10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
33 file: !2, line: 7, type: !3, isLocal: true,
34 isDefinition: true, scopeLine: 8,
35 containingType: !4,
36 virtuality: DW_VIRTUALITY_pure_virtual,
Adrian Prantl926ddae2016-08-17 16:02:43 +000037 virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn,
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000038 isOptimized: true, unit: !8, templateParams: !5,
Shiva Chena8a13bc2018-05-09 02:40:45 +000039 declaration: !9, retainedNodes: !6)
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000040
41; CHECK: !11 = distinct !DISubprogram
42; CHECK-SAME: virtualIndex: 0,
43!11 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
44 file: !2, line: 7, type: !3, isLocal: true,
45 isDefinition: true, scopeLine: 8,
46 containingType: !4,
47 virtuality: DW_VIRTUALITY_pure_virtual,
48 virtualIndex: 0,
49 flags: DIFlagPrototyped, isOptimized: true,
50 unit: !8, templateParams: !5, declaration: !9,
Shiva Chena8a13bc2018-05-09 02:40:45 +000051 retainedNodes: !6)
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000052
53; CHECK: !12 = distinct !DISubprogram
54; CHECK-NOT: virtualIndex
55!12 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
56 file: !2, line: 7, type: !3, isLocal: true,
57 isDefinition: true, scopeLine: 8,
58 containingType: !4,
59 virtuality: DW_VIRTUALITY_none,
60 flags: DIFlagPrototyped, isOptimized: true,
61 unit: !8,
Shiva Chena8a13bc2018-05-09 02:40:45 +000062 templateParams: !5, declaration: !9, retainedNodes: !6)
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000063
Adrian Prantl1bf62972017-04-26 22:56:44 +000064!13 = !{!4}
65; CHECK: !13 = !{!4}
Paul Robinsonccefd882018-11-28 21:14:32 +000066; CHECK: !14 = distinct !DISubprogram(name: "foo", scope: !1, file: !2, line: 1, type: !3, scopeLine: 2, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !8, thrownTypes: !13)
Adrian Prantl1bf62972017-04-26 22:56:44 +000067!14 = distinct !DISubprogram(name: "foo", scope: !1,
68 file: !2, line: 1, type: !3, isLocal: true,
69 isDefinition: true, scopeLine: 2, isOptimized: false,
70 unit: !8, thrownTypes: !13)
71
Paul Robinsonccefd882018-11-28 21:14:32 +000072; CHECK: !15 = distinct !DISubprogram({{.*}}, flags: DIFlagPrototyped, spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized,
73!15 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
74 file: !2, line: 7, type: !3, scopeLine: 8,
75 containingType: !4, virtualIndex: 0,
76 flags: DIFlagPrototyped,
77 spFlags: DISPFlagPureVirtual | DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized,
78 unit: !8, templateParams: !5, declaration: !9,
79 retainedNodes: !6)
80
81!16 = !{i32 1, !"Debug Info Version", i32 3}
82!llvm.module.flags = !{!16}
Adrian Prantl4eeaa0d2016-04-15 15:57:41 +000083!llvm.dbg.cu = !{!8}