1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
;; This test checks the following:
;; 1. Compilation does not crash
;; 2. "f1" function is defined.
;; 3. "nested::f2" function is not defined.
;;
;; This test was generated by running following command:
;; clang -cc1 -O0 -debug-info-kind=limited -emit-llvm foo.cpp -o - | opt -S -inline -sroa
;; Where test.cpp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;void f1() {
;; while (true) {
;; struct nested {
;; static void f2() {}
;; };
;; nested::f2();
;; }
;;}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CHECK: DW_TAG_compile_unit
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_subprogram
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_AT_name {{.*}} "f1"
; CHECK: NULL
; CHECK-NOT: DW_TAG_subprogram
; Function Attrs: nounwind
define void @_Z2f1v() #0 !dbg !6 {
entry:
br label %while.body, !dbg !16
while.body: ; preds = %while.body, %entry
br label %while.body, !dbg !16
return: ; No predecessors!
ret void, !dbg !17
}
attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!13, !14}
!llvm.ident = !{!15}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3)
!1 = !DIFile(filename: "foo.cpp", directory: "/")
!2 = !{}
!3 = !{!4}
!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "nested", scope: !5, file: !1, line: 3, size: 8, align: 8, elements: !9)
!5 = distinct !DILexicalBlock(scope: !6, file: !1, line: 2)
!6 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!7 = !DISubroutineType(types: !8)
!8 = !{null}
!9 = !{!10}
!10 = distinct !DISubprogram(name: "f2", scope: !4, file: !1, line: 4, type: !7, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false)
!12 = distinct !DISubprogram(name: "f2", linkageName: "_ZZ2f1vEN6nested2f2Ev", scope: !4, file: !1, line: 4, type: !7, isLocal: true, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, declaration: !10, unit: !0, variables: !2)
!13 = !{i32 2, !"Dwarf Version", i32 4}
!14 = !{i32 2, !"Debug Info Version", i32 3}
!15 = !{!"clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)"}
!16 = !DILocation(line: 2, scope: !6)
!17 = !DILocation(line: 8, scope: !6)
|