1 ; RUN: llc %s -stop-after=livedebugvalues -o - | FileCheck --check-prefix=SANITY %s
2 ; RUN: llc < %s -filetype=obj | llvm-dwarfdump -v - | FileCheck %s
3 ; Test debug_loc support for floating point constants.
5 ; Created from clang -O1:
16 ; SANITY: CALL{{.*}} @barrier
17 ; SANITY: DBG_VALUE x86_fp80 0xK4000C8F5C28F5C28F800
18 ; SANITY: DBG_VALUE float 0x40091EB860000000
19 ; SANITY: TAILJMP{{.*}} @barrier
21 ; CHECK: .debug_info contents:
22 ; CHECK: DW_TAG_variable
23 ; CHECK-NEXT: DW_AT_location {{.*}} (
24 ; CHECK-NEXT: [0x[[START:.*]], 0x[[END:.*]]): DW_OP_constu 0xc8f5c28f5c28f800, DW_OP_piece 0x8, DW_OP_constu 0x4000, DW_OP_bit_piece 0x10 0x40)
25 ; CHECK-NEXT: DW_AT_name {{.*}}"ld"
26 ; CHECK: DW_TAG_variable
27 ; CHECK-NEXT: DW_AT_location {{.*}} (
28 ; CHECK-NEXT: [0x[[START]], 0x[[END]]): DW_OP_constu 0x4048f5c3)
29 ; CHECK-NEXT: DW_AT_name {{.*}}"f"
31 source_filename = "test.c"
32 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
33 target triple = "x86_64-apple-macosx10.11.0"
35 ; Function Attrs: nounwind ssp uwtable
36 define void @foo() #0 !dbg !4 {
38 tail call void (...) @barrier() #3, !dbg !16
39 tail call void @llvm.dbg.value(metadata float 0x40091EB860000000, metadata !8, metadata !17), !dbg !18
40 tail call void @llvm.dbg.value(metadata x86_fp80 0xK4000C8F5C28F5C28F800, metadata !10, metadata !17), !dbg !19
41 tail call void (...) @barrier() #3, !dbg !20
45 declare void @barrier(...)
47 ; Function Attrs: nounwind readnone
48 declare void @llvm.dbg.value(metadata, metadata, metadata) #2
50 attributes #0 = { nounwind ssp uwtable }
51 attributes #2 = { nounwind readnone }
52 attributes #3 = { nounwind }
55 !llvm.module.flags = !{!12, !13, !14}
58 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
59 !1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/25448338")
61 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: true, unit: !0, retainedNodes: !7)
62 !5 = !DISubroutineType(types: !6)
65 !8 = !DILocalVariable(name: "f", scope: !4, file: !1, line: 5, type: !9)
66 !9 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
67 !10 = !DILocalVariable(name: "ld", scope: !4, file: !1, line: 6, type: !11)
68 !11 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
69 !12 = !{i32 2, !"Dwarf Version", i32 2}
70 !13 = !{i32 2, !"Debug Info Version", i32 3}
71 !14 = !{i32 1, !"PIC Level", i32 2}
72 !15 = !{!"clang version 3.9.0 (trunk 265328) (llvm/trunk 265330)"}
73 !16 = !DILocation(line: 7, column: 3, scope: !4)
75 !18 = !DILocation(line: 5, column: 9, scope: !4)
76 !19 = !DILocation(line: 6, column: 15, scope: !4)
77 !20 = !DILocation(line: 10, column: 3, scope: !4)
78 !21 = !DILocation(line: 11, column: 1, scope: !4)