1 ; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
2 ; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
7 ; struct {char m:2; __int n:3; char p;} a;
9 ; clang -target bpf -O2 -g -S -emit-llvm t.c
11 %struct.anon = type { i8, i8, [2 x i8] }
13 @a = common dso_local local_unnamed_addr global %struct.anon zeroinitializer, align 4, !dbg !0
16 !llvm.module.flags = !{!15, !16, !17}
19 ; CHECK: .section .BTF,"",@progbits
20 ; CHECK-NEXT: .short 60319 # 0xeb9f
23 ; CHECK-NEXT: .long 24
25 ; CHECK-NEXT: .long 104
26 ; CHECK-NEXT: .long 104
27 ; CHECK-NEXT: .long 27
28 ; CHECK-NEXT: .long 0 # BTF_KIND_STRUCT(id = 1)
29 ; CHECK-NEXT: .long 2214592515 # 0x84000003
33 ; CHECK-NEXT: .long 33554432 # 0x2000000
36 ; CHECK-NEXT: .long 50331650 # 0x3000002
39 ; CHECK-NEXT: .long 8 # 0x8
40 ; CHECK-NEXT: .long 7 # BTF_KIND_INT(id = 2)
41 ; CHECK-NEXT: .long 16777216 # 0x1000000
43 ; CHECK-NEXT: .long 16777224 # 0x1000008
44 ; CHECK-NEXT: .long 12 # BTF_KIND_TYPEDEF(id = 3)
45 ; CHECK-NEXT: .long 134217728 # 0x8000000
47 ; CHECK-NEXT: .long 18 # BTF_KIND_TYPEDEF(id = 4)
48 ; CHECK-NEXT: .long 134217728 # 0x8000000
50 ; CHECK-NEXT: .long 23 # BTF_KIND_INT(id = 5)
51 ; CHECK-NEXT: .long 16777216 # 0x1000000
53 ; CHECK-NEXT: .long 16777248 # 0x1000020
54 ; CHECK-NEXT: .byte 0 # string offset=0
55 ; CHECK-NEXT: .byte 109 # string offset=1
57 ; CHECK-NEXT: .byte 110 # string offset=3
59 ; CHECK-NEXT: .byte 112 # string offset=5
61 ; CHECK-NEXT: .ascii "char" # string offset=7
63 ; CHECK-NEXT: .ascii "__int" # string offset=12
65 ; CHECK-NEXT: .ascii "_int" # string offset=18
67 ; CHECK-NEXT: .ascii "int" # string offset=23
70 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
71 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
72 !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 8.0.0 (trunk 345296) (llvm/trunk 345297)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
73 !3 = !DIFile(filename: "t.c", directory: "/home/yhs/tmp")
76 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 3, size: 32, elements: !7)
78 !8 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !6, file: !3, line: 3, baseType: !9, size: 2, flags: DIFlagBitField, extraData: i64 0)
79 !9 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
80 !10 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !6, file: !3, line: 3, baseType: !11, size: 3, offset: 2, flags: DIFlagBitField, extraData: i64 0)
81 !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "__int", file: !3, line: 2, baseType: !12)
82 !12 = !DIDerivedType(tag: DW_TAG_typedef, name: "_int", file: !3, line: 1, baseType: !13)
83 !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
84 !14 = !DIDerivedType(tag: DW_TAG_member, name: "p", scope: !6, file: !3, line: 3, baseType: !9, size: 8, offset: 8)
85 !15 = !{i32 2, !"Dwarf Version", i32 4}
86 !16 = !{i32 2, !"Debug Info Version", i32 3}
87 !17 = !{i32 1, !"wchar_size", i32 4}
88 !18 = !{!"clang version 8.0.0 (trunk 345296) (llvm/trunk 345297)"}