Skip to content

Commit a5d577b

Browse files
committed
Add testcase.
1 parent 4e2a2b1 commit a5d577b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
; RUN: %llc_dwarf %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s
2+
3+
; ModuleID = 'test.ll'
4+
source_filename = "test.f90"
5+
6+
!llvm.module.flags = !{!1}
7+
!llvm.dbg.cu = !{!2}
8+
9+
!1 = !{i32 2, !"Debug Info Version", i32 3}
10+
!2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, emissionKind: FullDebug, retainedTypes: !5)
11+
!3 = !DIFile(filename: "test.f90", directory: "dir")
12+
!5 = !{!6, !10, !13}
13+
!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, elements: !8)
14+
!7 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)
15+
!8 = !{!9}
16+
!9 = !DISubrange(lowerBound: 2, stride: 16)
17+
!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, elements: !11)
18+
!11 = !{!12}
19+
!12 = !DISubrange()
20+
!13 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, elements: !14)
21+
!14 = !{!15}
22+
!15 = !DIGenericSubrange(lowerBound: !16, stride: !17)
23+
!16 = !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 48, DW_OP_deref)
24+
!17 = !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 56, DW_OP_deref)
25+
26+
; Test that debug info is generated correctly in the absence of 'count' and
27+
; 'upperBound' in DISubrange/DIGenericSubrange.
28+
29+
; CHECK-LABEL: DW_TAG_subrange_type
30+
; CHECK-NEXT: DW_AT_type
31+
; CHECK-NEXT: DW_AT_lower_bound (2)
32+
; CHECK-NEXT: DW_AT_byte_stride (16)
33+
34+
; CHECK-LABEL: DW_TAG_subrange_type
35+
; CHECK-NEXT: DW_AT_type
36+
37+
; CHECK-LABEL: DW_TAG_generic_subrange
38+
; CHECK-NEXT: DW_AT_type
39+
; CHECK-NEXT: DW_AT_lower_bound (DW_OP_push_object_address, DW_OP_plus_uconst 0x30, DW_OP_deref)
40+
; CHECK-NEXT: DW_AT_byte_stride (DW_OP_push_object_address, DW_OP_plus_uconst 0x38, DW_OP_deref)

0 commit comments

Comments
 (0)