xref: /llvm-project/llvm/test/DebugInfo/X86/implicit_value-float.ll (revision 6b55a95898e98664164caae4aba7c5e24fd1a05e)
1;; This test checks for emission of DW_OP_implicit_value operation
2;; for float type.
3
4; RUN: llc -debugger-tune=gdb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
5
6; CHECK: .debug_info contents:
7; CHECK: DW_TAG_variable
8; CHECK-NEXT:  DW_AT_location        ({{.*}}
9; CHECK-NEXT:                     [{{.*}}): DW_OP_implicit_value 0x4 0xc3 0xf5 0x48 0x40)
10; CHECK-NEXT:  DW_AT_name    ("f")
11
12;; Generated from: clang -ggdb -O1
13;;int main() {
14;;        float f = 3.14f;
15;;        printf("dummy\n");
16;;        f *= f;
17;;        return 0;
18;;}
19; ModuleID = 'implicit_value-float.c'
20source_filename = "implicit_value-float.c"
21target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22target triple = "x86_64-unknown-linux-gnu"
23
24@str = private unnamed_addr constant [6 x i8] c"dummy\00", align 1
25
26; Function Attrs: nofree nounwind uwtable
27define dso_local i32 @main() local_unnamed_addr #0 !dbg !7 {
28entry:
29  call void @llvm.dbg.value(metadata float 0x40091EB860000000, metadata !12, metadata !DIExpression()), !dbg !14
30  %puts = call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)), !dbg !15
31  call void @llvm.dbg.value(metadata float undef, metadata !12, metadata !DIExpression()), !dbg !14
32  ret i32 0, !dbg !16
33}
34
35; Function Attrs: nounwind readnone speculatable willreturn
36declare void @llvm.dbg.value(metadata, metadata, metadata) #1
37
38; Function Attrs: nofree nounwind
39declare i32 @puts(i8* nocapture readonly) local_unnamed_addr #2
40
41attributes #0 = { nofree nounwind uwtable }
42attributes #1 = { nounwind readnone speculatable willreturn }
43attributes #2 = { nofree nounwind }
44
45!llvm.dbg.cu = !{!0}
46!llvm.module.flags = !{!3, !4, !5}
47!llvm.ident = !{!6}
48
49!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
50!1 = !DIFile(filename: "implicit_value-float.c", directory: "/home/")
51!2 = !{}
52!3 = !{i32 7, !"Dwarf Version", i32 4}
53!4 = !{i32 2, !"Debug Info Version", i32 3}
54!5 = !{i32 1, !"wchar_size", i32 4}
55!6 = !{!"clang version 11.0.0"}
56!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)
57!8 = !DISubroutineType(types: !9)
58!9 = !{!10}
59!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
60!11 = !{!12}
61!12 = !DILocalVariable(name: "f", scope: !7, file: !1, line: 2, type: !13)
62!13 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
63!14 = !DILocation(line: 0, scope: !7)
64!15 = !DILocation(line: 3, column: 2, scope: !7)
65!16 = !DILocation(line: 5, column: 2, scope: !7)
66