File: dbg-assign-tag-offset.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (76 lines) | stat: -rw-r--r-- 3,760 bytes parent folder | download | duplicates (4)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
; RUN: llc --try-experimental-debuginfo-iterators -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s

;; Copied from dbg-value-tag-offset.ll. Check that variables with locations
;; tracked with dbg.assigns with DW_OP_LLVM_TAG_offset operators in their
;; expressions get a DW_AT_LLVM_tag_offset attribute on their DIE.

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-android24"

; CHECK:      DW_TAG_variable
; CHECK-NOT:  DW_TAG
; CHECK:        DW_AT_LLVM_tag_offset (0x00)
; CHECK-NEXT:   DW_AT_name    ("x")

; CHECK:      DW_TAG_variable
; CHECK-NOT:  DW_TAG
; CHECK:        DW_AT_LLVM_tag_offset (0x80)
; CHECK-NEXT:   DW_AT_name    ("y")

define dso_local void @f() !dbg !14 {
  %1 = alloca i32, align 4, !DIAssignID !31
  call void @llvm.dbg.assign(metadata i1 undef, metadata !18, metadata !DIExpression(), metadata !31, metadata ptr %1, metadata !DIExpression(DW_OP_LLVM_tag_offset, 0)), !dbg !22
  %2 = alloca i32, align 4, !DIAssignID !32
  call void @llvm.dbg.assign(metadata i1 undef, metadata !20, metadata !DIExpression(), metadata !32, metadata ptr %2, metadata !DIExpression(DW_OP_LLVM_tag_offset, 128)), !dbg !22
  store i32 1, ptr %2, align 4, !dbg !23, !tbaa !24, !DIAssignID !33
  call void @llvm.dbg.assign(metadata i32 1, metadata !20, metadata !DIExpression(), metadata !33, metadata ptr %2, metadata !DIExpression(DW_OP_LLVM_tag_offset, 128)), !dbg !22
  call void @use(ptr nonnull %1), !dbg !28
  call void @use(ptr nonnull %2), !dbg !29
  ret void, !dbg !30
}

declare !dbg !5 void @use(ptr)

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

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9, !10, !11, !12, !34}
!llvm.ident = !{!13}

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)
!1 = !DIFile(filename: "dbg.cc", directory: "/tmp")
!2 = !{}
!3 = !{!4, !5}
!4 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
!5 = !DISubprogram(name: "use", scope: !1, file: !1, line: 2, type: !6, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
!6 = !DISubroutineType(types: !7)
!7 = !{null, !4}
!8 = !{i32 7, !"Dwarf Version", i32 4}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !{i32 1, !"wchar_size", i32 4}
!11 = !{i32 7, !"PIC Level", i32 2}
!12 = !{i32 7, !"PIE Level", i32 2}
!13 = !{!"clang version 10.0.0"}
!14 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !15, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !17)
!15 = !DISubroutineType(types: !16)
!16 = !{null}
!17 = !{!18, !20}
!18 = !DILocalVariable(name: "x", scope: !14, file: !1, line: 5, type: !19)
!19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!20 = !DILocalVariable(name: "y", scope: !14, file: !1, line: 5, type: !19)
!21 = !DILocation(line: 5, column: 3, scope: !14)
!22 = !DILocation(line: 0, scope: !14)
!23 = !DILocation(line: 5, column: 10, scope: !14)
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !26, i64 0}
!26 = !{!"omnipotent char", !27, i64 0}
!27 = !{!"Simple C++ TBAA"}
!28 = !DILocation(line: 6, column: 3, scope: !14)
!29 = !DILocation(line: 7, column: 3, scope: !14)
!30 = !DILocation(line: 8, column: 1, scope: !14)
!31 = distinct !DIAssignID()
!32 = distinct !DIAssignID()
!33 = distinct !DIAssignID()
!34 = !{i32 7, !"debug-info-assignment-tracking", i1 true}