llvm-6502/test/DebugInfo/2010-01-05-DbgScope.ll
Duncan P. N. Exon Smith 77a0728d96 DebugInfo: Fix bad debug info for compile units and types
Fix debug info in these tests, which started failing with a WIP patch to
verify compile units and types.  The problems look like they were all
caused by bitrot.  They fell into these categories:

  - Using `!{i32 0}` instead of `!{}`.
  - Using `!{null}` instead of `!{}`.
  - Using `!MDExpression()` instead of `!{}`.
  - Using `!8` instead of `!{!8}`.
  - `file:` references that pointed at `MDCompileUnit`s instead of the
    same `MDFile` as the compile unit.
  - `file:` references that were numerically off-by-one or (off-by-ten).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-27 20:46:33 +00:00

26 lines
1.1 KiB
LLVM

; RUN: llc < %s -o /dev/null
; PR 5942
define i8* @foo() nounwind {
entry:
%0 = load i32, i32* undef, align 4, !dbg !0 ; <i32> [#uses=1]
%1 = inttoptr i32 %0 to i8*, !dbg !0 ; <i8*> [#uses=1]
ret i8* %1, !dbg !10
}
!llvm.dbg.cu = !{!3}
!llvm.module.flags = !{!14}
!0 = !MDLocation(line: 571, column: 3, scope: !1)
!1 = distinct !MDLexicalBlock(line: 1, column: 1, file: !11, scope: !2)
!2 = !MDSubprogram(name: "foo", linkageName: "foo", line: 561, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !3, type: !4)
!3 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !11, enums: !12, retainedTypes: !12, subprograms: !13)
!4 = !MDSubroutineType(types: !5)
!5 = !{!6}
!6 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!10 = !MDLocation(line: 588, column: 1, scope: !2)
!11 = !MDFile(filename: "hashtab.c", directory: "/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcclibs/libiberty")
!12 = !{}
!13 = !{!2}
!14 = !{i32 1, !"Debug Info Version", i32 3}