File: preserve-debugloc.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (38 lines) | stat: -rw-r--r-- 1,937 bytes parent folder | download | duplicates (6)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
;; Tests that we preserve DebugLocs through reassociation of sub instructions.
; RUN: opt < %s -passes=reassociate -S | FileCheck %s

define void @foo(i64 %0) {
; CHECK-LABEL: define void @foo(
; CHECK-SAME: i64 [[TMP0:%.*]]) {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    [[DOTNEG:%.*]] = sub i64 0, [[TMP0]], !dbg [[DBG3:![0-9]+]]
; CHECK-NEXT:    [[ADD_I_I:%.*]] = add i64 [[DOTNEG]], 1
; CHECK-NEXT:    store i64 [[ADD_I_I]], ptr null, align 8
; CHECK-NEXT:    ret void
;
entry:
  %sub5.i.i = sub i64 1, %0, !dbg !4
  %add.i.i = add i64 %sub5.i.i, 0
  store i64 %add.i.i, ptr null, align 8
  ret void
}

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3}

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 20.0.0git", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
!1 = !DIFile(filename: "test.cpp", directory: "/tmp")
!2 = !{}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !DILocation(line: 212, column: 25, scope: !5)
!5 = distinct !DISubprogram(name: "foo", scope: !0, file: !1, line: 161, type: !6, scopeLine: 162, unit: !0, retainedNodes: !2)
!6 = distinct !DISubroutineType(types: !2)
;.
; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
; CHECK: [[META1]] = !DIFile(filename: "test.cpp", directory: {{.*}})
; CHECK: [[DBG3]] = !DILocation(line: 212, column: 25, scope: [[META4:![0-9]+]])
; CHECK: [[META4]] = distinct !DISubprogram(name: "foo", scope: [[META0]], file: [[META1]], line: 161, type: [[META5:![0-9]+]], scopeLine: 162, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META6:![0-9]+]])
; CHECK: [[META5]] = distinct !DISubroutineType(types: [[META6]])
; CHECK: [[META6]] = !{}
;.