1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/DebugInfo/Generic/2009-11-03-InsertExtractValue.ll
Adrian Prantl 76f3fb45dc Add a verifier check that rejects non-distinct DISubprogram function
attachments. They would crash the backend, which expects all
DISubprograms that are not part of the type system to have a unit field.

Clang right before https://reviews.llvm.org/D79967 would generate this
kind of broken IR.

rdar://problem/69534688

Thanks to Fangrui for fixing an assembler test I had missed!

https://reviews.llvm.org/D88270
2020-09-25 12:04:46 -07:00

23 lines
944 B
LLVM

; RUN: llvm-as < %s | llvm-dis | FileCheck %s
!llvm.module.flags = !{!6}
!llvm.dbg.cu = !{!5}
!0 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagProtected | DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !4, scope: !1, type: !2)
!1 = !DIFile(filename: "/foo", directory: "bar.cpp")
!2 = !DISubroutineType(types: !3)
!3 = !{null}
!4 = !DIFile(filename: "/foo", directory: "bar.cpp")
!5 = distinct !DICompileUnit(language: DW_LANG_C99, isOptimized: true, emissionKind: FullDebug, file: !4, enums: !{}, retainedTypes: !{})
define <{i32, i32}> @f1() !dbg !0 {
; CHECK: !dbgx ![[NUMBER:[0-9]+]]
%r = insertvalue <{ i32, i32 }> zeroinitializer, i32 4, 1, !dbgx !1
; CHECK: !dbgx ![[NUMBER]]
%e = extractvalue <{ i32, i32 }> %r, 0, !dbgx !1
ret <{ i32, i32 }> %r
}
; CHECK: DIFlagProtected
!6 = !{i32 1, !"Debug Info Version", i32 3}