brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · c3f93ab Raw
68 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 code:5;   extern char a;6;   int foo() { return a; }7; Compilation flag:8;   clang -target bpf -O2 -g -S -emit-llvm test.c9 10@a = external dso_local local_unnamed_addr global i8, align 111 12; Function Attrs: norecurse nounwind readonly13define dso_local i32 @foo() local_unnamed_addr !dbg !7 {14  %1 = load i8, ptr @a, align 1, !dbg !11, !tbaa !1215  %2 = sext i8 %1 to i32, !dbg !1116  ret i32 %2, !dbg !1517}18 19; CHECK:             .section        .BTF,"",@progbits20; CHECK-NEXT:        .short  60319                   # 0xeb9f21; CHECK-NEXT:        .byte   122; CHECK-NEXT:        .byte   023; CHECK-NEXT:        .long   2424; CHECK-NEXT:        .long   025; CHECK-NEXT:        .long   4026; CHECK-NEXT:        .long   4027; CHECK-NEXT:        .long   5228; CHECK-NEXT:        .long   0                       # BTF_KIND_FUNC_PROTO(id = 1)29; CHECK-NEXT:        .long   218103808               # 0xd00000030; CHECK-NEXT:        .long   231; CHECK-NEXT:        .long   1                       # BTF_KIND_INT(id = 2)32; CHECK-NEXT:        .long   16777216                # 0x100000033; CHECK-NEXT:        .long   434; CHECK-NEXT:        .long   16777248                # 0x100002035; CHECK-NEXT:        .long   5                       # BTF_KIND_FUNC(id = 3)36; CHECK-NEXT:        .long   201326593               # 0xc00000137; CHECK-NEXT:        .long   138; CHECK-NEXT:        .byte   0                       # string offset=039; CHECK-NEXT:        .ascii  "int"                   # string offset=140; CHECK-NEXT:        .byte   041; CHECK-NEXT:        .ascii  "foo"                   # string offset=542; CHECK-NEXT:        .byte   043; CHECK-NEXT:        .ascii  ".text"                 # string offset=944; CHECK-NEXT:        .byte   045; CHECK-NEXT:        .ascii  "/home/yhs/work/tests/llvm/bug/test.c" # string offset=1546; CHECK-NEXT:        .byte   047 48!llvm.dbg.cu = !{!0}49!llvm.module.flags = !{!3, !4, !5}50!llvm.ident = !{!6}51 52!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.20181009 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)53!1 = !DIFile(filename: "test.c", directory: "/home/yhs/work/tests/llvm/bug")54!2 = !{}55!3 = !{i32 2, !"Dwarf Version", i32 4}56!4 = !{i32 2, !"Debug Info Version", i32 3}57!5 = !{i32 1, !"wchar_size", i32 4}58!6 = !{!"clang version 8.0.20181009 "}59!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, unit: !0, retainedNodes: !2)60!8 = !DISubroutineType(types: !9)61!9 = !{!10}62!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)63!11 = !DILocation(line: 2, column: 20, scope: !7)64!12 = !{!13, !13, i64 0}65!13 = !{!"omnipotent char", !14, i64 0}66!14 = !{!"Simple C/C++ TBAA"}67!15 = !DILocation(line: 2, column: 13, scope: !7)68