Re: [PATCH bpf-next v5 3/3] selftests/bpf: Add unit tests with __bpf_trap() kfunc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 23, 2025 at 1:53 PM Yonghong Song <yonghong.song@xxxxxxxxx> wrote:
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/verifier_bpf_trap.c
> @@ -0,0 +1,71 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
> +#include <vmlinux.h>
> +#include <bpf/bpf_helpers.h>
> +#include "bpf_misc.h"
> +
> +#if __clang_major__ >= 21

I added "&& 0" here to avoid failing the build
on current clang 21.

> +SEC("socket")
> +__description("__builtin_trap with simple c code")
> +__failure __msg("unexpected __bpf_trap() due to uninitialized variable?")
> +void bpf_builtin_trap_with_simple_c(void)
> +{
> +       __builtin_trap();
> +}
> +#endif





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux