103 lines · plain
1; RUN: llc -mtriple=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s2; RUN: llc -mtriple=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s3;4; Source:5; struct s1 {6; struct { int A1; } a1;7; struct ptr b1;8; };9; int f1(struct s1 *s1) { return 0; }10; Compilation flag:11; clang -target bpf -O2 -g -S -emit-llvm t.c12 13%struct.s1 = type { %struct.anon, ptr }14%struct.anon = type { i32 }15%struct.anon.0 = type { i64 }16 17; Function Attrs: norecurse nounwind readnone18define dso_local i32 @f1(ptr nocapture readnone %s1) local_unnamed_addr !dbg !7 {19entry:20 call void @llvm.dbg.value(metadata ptr %s1, metadata !25, metadata !DIExpression()), !dbg !2621 ret i32 0, !dbg !2722}23 24; CHECK: .long 0 # BTF_KIND_PTR(id = 1)25; CHECK-NEXT: .long 33554432 # 0x200000026; CHECK-NEXT: .long 227; CHECK-NEXT: .long 1 # BTF_KIND_STRUCT(id = 2)28; CHECK-NEXT: .long 67108866 # 0x400000229; CHECK-NEXT: .long 1630; CHECK-NEXT: .long 431; CHECK-NEXT: .long 332; CHECK-NEXT: .long 0 # 0x033; CHECK-NEXT: .long 734; CHECK-NEXT: .long 535; CHECK-NEXT: .long 64 # 0x4036; CHECK-NEXT: .long 0 # BTF_KIND_STRUCT(id = 3)37; CHECK-NEXT: .long 67108865 # 0x400000138; CHECK-NEXT: .long 439; CHECK-NEXT: .long 1040; CHECK-NEXT: .long 441; CHECK-NEXT: .long 0 # 0x042; CHECK-NEXT: .long 13 # BTF_KIND_INT(id = 4)43; CHECK-NEXT: .long 16777216 # 0x100000044; CHECK-NEXT: .long 445; CHECK-NEXT: .long 16777248 # 0x100002046; CHECK-NEXT: .long 0 # BTF_KIND_PTR(id = 5)47; CHECK-NEXT: .long 33554432 # 0x200000048; CHECK-NEXT: .long 649; CHECK-NEXT: .long 0 # BTF_KIND_STRUCT(id = 6)50; CHECK-NEXT: .long 67108865 # 0x400000151; CHECK-NEXT: .long 852; CHECK-NEXT: .long 1753; CHECK-NEXT: .long 754; CHECK-NEXT: .long 0 # 0x055; CHECK-NEXT: .long 20 # BTF_KIND_INT(id = 7)56; CHECK-NEXT: .long 16777216 # 0x100000057; CHECK-NEXT: .long 858; CHECK-NEXT: .long 16777280 # 0x100004059 60; CHECK: .ascii "s1" # string offset=161; CHECK: .ascii "a1" # string offset=462; CHECK: .ascii "b1" # string offset=763; CHECK: .ascii "A1" # string offset=1064; CHECK: .ascii "int" # string offset=1365; CHECK: .ascii "B1" # string offset=1766; CHECK: .ascii "long int" # string offset=2067 68; Function Attrs: nounwind readnone speculatable willreturn69declare void @llvm.dbg.value(metadata, metadata, metadata)70 71!llvm.dbg.cu = !{!0}72!llvm.module.flags = !{!3, !4, !5}73!llvm.ident = !{!6}74 75!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git ef36f5143d83897cc6f59ff918769d29ad5a0612)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)76!1 = !DIFile(filename: "t.c", directory: "/tmp/home/yhs/btf/tmp")77!2 = !{}78!3 = !{i32 7, !"Dwarf Version", i32 4}79!4 = !{i32 2, !"Debug Info Version", i32 3}80!5 = !{i32 1, !"wchar_size", i32 4}81!6 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git ef36f5143d83897cc6f59ff918769d29ad5a0612)"}82!7 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !24)83!8 = !DISubroutineType(types: !9)84!9 = !{!10, !11}85!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)86!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)87!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1", file: !1, line: 1, size: 128, elements: !13)88!13 = !{!14, !18}89!14 = !DIDerivedType(tag: DW_TAG_member, name: "a1", scope: !12, file: !1, line: 2, baseType: !15, size: 32)90!15 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !12, file: !1, line: 2, size: 32, elements: !16)91!16 = !{!17}92!17 = !DIDerivedType(tag: DW_TAG_member, name: "A1", scope: !15, file: !1, line: 2, baseType: !10, size: 32)93!18 = !DIDerivedType(tag: DW_TAG_member, name: "b1", scope: !12, file: !1, line: 3, baseType: !19, size: 64, offset: 64)94!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !20, size: 64)95!20 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !12, file: !1, line: 3, size: 64, elements: !21)96!21 = !{!22}97!22 = !DIDerivedType(tag: DW_TAG_member, name: "B1", scope: !20, file: !1, line: 3, baseType: !23, size: 64)98!23 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)99!24 = !{!25}100!25 = !DILocalVariable(name: "s1", arg: 1, scope: !7, file: !1, line: 5, type: !11)101!26 = !DILocation(line: 0, scope: !7)102!27 = !DILocation(line: 5, column: 25, scope: !7)103