1;; This test checks generation of DIGenericSubrange with constant bounds.
2;; constant bounds are interally represented as DIExpression
3
4; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
5
6;; Test whether DIGenericSubrange is generated.
7
8; CHECK: !DIGenericSubrange(lowerBound: -20, upperBound: 0, stride: 4)
9
10; ModuleID = 'generic_subrange_const.f90'
11source_filename = "/dir/generic_subrange_const.ll"
12
13!llvm.module.flags = !{!0, !1}
14!llvm.dbg.cu = !{!2}
15
16!0 = !{i32 2, !"Dwarf Version", i32 4}
17!1 = !{i32 2, !"Debug Info Version", i32 3}
18!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: !5, globals: !4, imports: !4)
19!3 = !DIFile(filename: "generic_subrange_const.f90", directory: "/dir")
20!4 = !{}
21!5 = !{!6}
22!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 32, align: 32, elements: !8, dataLocation: !10, rank: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 8, DW_OP_deref))
23!7 = !DIBasicType(name: "real", size: 32, align: 32, encoding: DW_ATE_float)
24!8 = !{!9}
25!9 = !DIGenericSubrange(lowerBound: -20, upperBound: 0, stride: 4)
26!10 = distinct !DILocalVariable(scope: !11, file: !3, type: !18, flags: DIFlagArtificial)
27!11 = distinct !DISubprogram(name: "sub1", scope: !2, file: !3, line: 1, type: !12, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)
28!12 = !DISubroutineType(types: !13)
29!13 = !{null, !14, !19}
30!14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 32, align: 32, elements: !15)
31!15 = !{!16}
32!16 = !DISubrange(lowerBound: 1, upperBound: !17)
33!17 = distinct !DILocalVariable(scope: !11, file: !3, type: !18, flags: DIFlagArtificial)
34!18 = !DIBasicType(name: "integer*8", size: 64, align: 64, encoding: DW_ATE_signed)
35!19 = !DICompositeType(tag: DW_TAG_array_type, baseType: !18, size: 1024, align: 64, elements: !20)
36!20 = !{!21}
37!21 = !DISubrange(lowerBound: 1, upperBound: 16)
38