summaryrefslogtreecommitdiff
path: root/test/CodeGen/BPF
diff options
context:
space:
mode:
authorAlexei Starovoitov <alexei.starovoitov@gmail.com>2017-11-19 01:35:00 +0000
committerAlexei Starovoitov <alexei.starovoitov@gmail.com>2017-11-19 01:35:00 +0000
commitb5cbc7760ab82c55ee8b340624c9119dfc592e26 (patch)
treef9b152293d9cadc1a6fdac0219725bed1dc3895e /test/CodeGen/BPF
parent83b54ba25b0372c793ab98fc00c37cbf01571601 (diff)
[bpf] allow direct and indirect calls
kernel verifier is becoming smarter and soon will support direct and indirect function calls. Remove obsolete error from BPF backend. Make call to use PCRel_4 fixup. 'bpf to bpf' calls are distinguished from 'bpf to kernel' calls by insn->src_reg == BPF_PSEUDO_CALL == 1 which is used as relocation indicator similar to ld_imm64->src_reg == BPF_PSEUDO_MAP_FD == 1 The actual 'call' instruction remains the same for both 'bpf to kernel' and 'bpf to bpf' calls. Signed-off-by: Alexei Starovoitov <ast@kernel.org> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/BPF')
-rw-r--r--test/CodeGen/BPF/cc_args.ll2
-rw-r--r--test/CodeGen/BPF/cc_args_be.ll2
-rw-r--r--test/CodeGen/BPF/cc_ret.ll2
-rw-r--r--test/CodeGen/BPF/fi_ri.ll2
-rw-r--r--test/CodeGen/BPF/sanity.ll2
-rw-r--r--test/CodeGen/BPF/undef.ll4
-rw-r--r--test/CodeGen/BPF/warn-call.ll3
7 files changed, 7 insertions, 10 deletions
diff --git a/test/CodeGen/BPF/cc_args.ll b/test/CodeGen/BPF/cc_args.ll
index 6a0a07ae8e8..020992a9fd5 100644
--- a/test/CodeGen/BPF/cc_args.ll
+++ b/test/CodeGen/BPF/cc_args.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfel -show-mc-encoding | FileCheck %s
define void @test() #0 {
entry:
diff --git a/test/CodeGen/BPF/cc_args_be.ll b/test/CodeGen/BPF/cc_args_be.ll
index a2f1956319e..469556f6c78 100644
--- a/test/CodeGen/BPF/cc_args_be.ll
+++ b/test/CodeGen/BPF/cc_args_be.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfeb -show-mc-encoding | FileCheck %s
+; RUN: llc < %s -march=bpfeb -show-mc-encoding | FileCheck %s
; test big endian
define void @test() #0 {
diff --git a/test/CodeGen/BPF/cc_ret.ll b/test/CodeGen/BPF/cc_ret.ll
index be198f5d15f..73e3556c63e 100644
--- a/test/CodeGen/BPF/cc_ret.ll
+++ b/test/CodeGen/BPF/cc_ret.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel | FileCheck %s
define void @test() #0 {
entry:
diff --git a/test/CodeGen/BPF/fi_ri.ll b/test/CodeGen/BPF/fi_ri.ll
index 6ecc8267969..12452988e8a 100644
--- a/test/CodeGen/BPF/fi_ri.ll
+++ b/test/CodeGen/BPF/fi_ri.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpf | FileCheck %s
+; RUN: llc < %s -march=bpf | FileCheck %s
%struct.key_t = type { i32, [16 x i8] }
diff --git a/test/CodeGen/BPF/sanity.ll b/test/CodeGen/BPF/sanity.ll
index ebee851fbfb..33cfc2fb030 100644
--- a/test/CodeGen/BPF/sanity.ll
+++ b/test/CodeGen/BPF/sanity.ll
@@ -1,4 +1,4 @@
-; RUN: not llc < %s -march=bpfel | FileCheck %s
+; RUN: llc < %s -march=bpfel | FileCheck %s
@foo_printf.fmt = private unnamed_addr constant [9 x i8] c"hello \0A\00", align 1
diff --git a/test/CodeGen/BPF/undef.ll b/test/CodeGen/BPF/undef.ll
index 6b9948619d8..11bc9ebd254 100644
--- a/test/CodeGen/BPF/undef.ll
+++ b/test/CodeGen/BPF/undef.ll
@@ -1,5 +1,5 @@
-; RUN: not llc < %s -march=bpfel | FileCheck -check-prefixes=CHECK,EL %s
-; RUN: not llc < %s -march=bpfeb | FileCheck -check-prefixes=CHECK,EB %s
+; RUN: llc < %s -march=bpfel | FileCheck -check-prefixes=CHECK,EL %s
+; RUN: llc < %s -march=bpfeb | FileCheck -check-prefixes=CHECK,EB %s
%struct.bpf_map_def = type { i32, i32, i32, i32 }
%struct.__sk_buff = type opaque
diff --git a/test/CodeGen/BPF/warn-call.ll b/test/CodeGen/BPF/warn-call.ll
index ae7f78ac1aa..6dadb359cf6 100644
--- a/test/CodeGen/BPF/warn-call.ll
+++ b/test/CodeGen/BPF/warn-call.ll
@@ -2,9 +2,6 @@
; CHECK: error: warn_call.c
; CHECK: built-in function 'memcpy'
-; CHECK: error: warn_call.c
-; CHECK: global function 'foo'
-; CHECK: global function 'bar'
define i8* @warn(i8* returned, i8*, i64) local_unnamed_addr #0 !dbg !6 {
tail call void @llvm.dbg.value(metadata i8* %0, i64 0, metadata !14, metadata !17), !dbg !18
tail call void @llvm.dbg.value(metadata i8* %1, i64 0, metadata !15, metadata !17), !dbg !19