• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;; This test checks for emission of DW_OP_implicit_value operation
2;; for double type.
3
4; RUN: llc -debugger-tune=gdb -filetype=obj %s -o -  | llvm-dwarfdump - | FileCheck %s
5; RUN: llc -debugger-tune=lldb -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
6
7; CHECK: .debug_info contents:
8; CHECK: DW_TAG_variable
9; CHECK-NEXT:  DW_AT_location        ({{.*}}
10; CHECK-NEXT:                     [{{.*}}): DW_OP_implicit_value 0x8 0x1f 0x85 0xeb 0x51 0xb8 0x1e 0x09 0x40)
11; CHECK-NEXT:  DW_AT_name    ("d")
12
13; RUN: llc -debugger-tune=sce -filetype=obj %s -o -  | llvm-dwarfdump - | FileCheck %s -check-prefix=SCE-CHECK
14
15; SCE-CHECK: .debug_info contents:
16; SCE-CHECK: DW_TAG_variable
17; SCE-CHECK-NEXT:  DW_AT_location        ({{.*}}
18; SCE-CHECK-NEXT:                     [{{.*}}): DW_OP_constu 0x40091eb851eb851f, DW_OP_stack_value)
19; SCE-CHECK-NEXT:  DW_AT_name    ("d")
20
21;; Generated from: clang -ggdb -O1
22;;int main() {
23;;        double d = 3.14;
24;;        printf("dummy\n");
25;;        d *= d;
26;;        return 0;
27;;}
28
29; ModuleID = 'implicit_value-double.c'
30source_filename = "implicit_value-double.c"
31target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
32target triple = "x86_64-unknown-linux-gnu"
33
34@str = private unnamed_addr constant [6 x i8] c"dummy\00", align 1
35
36; Function Attrs: nofree nounwind uwtable
37define dso_local i32 @main() local_unnamed_addr #0 !dbg !7 {
38entry:
39  call void @llvm.dbg.value(metadata double 3.140000e+00, metadata !12, metadata !DIExpression()), !dbg !14
40  %puts = call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)), !dbg !15
41  call void @llvm.dbg.value(metadata double undef, metadata !12, metadata !DIExpression()), !dbg !14
42  ret i32 0, !dbg !16
43}
44
45; Function Attrs: nounwind readnone speculatable willreturn
46declare void @llvm.dbg.value(metadata, metadata, metadata) #1
47
48; Function Attrs: nofree nounwind
49declare i32 @puts(i8* nocapture readonly) local_unnamed_addr #2
50
51attributes #0 = { nofree nounwind uwtable }
52attributes #1 = { nounwind readnone speculatable willreturn }
53attributes #2 = { nofree nounwind }
54
55!llvm.dbg.cu = !{!0}
56!llvm.module.flags = !{!3, !4, !5}
57!llvm.ident = !{!6}
58
59!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)
60!1 = !DIFile(filename: "implicit_value-double.c", directory: "/home/")
61!2 = !{}
62!3 = !{i32 7, !"Dwarf Version", i32 4}
63!4 = !{i32 2, !"Debug Info Version", i32 3}
64!5 = !{i32 1, !"wchar_size", i32 4}
65!6 = !{!"clang version 11.0.0"}
66!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)
67!8 = !DISubroutineType(types: !9)
68!9 = !{!10}
69!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
70!11 = !{!12}
71!12 = !DILocalVariable(name: "d", scope: !7, file: !1, line: 2, type: !13)
72!13 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
73!14 = !DILocation(line: 0, scope: !7)
74!15 = !DILocation(line: 3, column: 2, scope: !7)
75!16 = !DILocation(line: 5, column: 2, scope: !7)
76