1 ; RUN: llc -mtriple=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
2 ; RUN: llc -mtriple=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
5 ; extern int elsewhere(void);
8 ; } prog_map = { .values = { elsewhere } };
10 ; clang -target bpf -O2 -g -S -emit-llvm test.c
13 @prog_map = dso_local local_unnamed_addr global { [1 x ptr] } { [1 x ptr] [ptr @elsewhere] }, align 8, !dbg !0
15 declare !dbg !17 dso_local i32 @elsewhere() #0
17 ; CHECK: .long 0 # BTF_KIND_FUNC_PROTO(id = 6)
18 ; CHECK-NEXT: .long 218103808 # 0xd000000
20 ; CHECK-NEXT: .long 37 # BTF_KIND_INT(id = 7)
21 ; CHECK-NEXT: .long 16777216 # 0x1000000
23 ; CHECK-NEXT: .long 16777248 # 0x1000020
24 ; CHECK-NEXT: .long 41 # BTF_KIND_FUNC(id = 8)
25 ; CHECK-NEXT: .long 201326594 # 0xc000002
28 attributes #0 = { "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
31 !llvm.module.flags = !{!12, !13, !14, !15}
34 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
35 !1 = distinct !DIGlobalVariable(name: "prog_map", scope: !2, file: !3, line: 4, type: !5, isLocal: false, isDefinition: true)
36 !2 = distinct !DICompileUnit(language: DW_LANG_C11, file: !3, producer: "clang version 19.0.0git (git@github.com:llvm/llvm-project.git 0390a6803608e3a5314315b73740c2d3f5a5723f)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)
37 !3 = !DIFile(filename: "b.c", directory: "/home/nickz/llvm-project.git", checksumkind: CSK_MD5, checksum: "41cc17375f1261a0e072590833492553")
39 !5 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 2, elements: !6)
41 !7 = !DIDerivedType(tag: DW_TAG_member, name: "values", scope: !5, file: !3, line: 3, baseType: !8)
42 !8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, elements: !10)
43 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
45 !11 = !DISubrange(count: -1)
46 !12 = !{i32 7, !"Dwarf Version", i32 5}
47 !13 = !{i32 2, !"Debug Info Version", i32 3}
48 !14 = !{i32 1, !"wchar_size", i32 4}
49 !15 = !{i32 7, !"frame-pointer", i32 2}
50 !16 = !{!"clang version 19.0.0git (git@github.com:llvm/llvm-project.git 0390a6803608e3a5314315b73740c2d3f5a5723f)"}
51 !17 = !DISubprogram(name: "elsewhere", scope: !3, file: !3, line: 1, type: !18, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)
52 !18 = !DISubroutineType(types: !19)
54 !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)