Debian Codegraph @

llvm/test/Verifier/RemoveDI/invalid-dbg-declare-operands.ll

raw
1 ; RUN: llvm-as %s -o - 2>&1 | FileCheck %s
2 ; CHECK: invalid #dbg record expression
3 ;
4 ; Fossilised debug-info with only two arguments to dbg.declare have been
5 ; spotted in LLVMs test suite (debug-info-always-inline.ll), test that this
6 ; does not cause a crash. LLVM needs to be able to autoupgrade invalid
7 ; dbg.declares to invalid #dbg_declares because this occurs before the
8 ; Verifier runs.
9
10 ; ModuleID = 'out.ll'
11 source_filename = "llvm/test/DebugInfo/Generic/debug-info-always-inline.ll"
12 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13 target triple = "x86_64-unknown-linux-gnu"
14
15 declare void @llvm.dbg.declare(metadata, metadata, metadata)
16
17 ; Function Attrs: alwaysinline nounwind sspstrong
18 define i32 @_Z3foov() !dbg !7 {
19 entry:
20 %sum = alloca i32, align 4, !dbg !11
21 call void @llvm.dbg.declare(metadata ptr %sum, metadata !26), !dbg !11
22 ret i32 0, !dbg !15
23 }
24
25 declare void @_Z3barv()
26
27 !llvm.module.flags = !{!0, !1}
28 !llvm.ident = !{!2}
29 !llvm.dbg.cu = !{!3}
30 !llvm.debugify = !{!5, !6}
31
32 !0 = !{i32 2, !"Dwarf Version", i32 4}
33 !1 = !{i32 2, !"Debug Info Version", i32 3}
34 !2 = !{!"clang version 3.6.0 (217844)"}
35 !3 = distinct !DICompileUnit(language: DW_LANG_C, file: !4, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
36 !4 = !DIFile(filename: "/fast/fs/llvm-main/llvm/test/DebugInfo/Generic/debug-info-always-inline.ll", directory: "/")
37 !5 = !{i32 14}
38 !6 = !{i32 7}
39 !7 = distinct !DISubprogram(name: "_Z3foov", linkageName: "_Z3foov", scope: null, file: !4, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !3, retainedNodes: !9)
40 !8 = !DISubroutineType(types: !9)
41 !9 = !{}
42 !11 = !DILocation(line: 2, column: 1, scope: !7)
43 !15 = !DILocation(line: 6, column: 1, scope: !7)
44 !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
45 !26 = !DILocalVariable(name: "b", scope: !7, file: !4, line: 1234, type: !25)
46