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