Rewrite test/Feature/md_on_instruction.ll

This test is supposed to be testing whether metadata attachments to
instructions work, but it was using invalid debug info to do so.  (This
was causing assertion failures in the `DebugInfoFinder` with a WIP patch
to be more strict about `DIDescriptor` accessors.)

Rather than fix the debug info -- which is better tested elsewhere --
just test the IR feature directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232828 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-03-20 18:34:53 +00:00
parent 8979e3f69b
commit 1188480049

View File

@ -1,27 +1,28 @@
; RUN: llvm-as < %s | llvm-dis | grep " !dbg " | count 4 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
define i32 @foo() nounwind ssp { define i32 @foo() nounwind ssp {
entry: entry:
%retval = alloca i32 ; <i32*> [#uses=2] ; CHECK: %retval = alloca i32
call void @llvm.dbg.func.start(metadata !0) ; CHECK: store i32 42, i32* %retval, !md !0
store i32 42, i32* %retval, !dbg !3 ; CHECK: br label %0, !md !1
br label %0, !dbg !3 %retval = alloca i32
store i32 42, i32* %retval, !md !0
br label %0, !md !1
; <label>:0 ; preds = %entry ; <label:0>
call void @llvm.dbg.region.end(metadata !0) ; CHECK: %1 = load i32, i32* %retval, !md !2
%1 = load i32, i32* %retval, !dbg !3 ; <i32> [#uses=1] ; CHECK: ret i32 %1, !md !3
ret i32 %1, !dbg !3 %1 = load i32, i32* %retval, !md !2
ret i32 %1, !md !3
} }
declare void @llvm.dbg.func.start(metadata) nounwind readnone ; CHECK: !0 = !{}
; CHECK: !1 = distinct !{}
declare void @llvm.dbg.region.end(metadata) nounwind readnone ; CHECK: !2 = !{!0}
; CHECK: !3 = !{!4}
!llvm.module.flags = !{!6} ; CHECK: !4 = !{!0, !2}
!0 = !{}
!0 = !MDSubprogram(name: "foo", linkageName: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !1, type: !2) !1 = distinct !{}
!1 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang 1.0", isOptimized: true, emissionKind: 0, file: !4, enums: !5, retainedTypes: !5, subprograms: !4) !2 = !{!0}
!2 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !3 = !{!4}
!3 = !MDLocation(line: 1, column: 13, scope: !1, inlinedAt: !1) !4 = !{!0, !2}
!4 = !MDFile(filename: "foo.c", directory: "/tmp")
!5 = !{i32 0}
!6 = !{i32 1, !"Debug Info Version", i32 3}