xref: /llvm-project/llvm/test/CodeGen/Generic/pr49872.ll (revision bb346146a52e3093979d51454ba615194d51c709)
1; REQUIRES: powerpc-registered-target
2; RUN: llc -mtriple powerpc64le-unknown-linux-gnu -filetype=obj < %s | \
3; RUN:   llvm-dwarfdump -debug-info - | FileCheck %s
4
5; PR49872
6; Check an integer constant for Fortran CHARACTER(1) will not cause a crash in
7; DebugHandlerBase::isUnsignedDIType when calling DwarfUnit::addConstantValue
8
9; CHECK:             DW_TAG_formal_parameter
10; CHECK:                 DW_AT_const_value     (122)
11; CHECK:                 DW_AT_name    ("arg")
12; CHECK:                 DW_AT_type    ([[TYPE:[a-z0-9]+]] "char string")
13; CHECK: [[TYPE]]:   DW_TAG_string_type
14; CHECK:                 DW_AT_name      ("char string")
15; CHECK:                 DW_AT_byte_size (0x01)
16
17source_filename = "1.ll"
18
19define dso_local void @s1_after_sroa([1 x i8] %arg) local_unnamed_addr #0 !dbg !5 {
20s1_entry:
21  call void @llvm.dbg.value(metadata i8 122, metadata !10, metadata !DIExpression()), !dbg !11
22  ret void, !dbg !12
23}
24
25declare void @llvm.dbg.value(metadata, metadata, metadata) #5
26
27!llvm.module.flags = !{!0, !1}
28!llvm.dbg.cu = !{!2}
29
30!0 = !{i32 2, !"Dwarf Version", i32 3}
31!1 = !{i32 2, !"Debug Info Version", i32 3}
32!2 = distinct !DICompileUnit(language: DW_LANG_Fortran95, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, splitDebugInlining: false)
33!3 = !DIFile(filename: "1.f", directory: ".")
34!4 = !{}
35!5 = distinct !DISubprogram(name: "s1", linkageName: "s1", scope: !3, file: !3, line: 1, type: !6, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
36!6 = !DISubroutineType(types: !7)
37!7 = !{!8, !9}
38!8 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "void")
39!9 = !DIStringType(name: "char string", size: 8)
40!10 = !DILocalVariable(name: "arg", arg: 1, scope: !5, file: !3, type: !9)
41!11 = !DILocation(line: 0, scope: !5)
42!12 = !DILocation(line: 4, scope: !5)
43!13 = !DILocation(line: 5, scope: !5)
44!14 = distinct !DISubprogram(name: "p", linkageName: "main", scope: !3, file: !3, line: 7, type: !15, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
45!15 = !DISubroutineType(types: !16)
46!16 = !{!17}
47!17 = !DIBasicType(name: "INTEGER", size: 32, encoding: DW_ATE_signed)
48!18 = !DILocation(line: 8, scope: !14)
49