about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2021-05-29 22:17:02 +1000
committerAlessandro Decina <alessandro.d@gmail.com>2021-05-29 22:23:32 +1000
commit9cf2170a79c73f32e1442120242729dc3af992f0 (patch)
treed7e8a31062a161f07600b3bfb9fc72ac2b7c7d07 /src/test/codegen
parentec0382e40437b5cd69678e96de950590ef7196ef (diff)
downloadrust-9cf2170a79c73f32e1442120242729dc3af992f0.tar.gz
rust-9cf2170a79c73f32e1442120242729dc3af992f0.zip
BPF: fix #[target_feature(enable = "alu32")]
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/bpf-alu32.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/codegen/bpf-alu32.rs b/src/test/codegen/bpf-alu32.rs
new file mode 100644
index 00000000000..30ad9747520
--- /dev/null
+++ b/src/test/codegen/bpf-alu32.rs
@@ -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
+}