Debian Codegraph @

clang/test/Sema/bpf-attr-bpf-fastcall.c

raw
1 // REQUIRES: bpf-registered-target
2 // RUN: %clang_cc1 %s -triple bpf -verify
3
4 __attribute__((bpf_fastcall)) int var; // expected-warning {{'bpf_fastcall' attribute only applies to functions and function pointers}}
5
6 __attribute__((bpf_fastcall)) void func();
7 __attribute__((bpf_fastcall(1))) void func_invalid(); // expected-error {{'bpf_fastcall' attribute takes no arguments}}
8
9 void (*ptr1)(void) __attribute__((bpf_fastcall));
10 void (*ptr2)(void);
11 void foo(void) {
12 ptr2 = ptr1; // not an error
13 ptr1 = ptr2; // not an error
14 }