40 lines · plain
1; RUN: opt %s -S -passes=declare-to-assign -o - | FileCheck %s2 3;; Generated from this C++:4;; long double get();5;; void fun() {6;; long double f;7;; }8 9;; Check a variable that is larger (128 bits according to !15) than its backing10;; alloca (80 bits) can be represented with assignment tracking. Create a11;; fragment for the dbg.assign for bits 0-80.12 13; CHECK: #dbg_assign(i1 poison, ![[#]], !DIExpression(DW_OP_LLVM_fragment, 0, 80), ![[#]], ptr %f, !DIExpression(),14 15define dso_local void @_Z3funv() #0 !dbg !10 {16entry:17 %f = alloca x86_fp80, align 1618 call void @llvm.dbg.declare(metadata ptr %f, metadata !14, metadata !DIExpression()), !dbg !1619 ret void20}21 22declare void @llvm.dbg.declare(metadata, metadata, metadata)23 24!llvm.dbg.cu = !{!0}25!llvm.module.flags = !{!2, !3}26!llvm.ident = !{!9}27 28!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 17.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)29!1 = !DIFile(filename: "test.cpp", directory: "/")30!2 = !{i32 7, !"Dwarf Version", i32 5}31!3 = !{i32 2, !"Debug Info Version", i32 3}32!9 = !{!"clang version 17.0.0"}33!10 = distinct !DISubprogram(name: "fun", linkageName: "_Z3funv", scope: !1, file: !1, line: 2, type: !11, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !13)34!11 = !DISubroutineType(types: !12)35!12 = !{null}36!13 = !{}37!14 = !DILocalVariable(name: "f", scope: !10, file: !1, line: 3, type: !15)38!15 = !DIBasicType(name: "long double", size: 128, encoding: DW_ATE_float)39!16 = !DILocation(line: 3, column: 15, scope: !10)40