blob: 671af9e05fe242582af39111c85219d70ec97b18 [file] [log] [blame]
Rafael Espindolab8e08be2011-05-27 22:15:01 +00001; RUN: llc %s -mtriple=x86_64-pc-linux-gnu -O0 -o - | FileCheck %s
2
3; We are testing that a value in a 16 bit register gets reported as
4; being in its superregister.
Rafael Espindolab8e08be2011-05-27 22:15:01 +00005
Adrian Prantlb16d9eb2015-01-12 22:19:22 +00006; CHECK: .byte 80 # super-register DW_OP_reg0
Adrian Prantl981f03e2017-03-16 17:14:56 +00007; No need to a piece at offset 0.
8; CHECK-NOT: DW_OP_piece
9; CHECK-NOT: DW_OP_bit_piece
Rafael Espindolab8e08be2011-05-27 22:15:01 +000010
Peter Collingbourned4bff302015-11-05 22:03:56 +000011define i16 @f(i16 signext %zzz) nounwind !dbg !1 {
Rafael Espindolab8e08be2011-05-27 22:15:01 +000012entry:
Adrian Prantlabe04752017-07-28 20:21:02 +000013 call void @llvm.dbg.value(metadata i16 %zzz, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1)
Rafael Espindolab8e08be2011-05-27 22:15:01 +000014 %conv = sext i16 %zzz to i32, !dbg !7
15 %conv1 = trunc i32 %conv to i16
16 ret i16 %conv1
17}
18
Adrian Prantlabe04752017-07-28 20:21:02 +000019declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
Rafael Espindolab8e08be2011-05-27 22:15:01 +000020
David Blaikiee5a2f702013-03-08 00:23:31 +000021!llvm.dbg.cu = !{!3}
Manman Ren409558f2013-11-22 21:49:45 +000022!llvm.module.flags = !{!11}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000023!9 = !{!1}
David Blaikiee5a2f702013-03-08 00:23:31 +000024
Duncan P. N. Exon Smithed013cd2015-07-31 18:58:39 +000025!0 = !DILocalVariable(name: "zzz", line: 3, arg: 1, scope: !1, file: !2, type: !6)
Adrian Prantl75819ae2016-04-15 15:57:41 +000026!1 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !3, scopeLine: 3, file: !10, scope: !2, type: !4)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000027!2 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/tmpfs/build")
Adrian Prantl75819ae2016-04-15 15:57:41 +000028!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !{}, retainedTypes: !{}, imports: null)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000029!4 = !DISubroutineType(types: !5)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000030!5 = !{null}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000031!6 = !DIBasicType(tag: DW_TAG_base_type, name: "short", size: 16, align: 16, encoding: DW_ATE_signed)
32!7 = !DILocation(line: 4, column: 22, scope: !8)
33!8 = distinct !DILexicalBlock(line: 3, column: 19, file: !10, scope: !1)
34!10 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/tmpfs/build")
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000035!11 = !{i32 1, !"Debug Info Version", i32 3}