1; RUN: llvm-as -disable-output <%s 2>&1| FileCheck %s
2
3; The DW_OP_LLVM_entry_value operation can only be used in MIR.
4
5; CHECK: Entry values are only allowed in MIR
6; CHECK: call void @llvm.dbg.value(metadata i32 %param, metadata !{{.*}}, metadata !DIExpression(DW_OP_LLVM_entry_value, 1))
7; CHECK: warning: ignoring invalid debug info
8
9define void @foo(i32 %param) !dbg !4 {
10entry:
11  call void @llvm.dbg.value(metadata i32 %param, metadata !8, metadata !DIExpression(DW_OP_LLVM_entry_value, 1)), !dbg !9
12  ret void
13}
14
15declare void @llvm.dbg.value(metadata, metadata, metadata) #0
16
17attributes #0 = { nounwind readnone speculatable willreturn }
18
19!llvm.dbg.cu = !{!0}
20!llvm.module.flags = !{!2, !3}
21
22!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug)
23!1 = !DIFile(filename: "a.c", directory: "/")
24!2 = !{i32 2, !"Dwarf Version", i32 4}
25!3 = !{i32 2, !"Debug Info Version", i32 3}
26!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, type: !5, unit: !0)
27!5 = !DISubroutineType(types: !6)
28!6 = !{null, !7}
29!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
30!8 = !DILocalVariable(name: "param", arg: 1, scope: !4, file: !1, type: !7)
31!9 = !DILocation(line: 0, scope: !4)
32