summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/X86/PR24008.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/DebugInfo/X86/PR24008.ll')
-rw-r--r--llvm/test/DebugInfo/X86/PR24008.ll67
1 files changed, 67 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/X86/PR24008.ll b/llvm/test/DebugInfo/X86/PR24008.ll
new file mode 100644
index 00000000000..ec7c978775e
--- /dev/null
+++ b/llvm/test/DebugInfo/X86/PR24008.ll
@@ -0,0 +1,67 @@
+; 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 -g -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: 1, enums: !2, retainedTypes: !3, subprograms: !11)
+!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, 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)
+!11 = !{!6, !12}
+!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, 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)
OpenPOWER on IntegriCloud