about summary refs log tree commit diff
path: root/tests/codegen-llvm/naked-fn/aligned.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-21 14:34:12 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-22 14:28:48 +0200
commita27f3e3fd1e4d16160f8885b6b06665b5319f56c (patch)
treeb033935392cbadf6f85d2dbddf433a88e323aeeb /tests/codegen-llvm/naked-fn/aligned.rs
parented93c1783b404d728d4809973a0550eb33cd293f (diff)
downloadrust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.tar.gz
rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.zip
Rename `tests/codegen` into `tests/codegen-llvm`
Diffstat (limited to 'tests/codegen-llvm/naked-fn/aligned.rs')
-rw-r--r--tests/codegen-llvm/naked-fn/aligned.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/codegen-llvm/naked-fn/aligned.rs b/tests/codegen-llvm/naked-fn/aligned.rs
new file mode 100644
index 00000000000..d7281c4219a
--- /dev/null
+++ b/tests/codegen-llvm/naked-fn/aligned.rs
@@ -0,0 +1,21 @@
+//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
+//@ needs-asm-support
+//@ ignore-arm no "ret" mnemonic
+//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)
+
+#![crate_type = "lib"]
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
+#![feature(fn_align)]
+
+use std::arch::naked_asm;
+
+// CHECK: .balign 16
+// CHECK-LABEL: naked_empty:
+#[rustc_align(16)]
+#[no_mangle]
+#[unsafe(naked)]
+pub extern "C" fn naked_empty() {
+    // CHECK: ret
+    naked_asm!("ret")
+}