Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/float_const.ll

raw
1 ; RUN: llvm-as < %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
4
5 ; RUN: llc -mtriple=%triple < %t.ll -filetype=obj | llvm-dwarfdump -v -debug-info - | FileCheck %s
6 ; from (at -Os):
7 ; void foo() {
8 ; float a = 3.14;
9 ; *(int *)&a = 0;
10 ; }
11 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
12 target triple = "spir64-unknown-unknown"
13
14 ; Function Attrs: nounwind optsize readnone uwtable
15 define void @foo() #0 !dbg !7 {
16 entry:
17 tail call void @llvm.dbg.declare(metadata float* undef, metadata !13, metadata !19), !dbg !20
18 tail call void @llvm.dbg.value(metadata i32 1078523331, metadata !13, metadata !19), !dbg !20
19 tail call void @llvm.dbg.value(metadata i32 0, metadata !13, metadata !19), !dbg !20
20 ; CHECK: DW_AT_const_value [DW_FORM_sdata] (0)
21 ; CHECK-NEXT: DW_AT_name {{.*}}"a"
22 ret void, !dbg !21
23 }
24
25 ; Function Attrs: nounwind readnone
26 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
27
28 ; Function Attrs: nounwind readnone
29 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
30
31 attributes #0 = { nounwind optsize readnone uwtable }
32 attributes #1 = { nounwind readnone }
33
34 !llvm.dbg.cu = !{!0}
35 !llvm.module.flags = !{!15, !16, !17}
36 !llvm.ident = !{!18}
37
38 !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 227686)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)
39 !1 = !DIFile(filename: "foo.c", directory: "")
40 !2 = !{}
41 !3 = !{!4}
42 !4 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !5)
43 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
44 !7 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: true, unit: !0, scopeLine: 1, file: !8, scope: !9, type: !10, retainedNodes: !12)
45 !8 = !DIFile(filename: "foo.c", directory: "")
46 !9 = !DIFile(filename: "foo.c", directory: "")
47 !10 = !DISubroutineType(types: !11)
48 !11 = !{null}
49 !12 = !{!13}
50 !13 = !DILocalVariable(name: "a", line: 2, scope: !7, file: !9, type: !14)
51 !14 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
52 !15 = !{i32 2, !"Dwarf Version", i32 2}
53 !16 = !{i32 2, !"Debug Info Version", i32 3}
54 !17 = !{i32 1, !"PIC Level", i32 2}
55 !18 = !{!"clang version 3.7.0 (trunk 227686)"}
56 !19 = !DIExpression()
57 !20 = !DILocation(line: 2, column: 9, scope: !7)
58 !21 = !DILocation(line: 4, column: 1, scope: !7)