aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Verifier/RemoveDI/llvm.dbg.intrinsic-dbg-attachment.ll
blob: 1839821ab140707ce2ddd025db1a8e91ad7d4402 (plain)
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
; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s
define void @foo() {
entry:
    #dbg_value(
      ptr undef,
      !DILocalVariable(scope: !1),
      !DIExpression(),
      !{})
; CHECK-LABEL: invalid #dbg record DILocation
; CHECK-NEXT: #dbg_value({{.*}})

    #dbg_declare(
      ptr undef,
      !DILocalVariable(scope: !1),
      !DIExpression(),
      !{})
; CHECK-LABEL: invalid #dbg record DILocation
; CHECK-NEXT: #dbg_declare({{.*}})

    #dbg_value(
      ptr undef,
      !DILocalVariable(scope: !1),
      !DIExpression(),
      !DILocation(scope: !2))
; CHECK-LABEL: mismatched subprogram between #dbg record variable and DILocation
; CHECK-NEXT: #dbg_value({{[^,]+}}, ![[VAR:[0-9]+]], {{[^,]+}}, ![[LOC:[0-9]+]]
; CHECK-NEXT: label %entry
; CHECK-NEXT: ptr @foo
; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]]
; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram(
; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]]
; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram(

    #dbg_declare(
      ptr undef,
      !DILocalVariable(scope: !1),
      !DIExpression(),
      !DILocation(scope: !2))
; CHECK-LABEL: mismatched subprogram between #dbg record variable and DILocation
; CHECK-NEXT: #dbg_declare({{[^,]+}}, ![[VAR:[0-9]+]], {{.*[^,]+}}, ![[LOC:[0-9]+]]
; CHECK-NEXT: label %entry
; CHECK-NEXT: ptr @foo
; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]]
; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram(
; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]]
; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram(

  ret void
}


!llvm.module.flags = !{!0}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = distinct !DISubprogram(name: "foo")
!2 = distinct !DISubprogram(name: "bar")