File: dbgloc-memchr.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (44 lines) | stat: -rw-r--r-- 1,996 bytes parent folder | download | duplicates (3)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -p=aggressive-instcombine < %s | FileCheck %s
;; Tests that when we inline a simple memchr, we transfer its DILocation to the
;; generated instructions.

@.str.30 = constant [3 x i8] c"/\\\00"

define i32 @foo(i32 %conv22) {
; CHECK-LABEL: define i32 @foo(
; CHECK-SAME: i32 [[CONV22:%.*]]) {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    [[TMP0:%.*]] = trunc i32 [[CONV22]] to i8, !dbg [[DBG3:![0-9]+]]
; CHECK-NEXT:    switch i8 [[TMP0]], label %[[ENTRY_SPLIT:.*]] [
; CHECK-NEXT:    ], !dbg [[DBG3]]
; CHECK:       [[MEMCHR_SUCCESS:.*:]]
; CHECK-NEXT:    br label %[[ENTRY_SPLIT]], !dbg [[DBG3]]
; CHECK:       [[ENTRY_SPLIT]]:
; CHECK-NEXT:    ret i32 0
;
entry:
  %memchr = call ptr @memchr(ptr @.str.30, i32 %conv22, i64 0), !dbg !3
  ret i32 0
}

declare ptr @memchr(ptr, i32, i64)

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

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