blob: abf392f531d55dcbcbee6fc82bed6666966b0446 [file] [log] [blame]
Vedant Kumarc1cad152020-06-18 14:17:07 -07001; RUN: opt -check-debugify < %s -S -o - 2>&1 | FileCheck %s -implicit-check-not "WARNING: Instruction with empty DebugLoc in function bar"
Vedant Kumar197e73f2018-06-28 18:21:11 +00002
Vedant Kumarc1cad152020-06-18 14:17:07 -07003; CHECK: WARNING: Instruction with empty DebugLoc in function foo -- ret void
Vedant Kumar197e73f2018-06-28 18:21:11 +00004define void @foo() !dbg !6 {
5 ret void
6}
7
Vedant Kumar197e73f2018-06-28 18:21:11 +00008define i32 @bar() !dbg !9 {
9 ret i32 0, !dbg !15
10}
11
12declare void @llvm.dbg.value(metadata, metadata, metadata)
13
14!llvm.dbg.cu = !{!0}
15!llvm.debugify = !{!3, !4}
16!llvm.module.flags = !{!5}
17
18!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
19!1 = !DIFile(filename: "void", directory: "/")
20!2 = !{}
21!3 = !{i32 6}
22!4 = !{i32 1}
23!5 = !{i32 2, !"Debug Info Version", i32 3}
24!6 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2)
25!7 = !DISubroutineType(types: !2)
26!9 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: null, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, retainedNodes: !10)
27!10 = !{!11}
28!11 = !DILocalVariable(name: "1", scope: !9, file: !1, line: 3, type: !12)
29!12 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
30!15 = !DILocation(line: 0, column: 1, scope: !9)