about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-21 14:42:35 +1000
committerGitHub <noreply@github.com>2025-09-21 14:42:35 +1000
commit92ea947c782cbfb1f2e75e2c4b53ebe4158a7f33 (patch)
treecf699d979e0dc61bb28b491cfa12937f3c2b3cfa /tests
parent5c1c47925e8669831f1c75eed0784d4ff9ac85fb (diff)
parentb27942853efdb2fde2b6f73023c38ebfec3fcb8f (diff)
downloadrust-92ea947c782cbfb1f2e75e2c4b53ebe4158a7f33.tar.gz
rust-92ea947c782cbfb1f2e75e2c4b53ebe4158a7f33.zip
Rollup merge of #146793 - folkertdev:naked-asm-func-end, r=Amanieu
naked_asm: emit a label starting with `func_end`

The `cargo asm` tool (`cargo install cargo-show-asm`) pattern matches on such labels to figure out where functions end: normal functions generated by LLVM always do have such a label. We don't guarantee that naked functions emit such a label, but having `cargo asm` work is convenient.

https://github.com/pacak/cargo-show-asm/blob/be45f67454ad8b634246a7fc69b3c6a963ee93f1/src/asm/statements.rs#L897-L901

To make the label name unique it's suffixed with the name of the current symbol.

r? ```@Amanieu```
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly-llvm/naked-functions/wasm32.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/assembly-llvm/naked-functions/wasm32.rs b/tests/assembly-llvm/naked-functions/wasm32.rs
index 77547e82041..4bf04dd3923 100644
--- a/tests/assembly-llvm/naked-functions/wasm32.rs
+++ b/tests/assembly-llvm/naked-functions/wasm32.rs
@@ -21,6 +21,7 @@ use minicore::*;
 // CHECK: .functype nop () -> ()
 // CHECK-NOT: .size
 // CHECK: end_function
+// CHECK-LABEL: .Lfunc_end_nop:
 #[no_mangle]
 #[unsafe(naked)]
 extern "C" fn nop() {