74 lines · plain
1; RUN: llc -mtriple=x86_64 -filetype=obj -O0 < %s | llvm-dwarfdump - | FileCheck %s2 3; CHECK: DW_TAG_compile_unit4; CHECK: [[CU0BT0:0x[0-9a-f]+]]: DW_TAG_base_type5; CHECK-NEXT: DW_ATE_signed_86; CHECK: [[CU0BT1:0x[0-9a-f]+]]: DW_TAG_base_type7; CHECK-NEXT: DW_ATE_signed_328; CHECK: DW_TAG_variable9; CHECK: DW_OP_convert ([[CU0BT0]]) "DW_ATE_signed_8", DW_OP_convert ([[CU0BT1]]) "DW_ATE_signed_32"10 11; CHECK: DW_TAG_compile_unit12; CHECK: [[CU1BT0:0x[0-9a-f]+]]: DW_TAG_base_type13; CHECK-NEXT: DW_ATE_signed_814; CHECK: [[CU1BT1:0x[0-9a-f]+]]: DW_TAG_base_type15; CHECK-NEXT: DW_ATE_signed_1616; CHECK: DW_TAG_variable17; CHECK: DW_OP_convert ([[CU1BT0]]) "DW_ATE_signed_8", DW_OP_convert ([[CU1BT1]]) "DW_ATE_signed_16"18 19define dso_local signext i8 @foo(i8 signext %x) !dbg !9 {20entry:21 call void @llvm.dbg.value(metadata i8 %x, metadata !13, metadata !DIExpression()), !dbg !1422;; This test depends on "convert" surviving all the way to the final object.23;; So, insert something before DW_OP_LLVM_convert that the expression folder24;; will not attempt to eliminate. At the moment, only "convert" ops are folded.25 call void @llvm.dbg.value(metadata i8 32, metadata !15, metadata !DIExpression(DW_OP_lit0, DW_OP_plus, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !1726 ret i8 %x, !dbg !1827}28 29define dso_local signext i8 @bar(i8 signext %x) !dbg !19 {30entry:31 call void @llvm.dbg.value(metadata i8 %x, metadata !20, metadata !DIExpression()), !dbg !2132;; This test depends on "convert" surviving all the way to the final object.33;; So, insert something before DW_OP_LLVM_convert that the expression folder34;; will not attempt to eliminate. At the moment, only "convert" ops are folded.35 call void @llvm.dbg.value(metadata i8 32, metadata !22, metadata !DIExpression(DW_OP_lit0, DW_OP_plus, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 16, DW_ATE_signed, DW_OP_stack_value)), !dbg !2436 ret i8 %x, !dbg !2537}38 39; Function Attrs: nounwind readnone speculatable40declare void @llvm.dbg.value(metadata, metadata, metadata) #141 42attributes #1 = { nounwind readnone speculatable }43 44!llvm.dbg.cu = !{!0, !3}45!llvm.ident = !{!5, !5}46!llvm.module.flags = !{!6, !7, !8}47 48!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)49!1 = !DIFile(filename: "dbg-foo.c", directory: "/tmp", checksumkind: CSK_MD5, checksum: "b35f80a032deb2a30bc187d564b5a775")50!2 = !{}51!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)52!4 = !DIFile(filename: "dbg-bar.c", directory: "/tmp", checksumkind: CSK_MD5, checksum: "9836bb594260d883960455e7d8bc51ea")53!5 = !{!"clang version 9.0.0 "}54!6 = !{i32 2, !"Dwarf Version", i32 5}55!7 = !{i32 2, !"Debug Info Version", i32 3}56!8 = !{i32 1, !"wchar_size", i32 4}57!9 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 7, type: !10, scopeLine: 8, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)58!10 = !DISubroutineType(types: !11)59!11 = !{!12, !12}60!12 = !DIBasicType(name: "signed char", size: 8, encoding: DW_ATE_signed_char)61!13 = !DILocalVariable(name: "x", arg: 1, scope: !9, file: !1, line: 7, type: !12)62!14 = !DILocation(line: 7, column: 29, scope: !9)63!15 = !DILocalVariable(name: "y", scope: !9, file: !1, line: 9, type: !16)64!16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)65!17 = !DILocation(line: 9, column: 14, scope: !9)66!18 = !DILocation(line: 10, column: 3, scope: !9)67!19 = distinct !DISubprogram(name: "bar", scope: !4, file: !4, line: 1, type: !10, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !3, retainedNodes: !2)68!20 = !DILocalVariable(name: "x", arg: 1, scope: !19, file: !4, line: 1, type: !12)69!21 = !DILocation(line: 1, column: 29, scope: !19)70!22 = !DILocalVariable(name: "z", scope: !19, file: !4, line: 3, type: !23)71!23 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)72!24 = !DILocation(line: 3, column: 16, scope: !19)73!25 = !DILocation(line: 4, column: 3, scope: !19)74