1 ; RUN: llvm-link %s %p/Inputs/distringtype1.ll -S -o - | FileCheck %s
3 ; This test checks that DIStringType is properly linked.
5 ; CHECK: !DIStringType(name: "character(*)!1", size: 32)
6 ; CHECK: !DIStringType(name: "character(*)!2", size: 32)
7 ; CHECK: !DIStringType(name: "character(*)!3", stringLength: !{{[0-9]+}}, stringLengthExpression: !DIExpression(), size: 32)
8 ; CHECK: !DIStringType(name: "character(*)!4", stringLength: !{{[0-9]+}}, stringLengthExpression: !DIExpression(), size: 32)
9 ; CHECK: !DIStringType(name: "character(*)!2", stringLength: !{{[0-9]+}}, stringLengthExpression: !DIExpression(), size: 32)
11 define void @sub1_(ptr %string1, ptr %string2, i64 %.U0002.arg, i64 %.U0003.arg) !dbg !5 {
13 call void @llvm.dbg.declare(metadata ptr %string1, metadata !13, metadata !DIExpression()), !dbg !18
14 call void @llvm.dbg.declare(metadata ptr %string2, metadata !16, metadata !DIExpression()), !dbg !18
15 call void @llvm.dbg.value(metadata i64 %.U0002.arg, metadata !11, metadata !DIExpression()), !dbg !18
16 call void @llvm.dbg.value(metadata i64 %.U0003.arg, metadata !15, metadata !DIExpression()), !dbg !18
20 declare void @llvm.dbg.declare(metadata, metadata, metadata)
21 declare void @llvm.dbg.value(metadata, metadata, metadata)
23 !llvm.module.flags = !{!0, !1}
26 !0 = !{i32 2, !"Dwarf Version", i32 4}
27 !1 = !{i32 2, !"Debug Info Version", i32 3}
28 !2 = distinct !DICompileUnit(language: DW_LANG_Fortran90, file: !3, producer: " F90 Flang - 1.5 2017-05-01", isOptimized: false, flags: "'+flang -g distringtype.f90 -S -emit-llvm'", runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !4, imports: !4, nameTableKind: None)
29 !3 = !DIFile(filename: "distringtype.f90", directory: "/tmp/")
31 !5 = distinct !DISubprogram(name: "sub1", scope: !2, file: !3, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !10)
32 !6 = !DISubroutineType(types: !7)
34 !8 = !DIStringType(name: "character(*)!1", size: 32)
35 !9 = !DIStringType(name: "character(*)!2", size: 32)
36 !10 = !{!11, !13, !15, !16}
37 !11 = !DILocalVariable(arg: 3, scope: !5, file: !3, line: 1, type: !12, flags: DIFlagArtificial)
38 !12 = !DIBasicType(name: "integer*8", size: 64, align: 64, encoding: DW_ATE_signed)
39 !13 = !DILocalVariable(name: "string1", arg: 1, scope: !5, file: !3, line: 1, type: !14)
40 !14 = !DIStringType(name: "character(*)!3", stringLength: !11, stringLengthExpression: !DIExpression(), size: 32)
41 !15 = !DILocalVariable(arg: 4, scope: !5, file: !3, line: 1, type: !12, flags: DIFlagArtificial)
42 !16 = !DILocalVariable(name: "string2", arg: 2, scope: !5, file: !3, line: 1, type: !17)
43 !17 = !DIStringType(name: "character(*)!4", stringLength: !15, stringLengthExpression: !DIExpression(), size: 32)
44 !18 = !DILocation(line: 0, scope: !5)
45 !19 = !DILocation(line: 4, column: 1, scope: !5)