xref: /llvm-project/llvm/test/CodeGen/BPF/BTF/float.ll (revision c5037db4acd95790a0ca5061c8fa79c5c291607e)
1*c5037db4SFangrui Song; RUN: llc -mtriple=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
2*c5037db4SFangrui Song; RUN: llc -mtriple=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
3a7137b23SIlya Leoshkevich
4a7137b23SIlya Leoshkevich; Source code:
5a7137b23SIlya Leoshkevich;   float a;
6a7137b23SIlya Leoshkevich; Compilation flag:
7a7137b23SIlya Leoshkevich;   clang -target bpf -O2 -g -S -emit-llvm t.c
8a7137b23SIlya Leoshkevich
9a7137b23SIlya Leoshkevich@a = dso_local local_unnamed_addr global float 0.000000e+00, align 4, !dbg !0
10a7137b23SIlya Leoshkevich
11a7137b23SIlya Leoshkevich!llvm.dbg.cu = !{!2}
12a7137b23SIlya Leoshkevich!llvm.module.flags = !{!7, !8, !9}
13a7137b23SIlya Leoshkevich!llvm.ident = !{!10}
14a7137b23SIlya Leoshkevich
15a7137b23SIlya Leoshkevich; CHECK:             .section .BTF,"",@progbits
16a7137b23SIlya Leoshkevich; CHECK-NEXT:        .short 60319 # 0xeb9f
17a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 1
18a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 0
19a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 24
20a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 0
21a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 52
22a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 52
23a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 14
24a7137b23SIlya Leoshkevich; [1] float, size=4 bytes (32 bits)
25a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 1 # BTF_KIND_FLOAT(id = 1)
26a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 268435456 # 0x10000000
27a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 4
28a7137b23SIlya Leoshkevich; [2] a, type=float (1), global
29a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 7 # BTF_KIND_VAR(id = 2)
30a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 234881024 # 0xe000000
31a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 1
32a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 1
33a7137b23SIlya Leoshkevich; [3] .bss, 1 var, {a, offset=&a, size=4 bytes}
34a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 9 # BTF_KIND_DATASEC(id = 3)
35a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 251658241 # 0xf000001
36a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 0
37a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 2
38a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long a
39a7137b23SIlya Leoshkevich; CHECK-NEXT:        .long 4
40a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 0 # string offset=0
41a7137b23SIlya Leoshkevich; CHECK-NEXT:        .ascii "float" # string offset=1
42a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 0
43a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 97 # string offset=7
44a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 0
45a7137b23SIlya Leoshkevich; CHECK-NEXT:        .ascii ".bss" # string offset=9
46a7137b23SIlya Leoshkevich; CHECK-NEXT:        .byte 0
47a7137b23SIlya Leoshkevich
48a7137b23SIlya Leoshkevich!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
49a7137b23SIlya Leoshkevich!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
50a7137b23SIlya Leoshkevich!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 11.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
51a7137b23SIlya Leoshkevich!3 = !DIFile(filename: "t.c", directory: "/home/yhs/tmp")
52a7137b23SIlya Leoshkevich!4 = !{}
53a7137b23SIlya Leoshkevich!5 = !{!0}
54a7137b23SIlya Leoshkevich!6 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
55a7137b23SIlya Leoshkevich!7 = !{i32 7, !"Dwarf Version", i32 4}
56a7137b23SIlya Leoshkevich!8 = !{i32 2, !"Debug Info Version", i32 3}
57a7137b23SIlya Leoshkevich!9 = !{i32 1, !"wchar_size", i32 4}
58a7137b23SIlya Leoshkevich!10 = !{!"clang version 11.0.0 "}
59