1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s 2; 3; The IR in this test derives from the following Fortran program: 4; program array 5; integer array1, array2 6; dimension array1(10) 7; dimension array2(3:10) 8; double precision d 9; logical l 10; character*6 c 11; 12; common /com/ d, l, c 13; 14; array1(1) = 1 15; array2(3) = 2 16; d = 8.0 17; l = .TRUE. 18; c = 'oooooo' 19; end 20; 21; CHECK: Array ([[array2_t:.*]]) { 22; CHECK-NEXT: TypeLeafKind: LF_ARRAY 23; CHECK-NEXT: ElementType: int 24; CHECK-NEXT: IndexType: unsigned __int64 25; CHECK-NEXT: SizeOf: 32 26; 27; CHECK: Array ([[array1_t:.*]]) { 28; CHECK-NEXT: TypeLeafKind: LF_ARRAY 29; CHECK-NEXT: ElementType: int 30; CHECK-NEXT: IndexType: unsigned __int64 31; CHECK-NEXT: SizeOf: 40 32; 33; CHECK: Array ([[char_6_t:.*]]) { 34; CHECK-NEXT: TypeLeafKind: LF_ARRAY 35; CHECK-NEXT: ElementType: char 36; CHECK-NEXT: IndexType: unsigned __int64 37; CHECK-NEXT: SizeOf: 6 38; CHECK-NEXT: CHARACTER_0 39; 40; CHECK: DataOffset: ARRAY$ARRAY2+0x0 41; CHECK-NEXT: Type: [[array2_t]] 42; CHECK-NEXT: DisplayName: ARRAY2 43; CHECK-NEXT: LinkageName: ARRAY$ARRAY2 44; 45; CHECK: DataOffset: ARRAY$ARRAY1+0x0 46; CHECK-NEXT: Type: [[array1_t]] 47; CHECK-NEXT: DisplayName: ARRAY1 48; CHECK-NEXT: LinkageName: ARRAY$ARRAY1 49; 50; CHECK: DataOffset: COM+0x0 51; CHECK-NEXT: Type: double 52; CHECK-NEXT: DisplayName: D 53; CHECK-NEXT: LinkageName: COM 54; 55; CHECK: DataOffset: COM+0x8 56; CHECK-NEXT: Type: __bool32 57; CHECK-NEXT: DisplayName: L 58; CHECK-NEXT: LinkageName: COM 59; 60; CHECK: DataOffset: COM+0xC 61; CHECK-NEXT: Type: CHARACTER_0 ([[char_6_t]]) 62; CHECK-NEXT: DisplayName: C 63; CHECK-NEXT: LinkageName: COM 64 65; ModuleID = 'fortran-basic.f' 66source_filename = "fortran-basic.f" 67target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 68target triple = "x86_64-pc-windows-msvc" 69 70@strlit = internal unnamed_addr constant [6 x i8] c"oooooo" 71@COM = common unnamed_addr global [18 x i8] zeroinitializer, align 32, !dbg !0, !dbg !9, !dbg !12 72@"ARRAY$ARRAY2" = internal global [8 x i32] zeroinitializer, align 16, !dbg !15 73@"ARRAY$ARRAY1" = internal global [10 x i32] zeroinitializer, align 16, !dbg !21 74@0 = internal unnamed_addr constant i32 2 75 76; Function Attrs: noinline nounwind optnone uwtable 77define void @MAIN__() #0 !dbg !3 { 78alloca_0: 79 %"$io_ctx" = alloca [6 x i64], align 8 80 %strlit_fetch.1 = load [6 x i8], [6 x i8]* @strlit, align 1, !dbg !39 81 %func_result = call i32 @for_set_reentrancy(i32* @0), !dbg !39 82 store i32 1, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @"ARRAY$ARRAY1", i32 0, i32 0), align 1, !dbg !40 83 store i32 2, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @"ARRAY$ARRAY2", i32 0, i32 0), align 1, !dbg !41 84 store double 8.000000e+00, double* bitcast ([18 x i8]* @COM to double*), align 1, !dbg !42 85 store i32 -1, i32* bitcast (i8* getelementptr inbounds ([18 x i8], [18 x i8]* @COM, i32 0, i64 8) to i32*), align 1, !dbg !43 86 call void @llvm.for.cpystr.i64.i64.i64(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @COM, i32 0, i64 12), i64 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @strlit, i32 0, i32 0), i64 3, i64 0, i1 false), !dbg !44 87 ret void, !dbg !45 88} 89 90declare i32 @for_set_reentrancy(i32* nocapture readonly) 91 92; Function Attrs: nounwind readnone speculatable 93declare i32* @llvm.intel.subscript.p0i32.i64.i64.p0i32.i64(i8, i64, i64, i32*, i64) #1 94 95; Function Attrs: argmemonly nofree nosync nounwind willreturn 96declare void @llvm.for.cpystr.i64.i64.i64(i8* noalias nocapture writeonly, i64, i8* noalias nocapture readonly, i64, i64, i1 immarg) #2 97 98attributes #0 = { noinline nounwind optnone uwtable "frame-pointer"="none" "intel-lang"="fortran" "min-legal-vector-width"="0" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" } 99attributes #1 = { nounwind readnone speculatable } 100attributes #2 = { argmemonly nofree nosync nounwind willreturn } 101 102!llvm.module.flags = !{!28, !29, !30} 103!llvm.dbg.cu = !{!7} 104!omp_offload.info = !{} 105 106!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 107!1 = distinct !DIGlobalVariable(name: "D", linkageName: "COM", scope: !2, file: !4, line: 5, type: !27, isLocal: false, isDefinition: true) 108!2 = !DICommonBlock(scope: !3, declaration: null, name: "COM", file: !4, line: 8) 109!3 = distinct !DISubprogram(name: "ARRAY", linkageName: "MAIN__", scope: !4, file: !4, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagMainSubprogram, unit: !7, retainedNodes: !26) 110!4 = !DIFile(filename: "fortran-basic.f", directory: "d:\\iusers\\cchen15\\examples\\tests\\vsdF-nightly\\vsdF\\opt_none_debug") 111!5 = !DISubroutineType(types: !6) 112!6 = !{null} 113!7 = distinct !DICompileUnit(language: DW_LANG_Fortran95, file: !4, producer: "Intel(R) Fortran 22.0-1034", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !8, splitDebugInlining: false, nameTableKind: None) 114!8 = !{!0, !9, !12, !15, !21} 115!9 = !DIGlobalVariableExpression(var: !10, expr: !DIExpression(DW_OP_plus_uconst, 8)) 116!10 = distinct !DIGlobalVariable(name: "L", linkageName: "COM", scope: !2, file: !4, line: 6, type: !11, isLocal: false, isDefinition: true) 117!11 = !DIBasicType(name: "LOGICAL*4", size: 32, encoding: DW_ATE_boolean) 118!12 = !DIGlobalVariableExpression(var: !13, expr: !DIExpression(DW_OP_plus_uconst, 12)) 119!13 = distinct !DIGlobalVariable(name: "C", linkageName: "COM", scope: !2, file: !4, line: 7, type: !14, isLocal: false, isDefinition: true) 120!14 = !DIStringType(name: "CHARACTER_0", size: 48) 121!15 = !DIGlobalVariableExpression(var: !16, expr: !DIExpression()) 122!16 = distinct !DIGlobalVariable(name: "ARRAY2", linkageName: "ARRAY$ARRAY2", scope: !3, file: !4, line: 2, type: !17, isLocal: true, isDefinition: true) 123!17 = !DICompositeType(tag: DW_TAG_array_type, baseType: !18, elements: !19) 124!18 = !DIBasicType(name: "INTEGER*4", size: 32, encoding: DW_ATE_signed) 125!19 = !{!20} 126!20 = !DISubrange(lowerBound: 3, upperBound: 10) 127!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression()) 128!22 = distinct !DIGlobalVariable(name: "ARRAY1", linkageName: "ARRAY$ARRAY1", scope: !3, file: !4, line: 2, type: !23, isLocal: true, isDefinition: true) 129!23 = !DICompositeType(tag: DW_TAG_array_type, baseType: !18, elements: !24) 130!24 = !{!25} 131!25 = !DISubrange(count: 10, lowerBound: 1) 132!26 = !{} 133!27 = !DIBasicType(name: "REAL*8", size: 64, encoding: DW_ATE_float) 134!28 = !{i32 7, !"PIC Level", i32 2} 135!29 = !{i32 2, !"Debug Info Version", i32 3} 136!30 = !{i32 2, !"CodeView", i32 1} 137!39 = !DILocation(line: 1, column: 10, scope: !3) 138!40 = !DILocation(line: 9, column: 9, scope: !3) 139!41 = !DILocation(line: 10, column: 9, scope: !3) 140!42 = !DILocation(line: 11, column: 9, scope: !3) 141!43 = !DILocation(line: 12, column: 9, scope: !3) 142!44 = !DILocation(line: 13, column: 9, scope: !3) 143!45 = !DILocation(line: 14, column: 2, scope: !3) 144