blob: 8d277d8649e1c971f889420e715d9ce24d4ac98b [file] [log] [blame]
Markus Lavinb86ce212019-03-19 13:16:28 +00001; RUN: llc -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s
2
3; CHECK: DW_TAG_compile_unit
4; CHECK: [[CU0BT0:0x[0-9a-f]+]]: DW_TAG_base_type
5; CHECK-NEXT: DW_ATE_signed_8
6; CHECK: [[CU0BT1:0x[0-9a-f]+]]: DW_TAG_base_type
7; CHECK-NEXT: DW_ATE_signed_32
8; CHECK: DW_TAG_variable
9; CHECK: DW_OP_convert ([[CU0BT0]]) "DW_ATE_signed_8", DW_OP_convert ([[CU0BT1]]) "DW_ATE_signed_32"
10
11; CHECK: DW_TAG_compile_unit
12; CHECK: [[CU1BT0:0x[0-9a-f]+]]: DW_TAG_base_type
13; CHECK-NEXT: DW_ATE_signed_8
14; CHECK: [[CU1BT1:0x[0-9a-f]+]]: DW_TAG_base_type
15; CHECK-NEXT: DW_ATE_signed_16
16; CHECK: DW_TAG_variable
17; CHECK: DW_OP_convert ([[CU1BT0]]) "DW_ATE_signed_8", DW_OP_convert ([[CU1BT1]]) "DW_ATE_signed_16"
18
19; ModuleID = 'llvm-link'
20source_filename = "llvm-link"
21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22target triple = "x86_64-unknown-linux-gnu"
23
24define dso_local signext i8 @foo(i8 signext %x) !dbg !9 {
25entry:
26 call void @llvm.dbg.value(metadata i8 %x, metadata !13, metadata !DIExpression()), !dbg !14
27 call void @llvm.dbg.value(metadata i8 %x, metadata !15, metadata !DIExpression(DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !17
28 ret i8 %x, !dbg !18
29}
30
31define dso_local signext i8 @bar(i8 signext %x) !dbg !19 {
32entry:
33 call void @llvm.dbg.value(metadata i8 %x, metadata !20, metadata !DIExpression()), !dbg !21
34 call void @llvm.dbg.value(metadata i8 %x, metadata !22, metadata !DIExpression(DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 16, DW_ATE_signed, DW_OP_stack_value)), !dbg !24
35 ret i8 %x, !dbg !25
36}
37
38; Function Attrs: nounwind readnone speculatable
39declare void @llvm.dbg.value(metadata, metadata, metadata) #1
40
41attributes #1 = { nounwind readnone speculatable }
42
43!llvm.dbg.cu = !{!0, !3}
44!llvm.ident = !{!5, !5}
45!llvm.module.flags = !{!6, !7, !8}
46
47!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
48!1 = !DIFile(filename: "dbg-foo.c", directory: "/tmp", checksumkind: CSK_MD5, checksum: "b35f80a032deb2a30bc187d564b5a775")
49!2 = !{}
50!3 = distinct !DICompileUnit(language: DW_LANG_C99, file: !4, producer: "clang version 9.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
51!4 = !DIFile(filename: "dbg-bar.c", directory: "/tmp", checksumkind: CSK_MD5, checksum: "9836bb594260d883960455e7d8bc51ea")
52!5 = !{!"clang version 9.0.0 "}
53!6 = !{i32 2, !"Dwarf Version", i32 5}
54!7 = !{i32 2, !"Debug Info Version", i32 3}
55!8 = !{i32 1, !"wchar_size", i32 4}
56!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 7, type: !10, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
57!10 = !DISubroutineType(types: !11)
58!11 = !{!12, !12}
59!12 = !DIBasicType(name: "signed char", size: 8, encoding: DW_ATE_signed_char)
60!13 = !DILocalVariable(name: "x", arg: 1, scope: !9, file: !1, line: 7, type: !12)
61!14 = !DILocation(line: 7, column: 29, scope: !9)
62!15 = !DILocalVariable(name: "y", scope: !9, file: !1, line: 9, type: !16)
63!16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
64!17 = !DILocation(line: 9, column: 14, scope: !9)
65!18 = !DILocation(line: 10, column: 3, scope: !9)
66!19 = distinct !DISubprogram(name: "bar", scope: !4, file: !4, line: 1, type: !10, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !3, retainedNodes: !2)
67!20 = !DILocalVariable(name: "x", arg: 1, scope: !19, file: !4, line: 1, type: !12)
68!21 = !DILocation(line: 1, column: 29, scope: !19)
69!22 = !DILocalVariable(name: "z", scope: !19, file: !4, line: 3, type: !23)
70!23 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)
71!24 = !DILocation(line: 3, column: 16, scope: !19)
72!25 = !DILocation(line: 4, column: 3, scope: !19)