brintos

brintos / llvm-project-archived public Read only

0
0
Text · 530 B · 178b1f5 Raw
15 lines · c
1// REQUIRES: bpf-registered-target2// RUN: %clang_cc1 %s -triple bpf -verify3 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 9void (*ptr1)(void) __attribute__((bpf_fastcall));10void (*ptr2)(void);11void foo(void) {12  ptr2 = ptr1; // not an error13  ptr1 = ptr2; // not an error14}15