[RISCV] emit .option directive for functions with target features which differ from...
[llvm-project.git] / llvm / test / DebugInfo / X86 / dwarfdump-rankExp.ll
blobc74c7fcc6b9fdf1716036447ea86cf581a007471
1 ;; This test checks whether DW_AT_rank attribute accepts DIExpression.
3 ; RUN: llc %s -mtriple=x86_64 -filetype=obj -o %t.o
4 ; RUN: llvm-dwarfdump  %t.o | FileCheck %s
6 ;; Test whether DW_AT_data_location is generated.
7 ; CHECK-LABEL:  DW_TAG_array_type
9 ; CHECK:        DW_AT_rank (DW_OP_push_object_address, DW_OP_plus_uconst 0x8, DW_OP_deref)
11 ;; Test case is hand written with the help of below testcase
12 ;;------------------------------
13 ;;subroutine sub(arank)
14 ;;  real :: arank(..)
15 ;;  print *, RANK(arank)
16 ;;end
17 ;;------------------------------
19 ; ModuleID = 'dwarfdump-rank.ll'
20 source_filename = "dwarfdump-rank.ll"
22 define void @sub_(ptr noalias %arank, ptr noalias %"arank$sd") !dbg !5 {
23 L.entry:
24   call void @llvm.dbg.value(metadata ptr %arank, metadata !17, metadata !DIExpression()), !dbg !18
25   call void @llvm.dbg.declare(metadata ptr %"arank$sd", metadata !19, metadata !DIExpression()), !dbg !18
26   call void @llvm.dbg.declare(metadata ptr %"arank$sd", metadata !29, metadata !DIExpression()), !dbg !18
27   ret void, !dbg !18
30 ; Function Attrs: nounwind readnone speculatable willreturn
31 declare void @llvm.dbg.declare(metadata, metadata, metadata)
33 ; Function Attrs: nounwind readnone speculatable willreturn
34 declare void @llvm.dbg.value(metadata, metadata, metadata)
36 !llvm.module.flags = !{!0, !1}
37 !llvm.dbg.cu = !{!2}
39 !0 = !{i32 2, !"Dwarf Version", i32 4}
40 !1 = !{i32 2, !"Debug Info Version", i32 3}
41 !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)
42 !3 = !DIFile(filename: "rank.f90", directory: "/dir")
43 !4 = !{}
44 !5 = distinct !DISubprogram(name: "sub", scope: !2, file: !3, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)
45 !6 = !DISubroutineType(types: !7)
46 !7 = !{null, !8, !14}
47 !8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 32, align: 32, elements: !10)
48 !9 = !DIBasicType(name: "real", size: 32, align: 32, encoding: DW_ATE_float)
49 !10 = !{!11}
50 !11 = !DISubrange(lowerBound: 1, upperBound: !12)
51 !12 = distinct !DILocalVariable(scope: !5, file: !3, type: !13, flags: DIFlagArtificial)
52 !13 = !DIBasicType(name: "integer*8", size: 64, align: 64, encoding: DW_ATE_signed)
53 !14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 1024, align: 64, elements: !15)
54 !15 = !{!16}
55 !16 = !DISubrange(lowerBound: 1, upperBound: 16)
56 !17 = distinct !DILocalVariable(scope: !5, file: !3, type: !13, flags: DIFlagArtificial)
57 !18 = !DILocation(line: 0, scope: !5)
58 !19 = !DILocalVariable(name: "arank", arg: 1, scope: !5, file: !3, line: 1, type: !20)
59 !20 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 32, align: 32, elements: !21, dataLocation: !17, rank: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 8, DW_OP_deref))
60 !21 = !{!22, !23, !24, !25, !26, !27, !28}
61 !22 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 80, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 120, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 112, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
62 !23 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 128, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 168, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 160, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
63 !24 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 176, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 216, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 208, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
64 !25 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 224, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 264, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 256, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
65 !26 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 272, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 312, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 304, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
66 !27 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 320, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 360, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 352, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
67 !28 = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 368, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 408, DW_OP_deref), stride: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 400, DW_OP_deref, DW_OP_constu, 4, DW_OP_mul))
68 !29 = !DILocalVariable(arg: 2, scope: !5, file: !3, line: 1, type: !14, flags: DIFlagArtificial)