1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/MC/ARM/coff-debugging-secrel.ll
Duncan P. N. Exon Smith 0c1aee0b16 DI: Require subprogram definitions to be distinct
As a follow-up to r246098, require `DISubprogram` definitions
(`isDefinition: true`) to be 'distinct'.  Specifically, add an assembler
check, a verifier check, and bitcode upgrading logic to combat testcase
bitrot after the `DIBuilder` change.

While working on the testcases, I realized that
test/Linker/subprogram-linkonce-weak-odr.ll isn't relevant anymore.  Its
purpose was to check for a corner case in PR22792 where two subprogram
definitions match exactly and share the same metadata node.  The new
verifier check, requiring that subprogram definitions are 'distinct',
precludes that possibility.

I updated almost all the IR with the following script:

    git grep -l -E -e '= !DISubprogram\(.* isDefinition: true' |
    grep -v test/Bitcode |
    xargs sed -i '' -e 's/= \(!DISubprogram(.*, isDefinition: true\)/= distinct \1/'

Likely some variant of would work for out-of-tree testcases.

llvm-svn: 246327
2015-08-28 20:26:49 +00:00

53 lines
2.3 KiB
LLVM

; RUN: llc -mtriple thumbv7--windows-itanium -filetype obj -o - %s \
; RUN: | llvm-readobj -r - | FileCheck %s -check-prefix CHECK-ITANIUM
; RUN: sed -e 's/"Dwarf Version"/"CodeView"/' %s \
; RUN: | llc -mtriple thumbv7--windows-msvc -filetype obj -o - \
; RUN: | llvm-readobj -r - | FileCheck %s -check-prefix CHECK-MSVC
; ModuleID = '/Users/compnerd/work/llvm/test/MC/ARM/reduced.c'
target datalayout = "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7--windows-itanium"
define arm_aapcs_vfpcc void @function() {
entry:
ret void, !dbg !0
}
!llvm.dbg.cu = !{!7}
!llvm.module.flags = !{!9, !10}
!0 = !DILocation(line: 1, scope: !1)
!1 = distinct !DISubprogram(name: "function", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !2, scope: !3, type: !4, function: void ()* @function, variables: !6)
!2 = !DIFile(filename: "/Users/compnerd/work/llvm/test/MC/ARM/reduced.c", directory: "/Users/compnerd/work/llvm")
!3 = !DIFile(filename: "/Users/compnerd/work/llvm/test/MC/ARM/reduced.c", directory: "/Users/compnerd/work/llvm")
!4 = !DISubroutineType(types: !5)
!5 = !{null}
!6 = !{}
!7 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0", isOptimized: false, emissionKind: 1, file: !2, enums: !6, retainedTypes: !6, subprograms: !8, globals: !6, imports: !6)
!8 = !{!1}
!9 = !{i32 2, !"Dwarf Version", i32 4}
!10 = !{i32 1, !"Debug Info Version", i32 3}
; CHECK-ITANIUM: Relocations [
; CHECK-ITANIUM: Section {{.*}} .debug_info {
; CHECK-ITANIUM: 0x6 IMAGE_REL_ARM_SECREL .debug_abbrev
; CHECK-ITANIUM: 0xC IMAGE_REL_ARM_SECREL .debug_str
; CHECK-ITANIUM: 0x12 IMAGE_REL_ARM_SECREL .debug_str
; CHECK-ITANIUM: 0x16 IMAGE_REL_ARM_SECREL .debug_line
; CHECK-ITANIUM: }
; CHECK-ITANIUM: Section {{.*}}.debug_pubnames {
; CHECK-ITANIUM: 0x6 IMAGE_REL_ARM_SECREL .debug_info
; CHECK-ITANIUM: }
; CHECK-ITANIUM: ]
; CHECK-MSVC: Relocations [
; CHECK-MSVC: Section {{.*}} .debug$S {
; CHECK-MSVC: 0x2C IMAGE_REL_ARM_SECREL function
; CHECK-MSVC: 0x30 IMAGE_REL_ARM_SECTION function
; CHECK-MSVC: 0x48 IMAGE_REL_ARM_SECREL function
; CHECK-MSVC: 0x4C IMAGE_REL_ARM_SECTION function
; CHECK-MSVC: }
; CHECK-MSVC: ]