106 lines · plain
1;; This test checks processing of DIImportedEntity with elements field.2; REQUIRES: x86_64-linux3 4; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s5 6; CHECK: [[MYMOD:0x[0-9a-f]+]]: DW_TAG_module7; CHECK: DW_AT_name ("mymod")8; CHECK: [[VAR1:0x[0-9a-f]+]]: DW_TAG_variable9; CHECK: DW_AT_name ("var1")10 11; CHECK: DW_TAG_subprogram12; CHECK: DW_AT_name ("main")13; CHECK: DW_TAG_subprogram14; CHECK: DW_AT_name ("use_renamed")15; CHECK: DW_TAG_imported_module16; CHECK: DW_AT_import ([[MYMOD]])17; CHECK: DW_TAG_imported_declaration18; CHECK: DW_AT_import ([[VAR1]])19; CHECK: DW_AT_name ("var4")20 21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22;;This test case is generated from23;;module mymod24;; integer :: var1 = 1125;; integer :: var2 = 1226;; integer :: var3 = 1327;;end module mymod28;;29;;Program main30;; call use_renamed()31;; contains32;; subroutine use_renamed()33;; use mymod, var4 => var134;; print *, var435;; end subroutine use_renamed36;;end program main37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38 39; ModuleID = 'DIImportedEntity_elements.ll'40source_filename = "/tmp/usemodulealias.ll"41 42%struct_mymod_8_ = type <{ [12 x i8] }>43%struct.struct_ul_MAIN__348 = type { ptr }44 45@_mymod_8_ = global %struct_mymod_8_ <{ [12 x i8] c"\0B\00\00\00\0C\00\00\00\0D\00\00\00" }>, align 64, !dbg !0, !dbg !7, !dbg !1046@.C330_MAIN_ = internal constant i32 047@.C364_main_use_renamed = internal constant i32 2548@.C330_main_use_renamed = internal constant i32 049@.C331_main_use_renamed = internal constant i64 050@.C359_main_use_renamed = internal constant i32 651@.C357_main_use_renamed = internal constant [18 x i8] c"usemodulealias.f90"52@.C352_main_use_renamed = internal constant i32 1253 54define i32 @mymod_() {55.L.entry:56 ret i32 undef57}58 59define void @MAIN_() !dbg !15 {60L.entry:61 %.S0000_353 = alloca %struct.struct_ul_MAIN__348, align 862 call void (ptr, ...) @fort_init(ptr @.C330_MAIN_)63 br label %L.LB2_35764 65L.LB2_357: ; preds = %L.entry66 call void @main_use_renamed(ptr %.S0000_353), !dbg !2367 ret void, !dbg !2468}69 70define internal void @main_use_renamed(ptr noalias %.S0000) !dbg !14 {71L.entry:72 ret void, !dbg !2573}74 75declare void @fort_init(...)76 77!llvm.module.flags = !{!21, !22}78!llvm.dbg.cu = !{!4}79 80!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())81!1 = distinct !DIGlobalVariable(name: "var1", scope: !2, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true)82!2 = !DIModule(scope: !4, name: "mymod", file: !3, line: 1)83!3 = !DIFile(filename: "DIImportedEntity_elements.f90", directory: "/tmp")84!4 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, flags: "'+flang usemodulealias.f90 -g -S -emit-llvm'", runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, nameTableKind: None)85!5 = !{}86!6 = !{!0, !7, !10}87!7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression(DW_OP_plus_uconst, 4))88!8 = distinct !DIGlobalVariable(name: "var2", scope: !2, file: !3, line: 3, type: !9, isLocal: false, isDefinition: true)89!9 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)90!10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression(DW_OP_plus_uconst, 8))91!11 = distinct !DIGlobalVariable(name: "var3", scope: !2, file: !3, line: 4, type: !9, isLocal: false, isDefinition: true)92!12 = !{!13}93!13 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !14, entity: !2, file: !3, line: 10, elements: !19)94!14 = distinct !DISubprogram(name: "use_renamed", scope: !15, file: !3, line: 10, type: !18, scopeLine: 10, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !4, retainedNodes: !12)95!15 = distinct !DISubprogram(name: "main", scope: !4, file: !3, line: 7, type: !16, scopeLine: 7, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !4)96!16 = !DISubroutineType(cc: DW_CC_program, types: !17)97!17 = !{null}98!18 = !DISubroutineType(types: !17)99!19 = !{!20}100!20 = !DIImportedEntity(tag: DW_TAG_imported_declaration, name: "var4", scope: !14, entity: !1, file: !3, line: 10)101!21 = !{i32 2, !"Dwarf Version", i32 4}102!22 = !{i32 2, !"Debug Info Version", i32 3}103!23 = !DILocation(line: 8, column: 1, scope: !15)104!24 = !DILocation(line: 9, column: 1, scope: !15)105!25 = !DILocation(line: 13, column: 1, scope: !14)106