|
| 1 | +; RUN: opt %s -S -passes=declare-to-assign -o - | FileCheck %s |
| 2 | + |
| 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 backing |
| 10 | +;; alloca (80 bits) can be represented with assignment tracking. Create a |
| 11 | +;; fragment for the dbg.assign for bits 0-80. |
| 12 | + |
| 13 | +; CHECK: llvm.dbg.assign(metadata i1 undef, metadata ![[#]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 80), metadata ![[#]], metadata ptr %f, metadata !DIExpression()) |
| 14 | + |
| 15 | +define dso_local void @_Z3funv() #0 !dbg !10 { |
| 16 | +entry: |
| 17 | + %f = alloca x86_fp80, align 16 |
| 18 | + call void @llvm.dbg.declare(metadata ptr %f, metadata !14, metadata !DIExpression()), !dbg !16 |
| 19 | + ret void |
| 20 | +} |
| 21 | + |
| 22 | +declare 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) |
0 commit comments