1 ; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s
4 call void @llvm.dbg.value(
6 metadata !DILocalVariable(scope: !1),
7 metadata !DIExpression())
8 ; CHECK-LABEL: llvm.dbg.value intrinsic requires a !dbg attachment
9 ; CHECK-NEXT: call void @llvm.dbg.value({{.*}})
10 ; CHECK-NEXT: label %entry
11 ; CHECK-NEXT: void ()* @foo
13 call void @llvm.dbg.declare(
15 metadata !DILocalVariable(scope: !1),
16 metadata !DIExpression())
17 ; CHECK-LABEL: llvm.dbg.declare intrinsic requires a !dbg attachment
18 ; CHECK-NEXT: call void @llvm.dbg.declare({{.*}})
19 ; CHECK-NEXT: label %entry
20 ; CHECK-NEXT: void ()* @foo
22 call void @llvm.dbg.value(
24 metadata !DILocalVariable(scope: !1),
25 metadata !DIExpression()),
26 !dbg !DILocation(scope: !2)
27 ; CHECK-LABEL: mismatched subprogram between llvm.dbg.value variable and !dbg attachment
28 ; CHECK-NEXT: call void @llvm.dbg.value({{[^,]+}}, metadata ![[VAR:[0-9]+]], {{[^,]+}}), !dbg ![[LOC:[0-9]+]]
29 ; CHECK-NEXT: label %entry
30 ; CHECK-NEXT: void ()* @foo
31 ; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]]
32 ; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram(
33 ; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]]
34 ; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram(
36 call void @llvm.dbg.declare(
38 metadata !DILocalVariable(scope: !1),
39 metadata !DIExpression()),
40 !dbg !DILocation(scope: !2)
41 ; CHECK-LABEL: mismatched subprogram between llvm.dbg.declare variable and !dbg attachment
42 ; CHECK-NEXT: call void @llvm.dbg.declare({{[^,]+}}, metadata ![[VAR:[0-9]+]], {{.*[^,]+}}), !dbg ![[LOC:[0-9]+]]
43 ; CHECK-NEXT: label %entry
44 ; CHECK-NEXT: void ()* @foo
45 ; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]]
46 ; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram(
47 ; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]]
48 ; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram(
53 declare void @llvm.dbg.value(metadata, metadata, metadata)
54 declare void @llvm.dbg.declare(metadata, metadata, metadata)
56 !llvm.module.flags = !{!0}
57 !0 = !{i32 2, !"Debug Info Version", i32 3}
58 !1 = distinct !DISubprogram(name: "foo")
59 !2 = distinct !DISubprogram(name: "bar")