From: David Blaikie Date: Wed, 5 Feb 2020 02:08:16 +0000 (-0800) Subject: Reapply: DebugInfo: Add missing test coverage for DW_OP_convert in loclists X-Git-Tag: llvmorg-12-init~15742 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0cd0b7c909edceed7aa7e55ab0677fba1a0511c;p=platform%2Fupstream%2Fllvm.git Reapply: DebugInfo: Add missing test coverage for DW_OP_convert in loclists Originally committed in: 5327b917e3bd0b3db352cb5a61eea7409f2d1972 and follow on fix: 4f281f047457ce3f1870a93253476222314f420b Reverted in: 191a9a78b3f4bdf35a30d3480bd630d787a2fdf6 and: f75301d16d444d8cb6810d679290df744bc79ec7 Reverted because it wasn't portable between the targets it was running on. Using %llc_dwarf ensures the target triple is always elfine and thus DWARF compatible. --- diff --git a/llvm/test/DebugInfo/X86/convert-loclist.ll b/llvm/test/DebugInfo/X86/convert-loclist.ll new file mode 100644 index 0000000..41ed060 --- /dev/null +++ b/llvm/test/DebugInfo/X86/convert-loclist.ll @@ -0,0 +1,45 @@ +; RUN: %llc_dwarf -dwarf-version=5 -filetype=obj -O0 < %s | llvm-dwarfdump -debug-loclists - | FileCheck %s + +; CHECK: DW_LLE_offset_pair ({{.*}}): DW_OP_consts +7, DW_OP_convert 0x27, DW_OP_stack_value + +; Function Attrs: uwtable +define dso_local void @_Z2f2v() local_unnamed_addr #0 !dbg !11 { +entry: + tail call void @_Z2f1v(), !dbg !15 + call void @llvm.dbg.value(metadata i32 7, metadata !13, metadata !DIExpression(DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_stack_value)), !dbg !16 + tail call void @_Z2f1v(), !dbg !17 + ret void, !dbg !18 +} + +declare !dbg !4 dso_local void @_Z2f1v() local_unnamed_addr #1 + +; Function Attrs: nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) #2 + +attributes #0 = { uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #2 = { nounwind readnone speculatable willreturn } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8, !9} +!llvm.ident = !{!10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0 (git@github.com:llvm/llvm-project.git edc3f4f02e54c2ae1067f60f6a0ed6caf5b92ef6)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "loc.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") +!2 = !{} +!3 = !{!4} +!4 = !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 7, !"Dwarf Version", i32 5} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"wchar_size", i32 4} +!10 = !{!"clang version 11.0.0 (git@github.com:llvm/llvm-project.git edc3f4f02e54c2ae1067f60f6a0ed6caf5b92ef6)"} +!11 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !5, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12) +!12 = !{!13} +!13 = !DILocalVariable(name: "x", scope: !11, file: !1, line: 3, type: !14) +!14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!15 = !DILocation(line: 4, column: 3, scope: !11) +!16 = !DILocation(line: 0, scope: !11) +!17 = !DILocation(line: 6, column: 3, scope: !11) +!18 = !DILocation(line: 7, column: 1, scope: !11)