|
| 1 | +; Namelist is a fortran feature, this test checks whether DW_TAG_namelist and |
| 2 | +; DW_TAG_namelist_item attributes are emitted correctly, when declared inside |
| 3 | +; a module. |
| 4 | +; |
| 5 | +; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu %s -filetype=obj -o %t.o |
| 6 | +; RUN: llvm-dwarfdump %t.o | FileCheck %s |
| 7 | +; |
| 8 | +; CHECK: [[ITEM1:0x.+]]: DW_TAG_variable |
| 9 | +; CHECK: DW_AT_name ("aa") |
| 10 | +; CHECK: [[ITEM2:0x.+]]: DW_TAG_variable |
| 11 | +; CHECK: DW_AT_name ("bb") |
| 12 | +; CHECK: DW_TAG_namelist |
| 13 | +; CHECK: DW_AT_name ("nml") |
| 14 | +; CHECK: DW_TAG_namelist_item |
| 15 | +; CHECK: DW_AT_namelist_item ([[ITEM1]]) |
| 16 | +; CHECK: DW_TAG_namelist_item |
| 17 | +; CHECK: DW_AT_namelist_item ([[ITEM2]]) |
| 18 | +; |
| 19 | +; generated from |
| 20 | +; |
| 21 | +; module mm |
| 22 | +; integer :: aa=10, bb=20 |
| 23 | +; namelist /nml/ aa, bb |
| 24 | +; end module mm |
| 25 | +; |
| 26 | +; subroutine test() |
| 27 | +; use mm |
| 28 | +; write(*,nml) |
| 29 | +; end subroutine test |
| 30 | +; |
| 31 | +; Program namelist |
| 32 | +; Call test() |
| 33 | +; End Program |
| 34 | + |
| 35 | +source_filename = "namelist2.ll" |
| 36 | + |
| 37 | +!llvm.module.flags = !{!19, !20} |
| 38 | +!llvm.dbg.cu = !{!4} |
| 39 | + |
| 40 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 41 | +!1 = distinct !DIGlobalVariable(name: "aa", scope: !2, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true) |
| 42 | +!2 = !DIModule(scope: !4, name: "mm", file: !3, line: 1) |
| 43 | +!3 = !DIFile(filename: "namelist2.f90", directory: "/dir") |
| 44 | +!4 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, flags: "'+flang -g namelist2.f90 -S -emit-llvm'", runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !14, nameTableKind: None) |
| 45 | +!5 = !{} |
| 46 | +!6 = !{!0, !7, !10} |
| 47 | +!7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression(DW_OP_plus_uconst, 4)) |
| 48 | +!8 = distinct !DIGlobalVariable(name: "bb", scope: !2, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true) |
| 49 | +!9 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed) |
| 50 | +!10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression()) |
| 51 | +!11 = distinct !DIGlobalVariable(name: "nml", scope: !2, file: !3, line: 2, type: !12, isLocal: false, isDefinition: true) |
| 52 | +!12 = !DICompositeType(tag: DW_TAG_namelist, name: "nml", file: !3, elements: !13) |
| 53 | +!13 = !{!1, !8} |
| 54 | +!14 = !{!15} |
| 55 | +!15 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !16, entity: !2, file: !3, line: 6) |
| 56 | +!16 = distinct !DISubprogram(name: "test", scope: !4, file: !3, line: 6, type: !17, scopeLine: 6, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition, unit: !4) |
| 57 | +!17 = !DISubroutineType(types: !18) |
| 58 | +!18 = !{null} |
| 59 | +!19 = !{i32 2, !"Dwarf Version", i32 4} |
| 60 | +!20 = !{i32 2, !"Debug Info Version", i32 3} |
| 61 | +!21 = distinct !DISubprogram(name: "namelist", scope: !4, file: !3, line: 11, type: !22, scopeLine: 11, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !4) |
| 62 | +!22 = !DISubroutineType(cc: DW_CC_program, types: !18) |
0 commit comments