rust/tests/ui/asm
Matthias Krüger c354a97bd9
Rollup merge of #138570 - folkertdev:naked-function-target-feature-gate, r=Amanieu
add `naked_functions_target_feature` unstable feature

tracking issue: https://github.com/rust-lang/rust/issues/138568

tagging https://github.com/rust-lang/rust/pull/134213 https://github.com/rust-lang/rust/issues/90957

This PR puts `#[target_feature(/* ... */)]` on `#[naked]` functions behind its own feature gate, so that naked functions can be stabilized. It turns out that supporting `target_feature` on naked functions is tricky on some targets, so we're splitting it out to not block stabilization of naked functions themselves. See the tracking issue for more information and workarounds.

Note that at the time of writing, the `target_features` attribute is ignored when generating code for naked functions.

r? ``@Amanieu``
2025-03-21 15:48:52 +01:00
..
aarch64 Rollup merge of #136239 - folkertdev:show-supported-register-classes, r=SparrowLii,jieyouxu 2025-02-11 18:04:34 +01:00
loongarch rustc_target: Add target features for LoongArch v1.1 2025-03-14 09:52:02 +08:00
powerpc tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
riscv Remove duplicated code in RISC-V asm bad-reg test 2025-01-28 23:49:02 +09:00
s390x tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
sparc tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
x86_64 Stabilize asm_goto 2025-03-17 11:12:10 +00:00
arm-low-dreg.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
asm-with-nested-closure.rs Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
bad-template.aarch64.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
bad-template.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
bad-template.x86_64.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
binary_asm_labels.rs add lint for inline asm labels that look like binary 2024-07-09 01:23:49 +00:00
binary_asm_labels.stderr Update the binary_asm_label message 2024-07-18 17:00:43 -04:00
binary_asm_labels_allowed.rs Change binary_asm_labels to only fire on x86 and x86_64 2024-07-18 15:00:56 -05:00
conditionally-sized-ptr-fail.rs Better error message for unsized pointers 2025-02-24 16:20:50 +00:00
conditionally-sized-ptr-fail.stderr Better error message for unsized pointers 2025-02-24 16:20:50 +00:00
conditionally-sized-ptr.rs Properly support thin ptrs that are only thin due to their param-env in asm macro 2025-02-24 16:20:35 +00:00
const-error.rs adjust test 2024-09-29 08:49:37 +02:00
const-refs-to-static.rs Stabilize const_refs_to_static 2024-09-26 13:21:15 +02:00
const-refs-to-static.stderr Stabilize const_refs_to_static 2024-09-26 13:21:15 +02:00
const-resolve-error.rs Bless tests 2025-02-26 19:27:19 +00:00
const-resolve-error.stderr Bless tests 2025-02-26 19:27:19 +00:00
empty_global_asm.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
fail-const-eval-issue-121099.rs Bless tests 2025-02-26 19:27:19 +00:00
fail-const-eval-issue-121099.stderr Bless tests 2025-02-26 19:27:19 +00:00
generic-const.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
generic_const_simd_vec_len.rs Clarify why a type is rejected for asm! 2024-12-11 20:17:37 +00:00
generic_const_simd_vec_len.stderr Clarify why a type is rejected for asm! 2024-12-11 20:17:37 +00:00
global-asm-isnt-really-a-mir-body.rs Exclude global_asm from mir_keys 2025-03-06 17:34:17 +00:00
global-asm-with-error.rs Construct MIR error body for global_asm correctly 2025-03-06 17:34:17 +00:00
global-asm-with-error.stderr Exclude global_asm from mir_keys 2025-03-06 17:34:17 +00:00
global-asm-with-lifetimes.rs Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
ice-bad-err-span-in-template-129503.rs Fix error span when arg to asm!() is a macro call 2024-09-27 09:49:15 +05:30
ice-bad-err-span-in-template-129503.stderr Do not suggest using -Zmacro-backtrace for builtin macros 2025-03-14 19:50:03 +00:00
inline-asm-with-lifetimes.bad.stderr Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
inline-asm-with-lifetimes.rs Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
inline-syntax.arm.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
inline-syntax.arm_llvm_18.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
inline-syntax.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
inline-syntax.x86_64.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
invalid-const-operand.rs Pass InferCtxt to InlineAsmCtxt to properly taint on error 2025-03-10 14:28:09 +00:00
invalid-const-operand.stderr Pass InferCtxt to InlineAsmCtxt to properly taint on error 2025-03-10 14:28:09 +00:00
invalid-sym-operand.rs add needs-asm-support to invalid-sym-operand 2024-08-02 19:59:34 +01:00
invalid-sym-operand.stderr add needs-asm-support to invalid-sym-operand 2024-08-02 19:59:34 +01:00
issue-72570.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-72570.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-85247.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
issue-85247.rwpi.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
issue-87802.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
issue-87802.stderr Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
issue-89305.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-89305.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-92378.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
issue-97490.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99071.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
issue-99071.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
issue-99122-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99122.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99122.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-113788.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-113788.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
may_unwind.rs Add needs-unwind annotations to a couple of tests 2024-03-25 14:19:07 +00:00
naked-asm-outside-naked-fn.rs disallow naked_asm! outside of #[naked] functions 2024-09-10 15:19:14 +02:00
naked-asm-outside-naked-fn.stderr disallow naked_asm! outside of #[naked] functions 2024-09-10 15:19:14 +02:00
naked-functions-ffi.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-ffi.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
naked-functions-inline.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-inline.stderr switch to an allowlist approach 2024-07-27 12:55:39 +02:00
naked-functions-instruction-set.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
naked-functions-target-feature.rs add naked_functions_target_feature unstable feature 2025-03-16 22:07:43 +01:00
naked-functions-testattrs.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-testattrs.stderr switch to an allowlist approach 2024-07-27 12:55:39 +02:00
naked-functions-unused.aarch64.stderr use naked_asm! in naked-function tests 2024-10-06 18:12:25 +02:00
naked-functions-unused.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-unused.x86_64.stderr use naked_asm! in naked-function tests 2024-10-06 18:12:25 +02:00
naked-functions.rs add naked_functions_target_feature unstable feature 2025-03-16 22:07:43 +01:00
naked-functions.stderr various fixes for naked_asm! implementation 2024-10-06 19:00:09 +02:00
naked-invalid-attr.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-invalid-attr.stderr disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-with-invalid-repr-attr.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-with-invalid-repr-attr.stderr disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
named-asm-labels.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
named-asm-labels.s Move /src/test to /tests 2023-01-11 09:32:08 +00:00
named-asm-labels.stderr disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
named_const_simd_vec_len.rs Evaluate constants in SIMD vec lengths before rejecting them 2024-12-11 20:17:37 +00:00
non-const.rs Note def descr in NonConstFunctionCall 2024-12-23 22:15:32 +00:00
non-const.stderr Note def descr in NonConstFunctionCall 2024-12-23 22:15:32 +00:00
noreturn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
parse-error.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
parse-error.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
reg-conflict.rs tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
reg-conflict.stderr tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore 2024-12-17 01:12:36 +09:00
simple_global_asm.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
tainting-on-error.rs Pass InferCtxt to InlineAsmCtxt to properly taint on error 2025-03-10 14:28:09 +00:00
tainting-on-error.stderr Pass InferCtxt to InlineAsmCtxt to properly taint on error 2025-03-10 14:28:09 +00:00
type-check-1.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
type-check-1.stderr stabilize asm_const 2024-08-13 23:18:31 +02:00
type-check-4.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
type-check-4.stderr Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
unpretty-expanded.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unpretty-expanded.stdout [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsupported-option.fixed add needs-asm-support to tests/ui/asm/unsupported-option.rs 2024-07-27 19:27:20 +02:00
unsupported-option.rs add needs-asm-support to tests/ui/asm/unsupported-option.rs 2024-07-27 19:27:20 +02:00
unsupported-option.stderr add needs-asm-support to tests/ui/asm/unsupported-option.rs 2024-07-27 19:27:20 +02:00