rust/tests
Trevor Gross 10a7f93f12
Rollup merge of #128362 - folkertdev:naked-function-symbol-visibility, r=bjorn3
add test for symbol visibility of `#[naked]` functions

tracking issue: #90957

This test is extracted from https://github.com/rust-lang/rust/pull/128004

That PR attempts to generated naked functions as an extern function declaration, combined with a global asm block that provides the implementation for that declaration.

In order to link declaration and definition together, some flavor of external linking must be used: LLVM will error for other linkage types. Specifically the allowed options are `#[linkage = "external"]` and `#[linkage = "extern_weak"]`. That is kind of an implementation detail though: to the user, a naked function should just behave like a normal function.

Hence it should be visible to the linker under the same circumstances as a normal, vanilla function and have the same attributes (Weak, External). Getting this behavior right will require some care, so I think it's a good idea to lock it in now, before making any changes, to make sure we don't regress.

Are there any interesting cases that I missed here? E.g. is checking on different architectures worth it? I don't think the other binary types (rlib etc) are relevant here, but may be missing something.

r? ``@bjorn3``
2024-08-06 22:17:32 -05:00
..
assembly Match LLVM ABI in extern "C" functions for f128 on Windows 2024-07-30 20:23:33 +01:00
auxiliary
codegen Rollup merge of #128500 - clubby789:122600-test, r=Mark-Simulacrum 2024-08-05 05:40:21 +02:00
codegen-units Revert "Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix" 2024-08-03 07:57:31 -04:00
coverage Finish blessing coverage/mcdc tests after LLVM 19 upgrade 2024-08-01 13:36:50 +10:00
coverage-run-rustdoc coverage: Extract hole spans from HIR instead of MIR 2024-07-08 21:22:56 +10:00
crashes Normalize when equating dyn tails in MIR borrowck 2024-08-05 14:28:06 -04:00
debuginfo Add Natvis visualiser and debuginfo tests for f16 2024-07-09 03:47:50 +01:00
incremental Do not normalize constants eagerly. 2024-07-31 00:59:12 +00:00
mir-opt custom MIR: add support for tail calls 2024-08-05 18:23:14 +02:00
pretty Mark format! with must_use hint 2024-07-06 14:24:20 +02:00
run-make Rollup merge of #128362 - folkertdev:naked-function-symbol-visibility, r=bjorn3 2024-08-06 22:17:32 -05:00
run-pass-valgrind rustfmt tests/run-pass-valgrind/. 2024-06-04 09:53:02 +10:00
rustdoc Rollup merge of #127921 - spastorino:stabilize-unsafe-extern-blocks, r=compiler-errors 2024-08-03 20:51:51 +02:00
rustdoc-gui rustdoc-search: account for numeric disambiguators on impls 2024-08-06 07:36:12 -07:00
rustdoc-js Add test for Self not being a generic in search index 2024-08-04 12:49:28 -07:00
rustdoc-js-std Update tests 2024-06-07 11:55:52 +08:00
rustdoc-json Rollup merge of #128385 - its-the-shrimp:fix_114039, r=aDotInTheVoid 2024-08-05 18:36:01 +02:00
rustdoc-ui Add regression test for #69264 2024-08-06 16:56:48 +02:00
ui Auto merge of #128761 - matthiaskrgr:rollup-5p1mlqq, r=matthiaskrgr 2024-08-07 00:46:06 +00:00
ui-fulldeps Bless test fallout 2024-08-03 07:57:31 -04:00
COMPILER_TESTS.md