blob: 5ee283e4b21e53c2de7a8834b7064882debdb39a [file] [log] [blame]
Alok Kumar Sharmad20bf5a2020-05-28 13:31:22 +05301;; This test checks DISubrange bounds for DIVariable
2
3; RUN: %llc_dwarf %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s
4
5;; Test whether bounds are generated correctly.
6; CHECK: [[DIE1:0x.+]]: DW_TAG_variable
7; CHECK: DW_AT_location
8; CHECK-SAME: DW_OP_plus_uconst 0x70, DW_OP_deref, DW_OP_lit4, DW_OP_mul
9; CHECK: [[DIE2:0x.+]]: DW_TAG_variable
10; CHECK: DW_AT_location
11; CHECK-SAME: DW_OP_plus_uconst 0x78
12; CHECK: [[DIE3:0x.+]]: DW_TAG_variable
13; CHECK: DW_AT_location
14; CHECK-SAME: DW_OP_plus_uconst 0x50
15; CHECK: DW_TAG_subrange_type
16; CHECK: DW_AT_lower_bound ([[DIE3]])
17; CHEK-NEXT: DW_AT_upper_bound ([[DIE2]])
18; CHECK-NEXT DW_AT_byte_stride ([[DIE1]])
19
20
21; ModuleID = 'fortsubrange.ll'
22source_filename = "fortsubrange.ll"
23
24define void @MAIN_() !dbg !5 {
25L.entry:
26 %.Z0640_333 = alloca i32*, align 8
27 %"arr$sd1_349" = alloca [16 x i64], align 8
28 call void @llvm.dbg.declare(metadata i32** %.Z0640_333, metadata !8, metadata !DIExpression(DW_OP_deref)), !dbg !17
29 call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !13, metadata !DIExpression(DW_OP_plus_uconst, 80)), !dbg !17
30 call void @llvm.dbg.value(metadata [16 x i64]* %"arr$sd1_349", metadata !16, metadata !DIExpression(DW_OP_plus_uconst, 112, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul)), !dbg !17
31 call void @llvm.dbg.declare(metadata [16 x i64]* %"arr$sd1_349", metadata !15, metadata !DIExpression(DW_OP_plus_uconst, 120)), !dbg !17
32 ret void, !dbg !18
33}
34
35; Function Attrs: nounwind readnone speculatable willreturn
36declare void @llvm.dbg.declare(metadata, metadata, metadata)
37
38; Function Attrs: nounwind readnone speculatable willreturn
39declare void @llvm.dbg.value(metadata, metadata, metadata)
40
41!llvm.module.flags = !{!0, !1}
42!llvm.dbg.cu = !{!2}
43
44!0 = !{i32 2, !"Dwarf Version", i32 4}
45!1 = !{i32 2, !"Debug Info Version", i32 3}
46!2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !4)
47!3 = !DIFile(filename: "fortsubrange.f90", directory: "/dir")
48!4 = !{}
49!5 = distinct !DISubprogram(name: "main", scope: !2, file: !3, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !2)
50!6 = !DISubroutineType(cc: DW_CC_program, types: !7)
51!7 = !{null}
52!8 = !DILocalVariable(name: "arr", scope: !5, file: !3, type: !9)
53!9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 32, align: 32, elements: !11)
54!10 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)
55!11 = !{!12}
56!12 = !DISubrange(lowerBound: !13, upperBound: !15, stride: !16)
57!13 = distinct !DILocalVariable(scope: !5, file: !3, type: !14, flags: DIFlagArtificial)
58!14 = !DIBasicType(name: "integer*8", size: 64, align: 64, encoding: DW_ATE_signed)
59!15 = distinct !DILocalVariable(scope: !5, file: !3, type: !14, flags: DIFlagArtificial)
60!16 = distinct !DILocalVariable(scope: !5, file: !3, type: !14, flags: DIFlagArtificial)
61!17 = !DILocation(line: 0, scope: !5)
62!18 = !DILocation(line: 6, column: 1, scope: !5)