File: find-live-cu.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (37 lines) | stat: -rw-r--r-- 1,365 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
; This test checks that strip-dead-debug-info pass doesn't delete debug compile
; units if they are used by @llvm.dbg.* intrinsics

; RUN: opt -passes='strip-dead-debug-info,verify' %s -S | FileCheck %s

; CHECK: !llvm.dbg.cu = !{!{{[0-9]+}}, !{{[0-9]+}}}
; CHECK-COUNT-2: !DICompileUnit

declare void @llvm.dbg.value(metadata, metadata, metadata)

define void @func() {
  %a = alloca i64
  call void @llvm.dbg.value(metadata ptr %a, metadata !7, metadata !DIExpression()), !dbg !9
  ret void
}

!llvm.dbg.cu = !{!0, !1}
!llvm.module.flags = !{!10}


; We have two different compile units to able to check different paths of
; finding compile units (intrinsic argument and attached location to instruction)
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !11)
!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !11)

!2 = distinct !DISubprogram(name: "func", unit: !0)
!3 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !2)
!4 = !DIDerivedType(tag: DW_TAG_member, scope: !3, baseType: !5)
!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6)
!6 = !DIBasicType(tag: DW_TAG_base_type)
!7 = !DILocalVariable(name: "a", type: !5, scope: !8)
!8 = distinct !DISubprogram(name: "func", unit: !1)
!9 = !DILocation(scope: !8)

!10 = !{i32 2, !"Debug Info Version", i32 3}

!11 = !DIFile(filename: "a", directory: "")