brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.4 KiB · 733815d Raw
116 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; Source:4;   struct tt;5;   struct s1 { const struct tt *mp; };6;   int test1(struct s1 *arg)7;   {8;     return  0;9;   }10;11;   struct tt { int m1; int m2; };12;   struct s2 { const struct tt m3; };13;   int test2(struct s2 *arg)14;   {15;     return arg->m3.m1;16;   }17; Compilation flags:18;   clang -target bpf -O2 -g -S -emit-llvm t.c19 20%struct.s1 = type { ptr }21%struct.tt = type { i32, i32 }22%struct.s2 = type { %struct.tt }23 24; Function Attrs: norecurse nounwind readnone25define dso_local i32 @test1(ptr nocapture readnone %arg) local_unnamed_addr !dbg !7 {26entry:27  call void @llvm.dbg.value(metadata ptr %arg, metadata !22, metadata !DIExpression()), !dbg !2328  ret i32 0, !dbg !2429}30 31; Function Attrs: norecurse nounwind readonly32define dso_local i32 @test2(ptr nocapture readonly %arg) local_unnamed_addr !dbg !25 {33entry:34  call void @llvm.dbg.value(metadata ptr %arg, metadata !33, metadata !DIExpression()), !dbg !3435  %0 = load i32, ptr %arg, align 4, !dbg !35, !tbaa !3636  ret i32 %0, !dbg !4237}38 39; CHECK:        .long   0                       # BTF_KIND_CONST(id = 4)40; CHECK-NEXT:   .long   167772160               # 0xa00000041; CHECK-NEXT:   .long   1042 43; CHECK:        .long   60                      # BTF_KIND_STRUCT(id = 9)44; CHECK-NEXT:   .long   67108865                # 0x400000145; CHECK-NEXT:   .long   846; CHECK-NEXT:   .long   6347; CHECK-NEXT:   .long   448; CHECK-NEXT:   .long   0                       # 0x049 50; CHECK:        .long   66                      # BTF_KIND_STRUCT(id = 10)51; CHECK-NEXT:   .long   67108866                # 0x400000252; CHECK-NEXT:   .long   853; CHECK-NEXT:   .long   6954; CHECK-NEXT:   .long   655; CHECK-NEXT:   .long   0                       # 0x056; CHECK-NEXT:   .long   7257; CHECK-NEXT:   .long   658; CHECK-NEXT:   .long   32                      # 0x2059 60; CHECK:        .ascii  "s2"                    # string offset=6061; CHECK:        .ascii  "m3"                    # string offset=6362; CHECK:        .ascii  "tt"                    # string offset=6663; CHECK:        .ascii  "m1"                    # string offset=6964; CHECK:        .ascii  "m2"                    # string offset=7265 66; Function Attrs: nounwind readnone speculatable willreturn67declare void @llvm.dbg.value(metadata, metadata, metadata)68 69!llvm.dbg.cu = !{!0}70!llvm.module.flags = !{!3, !4, !5}71!llvm.ident = !{!6}72 73!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git 7cfd267c518aba226b34b7fbfe8db70000b22053)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)74!1 = !DIFile(filename: "t.c", directory: "/tmp/home/yhs/work/tests/btf")75!2 = !{}76!3 = !{i32 7, !"Dwarf Version", i32 4}77!4 = !{i32 2, !"Debug Info Version", i32 3}78!5 = !{i32 1, !"wchar_size", i32 4}79!6 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git 7cfd267c518aba226b34b7fbfe8db70000b22053)"}80!7 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 3, type: !8, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !21)81!8 = !DISubroutineType(types: !9)82!9 = !{!10, !11}83!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)84!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)85!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1", file: !1, line: 2, size: 64, elements: !13)86!13 = !{!14}87!14 = !DIDerivedType(tag: DW_TAG_member, name: "mp", scope: !12, file: !1, line: 2, baseType: !15, size: 64)88!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64)89!16 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !17)90!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "tt", file: !1, line: 8, size: 64, elements: !18)91!18 = !{!19, !20}92!19 = !DIDerivedType(tag: DW_TAG_member, name: "m1", scope: !17, file: !1, line: 8, baseType: !10, size: 32)93!20 = !DIDerivedType(tag: DW_TAG_member, name: "m2", scope: !17, file: !1, line: 8, baseType: !10, size: 32, offset: 32)94!21 = !{!22}95!22 = !DILocalVariable(name: "arg", arg: 1, scope: !7, file: !1, line: 3, type: !11)96!23 = !DILocation(line: 0, scope: !7)97!24 = !DILocation(line: 5, column: 3, scope: !7)98!25 = distinct !DISubprogram(name: "test2", scope: !1, file: !1, line: 10, type: !26, scopeLine: 11, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !32)99!26 = !DISubroutineType(types: !27)100!27 = !{!10, !28}101!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !29, size: 64)102!29 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s2", file: !1, line: 9, size: 64, elements: !30)103!30 = !{!31}104!31 = !DIDerivedType(tag: DW_TAG_member, name: "m3", scope: !29, file: !1, line: 9, baseType: !16, size: 64)105!32 = !{!33}106!33 = !DILocalVariable(name: "arg", arg: 1, scope: !25, file: !1, line: 10, type: !28)107!34 = !DILocation(line: 0, scope: !25)108!35 = !DILocation(line: 12, column: 18, scope: !25)109!36 = !{!37, !39, i64 0}110!37 = !{!"s2", !38, i64 0}111!38 = !{!"tt", !39, i64 0, !39, i64 4}112!39 = !{!"int", !40, i64 0}113!40 = !{!"omnipotent char", !41, i64 0}114!41 = !{!"Simple C/C++ TBAA"}115!42 = !DILocation(line: 12, column: 3, scope: !25)116