1; RUN: llc -mtriple=x86_64 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s 2; 3; CHECK: [[SYM:[a-z0-9]+]]: DW_TAG_formal_parameter 4; CHECK: DW_AT_name ("esym") 5; CHECK: DW_AT_type ([[TYPE:[a-z0-9]+]] "CHARACTER_1") 6; 7; CHECK: DW_TAG_formal_parameter 8; CHECK: DW_AT_const_value (7523094288207667809) 9; CHECK: DW_AT_abstract_origin ([[SYM]] "esym") 10; 11; CHECK: [[TYPE]]: DW_TAG_string_type 12; CHECK: DW_AT_name ("CHARACTER_1") 13; CHECK: DW_AT_byte_size (0x08) 14; 15; The following IR is obtained by compiling the following Fortran 16; program with -O2 -g (with irrelevant instructions and metadata 17; trimmed): 18; 19; module semiempirical_corrections 20; 21; implicit none 22; 23; contains 24; subroutine gcpcor(n,iz) 25; implicit none 26; integer :: n, i 27; integer :: iz(n) 28; iz(i)=1 29; print*, esym(iz(i)) 30; end subroutine 31; 32; 33; character*8 function esym(i) 34; integer :: i 35; character*8 elemnt(1) 36; data elemnt/'abcdefgh'/ 37; esym=elemnt(i) 38; return 39; end function 40; end module 41; 42; The optimizations encode the constant string as an i64 constant in 43; the debug info for esym, the return variable of the function esym. 44 45@"semiempirical_corrections_mp_esym_$ELEMNT" = internal unnamed_addr constant [1 x [8 x i8]] [[8 x i8] c"abcdefgh"], align 8, !dbg !0 46 47; Function Attrs: nofree nounwind uwtable 48define void @semiempirical_corrections_mp_gcpcor_() local_unnamed_addr #1 !dbg !22 { 49alloca_1: 50 %"var$47" = alloca i64, align 8, !dbg !34 51 call void @llvm.dbg.value(metadata i64 7523094288207667809, metadata !12, metadata !DIExpression()), !dbg !40 52 store i64 7523094288207667809, ptr %"var$47", align 8, !dbg !41, !alias.scope !42, !noalias !45 53 ret void, !dbg !48 54} 55 56; Function Attrs: nofree nosync nounwind readnone speculatable willreturn 57declare void @llvm.dbg.declare(metadata, metadata, metadata) #3 58 59; Function Attrs: nofree nosync nounwind readnone speculatable willreturn 60declare void @llvm.dbg.value(metadata, metadata, metadata) #3 61 62attributes #1 = { nofree nounwind uwtable } 63attributes #3 = { nofree nosync nounwind readnone speculatable willreturn } 64 65!llvm.module.flags = !{!20, !21} 66!llvm.dbg.cu = !{!8} 67!omp_offload.info = !{} 68 69!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 70!1 = distinct !DIGlobalVariable(name: "elemnt", linkageName: "semiempirical_corrections_mp_esym_$ELEMNT", scope: !2, file: !3, line: 17, type: !16, isLocal: true, isDefinition: true) 71!2 = distinct !DISubprogram(name: "esym", linkageName: "semiempirical_corrections_mp_esym_", scope: !4, file: !3, line: 15, type: !5, scopeLine: 15, spFlags: DISPFlagDefinition, unit: !8, retainedNodes: !11) 72!3 = !DIFile(filename: "se6.f90", directory: "/iusers/cchen15/examples/tests/jr30349/gamess-dga-main/object") 73!4 = !DIModule(scope: null, name: "semiempirical_corrections", file: !3, line: 1) 74!5 = !DISubroutineType(types: !6) 75!6 = !{!7} 76!7 = !DIStringType(name: "CHARACTER_0", size: 64) 77!8 = distinct !DICompileUnit(language: DW_LANG_Fortran95, file: !3, producer: "Intel(R) Fortran 21.0-2745", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, globals: !10, splitDebugInlining: false, nameTableKind: None) 78!9 = !{} 79!10 = !{!0} 80!11 = !{!12, !14} 81!12 = !DILocalVariable(name: "esym", arg: 1, scope: !2, file: !3, line: 15, type: !13, flags: DIFlagArtificial) 82!13 = !DIStringType(name: "CHARACTER_1", size: 64) 83!14 = !DILocalVariable(name: "i", arg: 2, scope: !2, file: !3, line: 15, type: !15) 84!15 = !DIBasicType(name: "INTEGER*4", size: 32, encoding: DW_ATE_signed) 85!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !17, elements: !18) 86!17 = !DIStringType(name: "CHARACTER_2", size: 64) 87!18 = !{!19} 88!19 = !DISubrange(count: 1, lowerBound: 1) 89!20 = !{i32 2, !"Debug Info Version", i32 3} 90!21 = !{i32 2, !"Dwarf Version", i32 4} 91!22 = distinct !DISubprogram(name: "gcpcor", linkageName: "semiempirical_corrections_mp_gcpcor_", scope: !4, file: !3, line: 6, type: !23, scopeLine: 6, spFlags: DISPFlagDefinition, unit: !8) 92!23 = !DISubroutineType(types: !24) 93!24 = !{null} 94!34 = !DILocation(line: 6, column: 19, scope: !22) 95!38 = !DILocation(line: 15, column: 27, scope: !2, inlinedAt: !39) 96!39 = distinct !DILocation(line: 11, column: 13, scope: !22) 97!40 = !DILocation(line: 0, scope: !2, inlinedAt: !39) 98!41 = !DILocation(line: 19, column: 5, scope: !2, inlinedAt: !39) 99!42 = !{!43} 100!43 = distinct !{!43, !44, !"semiempirical_corrections_mp_esym_: %semiempirical_corrections_mp_esym_$ESYM"} 101!44 = distinct !{!44, !"semiempirical_corrections_mp_esym_"} 102!45 = !{!46} 103!46 = distinct !{!46, !44, !"semiempirical_corrections_mp_esym_: %I"} 104!48 = !DILocation(line: 12, column: 1, scope: !22) 105