| 1 |
; RUN: llvm-as -disable-output <%s 2>&1 | FileCheck %s |
| 2 |
define void @foo() { |
| 3 |
entry: |
| 4 |
#dbg_value( |
| 5 |
ptr undef, |
| 6 |
!DILocalVariable(scope: !1), |
| 7 |
!DIExpression(), |
| 8 |
!{}) |
| 9 |
; CHECK-LABEL: invalid #dbg record DILocation |
| 10 |
; CHECK-NEXT: #dbg_value({{.*}}) |
| 11 |
|
| 12 |
#dbg_declare( |
| 13 |
ptr undef, |
| 14 |
!DILocalVariable(scope: !1), |
| 15 |
!DIExpression(), |
| 16 |
!{}) |
| 17 |
; CHECK-LABEL: invalid #dbg record DILocation |
| 18 |
; CHECK-NEXT: #dbg_declare({{.*}}) |
| 19 |
|
| 20 |
#dbg_value( |
| 21 |
ptr undef, |
| 22 |
!DILocalVariable(scope: !1), |
| 23 |
!DIExpression(), |
| 24 |
!DILocation(scope: !2)) |
| 25 |
; CHECK-LABEL: mismatched subprogram between #dbg record variable and DILocation |
| 26 |
; CHECK-NEXT: #dbg_value({{[^,]+}}, ![[VAR:[0-9]+]], {{[^,]+}}, ![[LOC:[0-9]+]] |
| 27 |
; CHECK-NEXT: label %entry |
| 28 |
; CHECK-NEXT: ptr @foo |
| 29 |
; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]] |
| 30 |
; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram( |
| 31 |
; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]] |
| 32 |
; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram( |
| 33 |
|
| 34 |
#dbg_declare( |
| 35 |
ptr undef, |
| 36 |
!DILocalVariable(scope: !1), |
| 37 |
!DIExpression(), |
| 38 |
!DILocation(scope: !2)) |
| 39 |
; CHECK-LABEL: mismatched subprogram between #dbg record variable and DILocation |
| 40 |
; CHECK-NEXT: #dbg_declare({{[^,]+}}, ![[VAR:[0-9]+]], {{.*[^,]+}}, ![[LOC:[0-9]+]] |
| 41 |
; CHECK-NEXT: label %entry |
| 42 |
; CHECK-NEXT: ptr @foo |
| 43 |
; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]] |
| 44 |
; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram( |
| 45 |
; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]] |
| 46 |
; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram( |
| 47 |
|
| 48 |
ret void |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
!llvm.module.flags = !{!0} |
| 53 |
!0 = !{i32 2, !"Debug Info Version", i32 3} |
| 54 |
!1 = distinct !DISubprogram(name: "foo") |
| 55 |
!2 = distinct !DISubprogram(name: "bar") |