brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 7f6a756 Raw
67 lines · plain
1;; This test checks whether DW_AT_data_location attribute2;; accepts DIVariable3; REQUIRES: x86_64-linux4 5; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -filetype=obj -o %t.o6; RUN: llvm-dwarfdump  %t.o | FileCheck %s7 8;; Test whether DW_AT_data_location is generated.9; CHECK: [[LOCDIE:0x.+]]:       DW_TAG_variable10; CHECK:                          DW_AT_artificial    (true)11; CHECK:  DW_TAG_variable12; CHECK:    DW_AT_name  ("arr")13; CHECK:  DW_TAG_array_type14; CHECK-NEXT:    DW_AT_data_location     ([[LOCDIE]])15 16;; Test case is hand written with the help of below testcase17;;------------------------------18;;program main19;;integer, allocatable :: arr(:)20;;allocate(arr(2:20))21;;arr(2)=9922;;print *, arr23;;end program main24;;------------------------------25 26; ModuleID = 'fortsubrange.ll'27source_filename = "fortsubrange.ll"28target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"29target triple = "x86_64-unknown-linux-gnu"30 31define void @MAIN_() !dbg !5 {32L.entry:33  %.Z0640_333 = alloca ptr, align 834  %"arr$sd1_349" = alloca [16 x i64], align 835  call void @llvm.dbg.declare(metadata ptr %"arr$sd1_349", metadata !8, metadata !DIExpression()), !dbg !1636  call void @llvm.dbg.declare(metadata ptr %.Z0640_333, metadata !14, metadata !DIExpression()), !dbg !1637  ret void, !dbg !1738}39 40; Function Attrs: nounwind readnone speculatable willreturn41declare void @llvm.dbg.declare(metadata, metadata, metadata)42 43; Function Attrs: nounwind readnone speculatable willreturn44declare void @llvm.dbg.value(metadata, metadata, metadata)45 46!llvm.module.flags = !{!0, !1}47!llvm.dbg.cu = !{!2}48 49!0 = !{i32 2, !"Dwarf Version", i32 4}50!1 = !{i32 2, !"Debug Info Version", i32 3}51!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)52!3 = !DIFile(filename: "fortsubrange.f90", directory: "/dir")53!4 = !{}54!5 = distinct !DISubprogram(name: "main", scope: !2, file: !3, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !2)55!6 = !DISubroutineType(cc: DW_CC_program, types: !7)56!7 = !{null}57!8 = !DILocalVariable(name: "arr", scope: !9, file: !3, type: !10)58!9 = !DILexicalBlock(scope: !5, file: !3, line: 1, column: 1)59!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 32, align: 32, elements: !12, dataLocation: !14)60!11 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)61!12 = !{!13}62!13 = !DISubrange(count: 19, lowerBound: 2)63!14 = distinct !DILocalVariable(scope: !9, file: !3, type: !15, flags: DIFlagArtificial)64!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 32, align: 32)65!16 = !DILocation(line: 0, scope: !9)66!17 = !DILocation(line: 6, column: 1, scope: !9)67