[clang] [llvm] [BPF] introduce `__attribute__((bpf_fastcall))` (PR #101228)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 15:44:10 PDT 2024


================
@@ -0,0 +1,24 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang_cc1 -triple bpf -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
+
+#define __bpf_fastcall __attribute__((bpf_fastcall))
+
+void test(void) __bpf_fastcall;
+void (*ptr)(void) __bpf_fastcall;
+
+void foo(void) {
+  test();
+  (*ptr)();
+}
+
+// CHECK: @ptr = global ptr null
+// CHECK: define {{.*}} @foo()
----------------
yonghong-song wrote:

Since later we have 'ret void', maybe replace the above {{.*}} more explicit including 'void'?

https://github.com/llvm/llvm-project/pull/101228


More information about the cfe-commits mailing list