about summary refs log tree commit diff
path: root/tests/ui/asm
AgeCommit message (Collapse)AuthorLines
2024-07-12Rollup merge of #126922 - asquared31415:asm_binary_label, r=estebankJubilee-53/+255
add lint for inline asm labels that look like binary fixes #94426 Due to a bug/feature in LLVM, labels composed of only the digits `0` and `1` can sometimes be confused with binary literals, even if a binary literal would not be valid in that position. This PR adds detection for such labels and also as a drive-by change, adds a note to cases such as `asm!(include_str!("file"))` that the label that it found came from an expansion of a macro, it wasn't found in the source code. I expect this PR to upset some people that were using labels `0:` or `1:` without issue because they never hit the case where LLVM got it wrong, but adding a heuristic to the lint to prevent this is not feasible - it would involve writing a whole assembly parser for every target that we have assembly support for. [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202024-06-20/near/445870628) r? ``@estebank``
2024-07-11Fix aarch64 testEsteban Küber-24/+40
2024-07-11Account for `let foo = expr`; to suggest `const foo: Ty = expr;`Esteban Küber-22/+22
2024-07-11Use verbose style when suggesting changing `const` with `let`Esteban Küber-33/+55
2024-07-09add lint for inline asm labels that look like binaryasquared31415-53/+255
2024-06-26Automatically taint InferCtxt when errors are emittedOli Scherer-12/+59
2024-06-22compiler: Fix arm32 asm issues by hierarchically sorting reg classesJubilee Young-0/+33
2024-06-19Fix broken aarch64 unwind testGary Guo-1/+1
2024-06-19Remove c_unwind from tests and fix testsGary Guo-1/+1
2024-06-13Add `f16` and `f128` inline ASM support for `x86` and `x86-64`beetrees-5/+5
2024-05-20Move 100 entries from tests/ui into subdirsJubilee Young-0/+38
- Move super-fast-paren-parsing test into ui/parser - Move stmt_expr_attrs test into ui/feature-gates - Move macro tests into ui/macros - Move global_asm tests into ui/asm - Move env tests into ui/process - Move xcrate tests into ui/cross-crate - Move unop tests into ui/unop - Move backtrace tests into ui/backtrace - Move check-static tests into ui/statics - Move expr tests into ui/expr - Move optimization fuel tests into ui/fuel - Move ffi attribute tests into ui/ffi-attrs - Move suggestion tests into ui/suggestions - Move main tests into ui/fn-main - Move lint tests into ui/lint - Move repr tests into ui/repr - Move intrinsics tests into ui/intrinsics - Move tool lint tests into ui/tool-attributes - Move return tests into ui/return - Move pattern tests into ui/patttern - Move range tests into ui/range - Move foreign-fn tests into ui/foreign - Move orphan-check tests into ui/coherence - Move inference tests into ui/inference - Reduce ROOT_ENTRY_LIMIT
2024-05-01Add inline comments why we're forcing the target cpuJosh Stone-4/+5
2024-05-01Use an explicit x86-64 cpu in tests that are sensitive to itJosh Stone-4/+5
There are a few tests that depend on some target features **not** being enabled by default, and usually they are correct with the default x86-64 target CPU. However, in downstream builds we have modified the default to fit our distros -- `x86-64-v2` in RHEL 9 and `x86-64-v3` in RHEL 10 -- and the latter especially trips tests that expect not to have AVX. These cases are few enough that we can just set them back explicitly.
2024-04-11Rollup merge of #123704 - estebank:diag-changes, r=compiler-errorsMatthias Krüger-8/+8
Tweak value suggestions in `borrowck` and `hir_analysis` Unify the output of `suggest_assign_value` and `ty_kind_suggestion`. Ideally we'd make these a single function, but doing so would likely require modify the crate dependency tree.
2024-04-10Handle more cases of "values to suggest" given a typeEsteban Küber-4/+4
Add handling for `String`, `Box`, `Option` and `Result`.
2024-04-10Handle more cases of value suggestionsEsteban Küber-4/+4
2024-04-07Remove useless configs in testsUrgau-1/+1
Since they are never set and don't have impact on the test. Or for the cfg-panic tests are already tested with check-cfg.
2024-04-03Remove MIR unsafe checkMatthew Jasper-27/+2
This also remove safety information from MIR.
2024-03-25Add needs-unwind annotations to a couple of testsbjorn3-0/+1
2024-03-23Rollup merge of #121940 - veera-sivarajan:bugfix-121593, r=fmeaseJubilee-32/+32
Mention Register Size in `#[warn(asm_sub_register)]` Fixes #121593 Displays the register size information obtained from `suggest_modifier()` and `default_modifier()`.
2024-03-20Update test for `aarch64`Veera-20/+20
2024-03-18Update test with `//@ needs-asm-support`Veera-2/+3
2024-03-18Fix ICE: `global_asm!()` Don't Panic When Unable to Evaluate ConstantVeera-1/+1
A bit of an inelegant fix but given that the error is created only after call to `const_eval_poly()` and that the calling function cannot propagate the error anywhere else, the error has to be explicitly handled inside `mono_item.rs`.
2024-03-18Add testsVeera-0/+25
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-106/+101
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-03-07Bless aarch64 asm testGary Guo-4/+4
2024-03-03Update testsVeera-12/+12
2024-02-24Add tests for asm gotoGary Guo-21/+196
2024-02-20trigger `unsafe_code` on `global_asm!` invocationsKalle Wachsmuth-2/+0
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-174/+174
2024-02-15Rollup merge of #121088 - nikic:evex512, r=AmanieuGuillaume Gomez-0/+15
Implicitly enable evex512 if avx512 is enabled LLVM 18 requires the evex512 feature to allow use of zmm registers. LLVM automatically sets it when using a generic CPU, but not when `-C target-cpu` is specified. This will result either in backend legalization crashes, or code unexpectedly using ymm instead of zmm registers. For now, make sure that `avx512*` features imply `evex512`. Long term we'll probably have to deal with the AVX10 mess somehow. Fixes https://github.com/rust-lang/rust/issues/121081. r? `@Amanieu`
2024-02-14Implicitly enable evex512 if avx512 is enabledNikita Popov-0/+15
LLVM 18 requires the evex512 feature to allow use of zmm registers. LLVM automatically sets it when using a generic CPU, but not when `-C target-cpu` is specified. This will result either in backend legalization crashes, or code unexpectedly using ymm instead of zmm registers. For now, make sure that `avx512*` features imply `evex512`. Long term we'll probably have to deal with the AVX10 mess somehow.
2024-02-14Fix two UI tests with incorrect directive / invalid revision许杰友 Jieyou Xu (Joe)-23/+20
2024-02-10manually bless an aarch64 testRalf Jung-10/+22
2024-02-10rebless after rebaseRalf Jung-0/+3
2024-02-10unstably allow constants to refer to statics and read from immutable staticsRalf Jung-10/+19
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-98/+103
2024-01-30Update feature names for new stdarchAmanieu d'Antras-2/+2
2024-01-18tests/ui/asm/inline-syntax: adapt for LLVM 18Krasimir Georgiev-14/+116
2024-01-05Remove revisions for THIR unsafeckMatthew Jasper-494/+63
This is to make the diff when stabilizing it easier to review.
2023-12-21Make named_asm_labels lint not trigger on unicode and trigger on format argsasquared31415-11/+113
2023-12-02Auto merge of #117912 - GeorgeWort:master, r=petrochenkovbors-16/+16
Name explicit registers in conflict register errors for inline assembly
2023-11-28Name explicit registers in conflict register errors for inline assemblyGeorge Wort-16/+16
2023-11-25make sure we still eagerly emit errorsMichael Goulet-0/+24
2023-11-24Show number in error message even for one errorNilstrieb-7/+7
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-19Fix duplicate labels emitted in `render_multispan_macro_backtrace()`Gurinder Singh-12/+2
Using hash set instead of vec to weed out duplicates
2023-10-06Use pushsection/popsectionbjorn3-2/+2
2023-10-05Properly export function defined in test which uses global_asm!()bjorn3-1/+8
Currently the test passes with the LLVM backend as the codegen unit partitioning logic happens to place both the global_asm!() and the function which calls the function defined by the global_asm!() in the same CGU. With the Cranelift backend it breaks however as it will place all assembly in separate codegen units to be passed to an external linker.
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-2/+2
2023-08-14fixed *const [type error] does not implement the Copy traitnxya-0/+16