[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / bpf-attr-bpf-fastcall.c
blob178b1f50741e87709f74edddf135c8e6011ef943
1 // REQUIRES: bpf-registered-target
2 // RUN: %clang_cc1 %s -triple bpf -verify
4 __attribute__((bpf_fastcall)) int var; // expected-warning {{'bpf_fastcall' attribute only applies to functions and function pointers}}
6 __attribute__((bpf_fastcall)) void func();
7 __attribute__((bpf_fastcall(1))) void func_invalid(); // expected-error {{'bpf_fastcall' attribute takes no arguments}}
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