BPF: fix #[target_feature(enable = "alu32")]
This commit is contained in:
parent
ec0382e404
commit
9cf2170a79
3 changed files with 14 additions and 0 deletions
|
@ -250,6 +250,7 @@ declare_features! (
|
|||
(active, f16c_target_feature, "1.36.0", Some(44839), None),
|
||||
(active, riscv_target_feature, "1.45.0", Some(44839), None),
|
||||
(active, ermsb_target_feature, "1.49.0", Some(44839), None),
|
||||
(active, bpf_target_feature, "1.53.0", Some(44839), None),
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// feature-group-end: actual feature gates (target features)
|
||||
|
|
|
@ -2597,6 +2597,7 @@ fn from_target_feature(
|
|||
Some(sym::rtm_target_feature) => rust_features.rtm_target_feature,
|
||||
Some(sym::f16c_target_feature) => rust_features.f16c_target_feature,
|
||||
Some(sym::ermsb_target_feature) => rust_features.ermsb_target_feature,
|
||||
Some(sym::bpf_target_feature) => rust_features.bpf_target_feature,
|
||||
Some(name) => bug!("unknown target feature gate {}", name),
|
||||
None => true,
|
||||
};
|
||||
|
|
12
src/test/codegen/bpf-alu32.rs
Normal file
12
src/test/codegen/bpf-alu32.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// compile-flags: --emit=asm --target bpfel-unknown-none
|
||||
// only-bpf
|
||||
#![crate_type = "lib"]
|
||||
#![feature(bpf_target_feature)]
|
||||
#![no_std]
|
||||
|
||||
#[no_mangle]
|
||||
#[target_feature(enable = "alu32")]
|
||||
// CHECK: define i8 @foo(i8 returned %arg) unnamed_addr #0 {
|
||||
pub unsafe fn foo(arg: u8) -> u8 {
|
||||
arg
|
||||
}
|
Loading…
Add table
Reference in a new issue