26 lines · plain
1; RUN: llc -mtriple=bpfel -filetype=obj -o %t.el < %s2; RUN: llvm-readelf -r %t.el | FileCheck %s3; RUN: llc -mtriple=bpfeb -filetype=obj -o %t.eb < %s4; RUN: llvm-readelf -r %t.eb | FileCheck %s5 6; source code:7; int g() { return 0; }8; struct t { ptr p; } gbl = { g };9; compilation flag:10; clang -target bpf -O2 -emit-llvm -S test.c11 12%struct.t = type { ptr }13 14@gbl = dso_local local_unnamed_addr global %struct.t { ptr @g }, align 815 16; CHECK: '.rel.data'17; CHECK: 0000000000000000 0000000200000002 R_BPF_64_ABS64 0000000000000000 g18 19; Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress20define dso_local i32 @g() #0 {21entry:22 ret i32 023}24 25attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }26