1; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s 2define void @foo() { 3entry: 4 call void @llvm.dbg.value( 5 metadata i8* undef, 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 12 13 call void @llvm.dbg.declare( 14 metadata i8* undef, 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 21 22 call void @llvm.dbg.value( 23 metadata i8* undef, 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( 35 36 call void @llvm.dbg.declare( 37 metadata i8* undef, 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( 49 50 ret void 51} 52 53declare void @llvm.dbg.value(metadata, metadata, metadata) 54declare void @llvm.dbg.declare(metadata, metadata, metadata) 55 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") 60