71 lines · plain
1; RUN: llc %s -stop-after=finalize-isel -o - \2; RUN: | FileCheck %s3 4;; Handwritten test.5 6;; Here we have dbg.assign intrinsics with fragments (in the value-expression)7;; and address-expressions that involve arithmetic. The generated DBG_VALUE8;; intructions needs a DIExpression that:9;; a) Uses the fragment from the value-expression,10;; b) Uses the offset expression of the address-expression,11;; c) Has a DW_OP_deref appended.12 13; CHECK: DBG_VALUE %stack.0.a, $noreg, {{.+}}, !DIExpression(DW_OP_plus_uconst, 8, DW_OP_deref, DW_OP_LLVM_fragment, 64, 32), debug-location14 15target triple = "x86_64-unknown-linux-gnu"16 17define dso_local void @fun() !dbg !7 {18entry:19 %a = alloca <4 x i32>, !DIAssignID !2420 call void @llvm.dbg.assign(metadata i32 undef, metadata !16, metadata !DIExpression(), metadata !24, metadata ptr %a, metadata !DIExpression()), !dbg !3421 ;; unlink and undef a dbg.assign to avoid using sidetable for var loc.22 call void @llvm.dbg.assign(metadata i32 undef, metadata !16, metadata !DIExpression(), metadata !26, metadata ptr undef, metadata !DIExpression()), !dbg !3423 %idx2 = getelementptr inbounds i32, ptr %a, i32 224 store i32 100, ptr %idx2, !DIAssignID !2525 call void @llvm.dbg.assign(metadata i32 100, metadata !16, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 32), metadata !25, metadata ptr %a, metadata !DIExpression(DW_OP_plus_uconst, 8)), !dbg !3426 ret void27}28 29declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)30 31!llvm.dbg.cu = !{!0}32!llvm.module.flags = !{!3, !4, !5, !1000}33!llvm.ident = !{!6}34 35!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)36!1 = !DIFile(filename: "test.cpp", directory: "/")37!2 = !{}38!3 = !{i32 7, !"Dwarf Version", i32 4}39!4 = !{i32 2, !"Debug Info Version", i32 3}40!5 = !{i32 1, !"wchar_size", i32 4}41!6 = !{!"clang version 12.0.0"}42!7 = distinct !DISubprogram(name: "fun", linkageName: "fun", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)43!8 = !DISubroutineType(types: !9)44!9 = !{null, !10, !10, !10, !10}45!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)46!11 = !{!16}47!16 = !DILocalVariable(name: "quad", scope: !7, file: !1, line: 4, type: !17)48!17 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 128, elements: !18)49!18 = !{!19}50!19 = !DISubrange(count: 4)51!23 = !DILocation(line: 0, scope: !7)52!24 = distinct !DIAssignID()53!25 = distinct !DIAssignID()54!26 = distinct !DIAssignID()55!34 = !DILocation(line: 0, column: 0, scope: !7)56!44 = !{!45, !45, i64 0}57!45 = !{!"float", !46, i64 0}58!46 = !{!"omnipotent char", !47, i64 0}59!47 = !{!"Simple C++ TBAA"}60!48 = !DILocation(line: 11, column: 3, scope: !7)61!49 = !DILocation(line: 12, column: 1, scope: !7)62!50 = !DISubprogram(name: "get", linkageName: "_Z3getv", scope: !1, file: !1, line: 1, type: !51, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)63!51 = !DISubroutineType(types: !52)64!52 = !{!10}65!53 = !DISubprogram(name: "ext", linkageName: "_Z3extPf", scope: !1, file: !1, line: 2, type: !54, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)66!54 = !DISubroutineType(types: !55)67!55 = !{!10, !56}68!56 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64)69 70!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}71