1 ; Namelist is a fortran feature, this test checks whether DW_TAG_namelist and
2 ; DW_TAG_namelist_item attributes are emitted correctly.
4 ; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu %s -filetype=obj -o %t.o
5 ; RUN: llvm-dwarfdump %t.o | FileCheck %s
7 ; CHECK: [[ITEM1:0x.+]]: DW_TAG_variable
8 ; CHECK: DW_AT_name ("a")
9 ; CHECK: [[ITEM2:0x.+]]: DW_TAG_variable
10 ; CHECK: DW_AT_name ("b")
11 ; CHECK: DW_TAG_namelist
12 ; CHECK: DW_AT_name ("nml")
13 ; CHECK: DW_TAG_namelist_item
14 ; CHECK: DW_AT_namelist_item ([[ITEM1]])
15 ; CHECK: DW_TAG_namelist_item
16 ; CHECK: DW_AT_namelist_item ([[ITEM2]])
31 source_filename = "namelist.ll"
33 define void @MAIN_() !dbg !2 {
35 %b_350 = alloca i32, align 4
36 call void @llvm.dbg.declare(metadata ptr %b_350, metadata !12, metadata !DIExpression()), !dbg !13
37 call void @llvm.dbg.value(metadata i32 1, metadata !14, metadata !DIExpression()), !dbg !13
41 declare void @llvm.dbg.declare(metadata, metadata, metadata)
42 declare void @llvm.dbg.value(metadata, metadata, metadata)
44 !llvm.module.flags = !{!10, !11}
47 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression(DW_OP_plus_uconst, 120))
48 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 3, type: !9, isLocal: true, isDefinition: true)
49 !2 = distinct !DISubprogram(name: "main", scope: !4, file: !3, line: 1, type: !7, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !4)
50 !3 = !DIFile(filename: "namelist.f90", directory: "/dir")
51 !4 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, flags: "'+flang -g namelist.f90 -S -emit-llvm'", runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5, nameTableKind: None)
54 !7 = !DISubroutineType(cc: DW_CC_program, types: !8)
56 !9 = !DIBasicType(name: "integer", size: 32, align: 32, encoding: DW_ATE_signed)
57 !10 = !{i32 2, !"Dwarf Version", i32 4}
58 !11 = !{i32 2, !"Debug Info Version", i32 3}
59 !12 = !DILocalVariable(name: "b", scope: !2, file: !3, line: 3, type: !9)
60 !13 = !DILocation(line: 0, scope: !2)
61 !14 = distinct !DILocalVariable(scope: !2, file: !3, line: 2, type: !15, flags: DIFlagArtificial)
62 !15 = !DICompositeType(tag: DW_TAG_namelist, name: "nml", scope: !2, file: !3, elements: !16)
64 !17 = !DILocation(line: 10, column: 1, scope: !2)