summary refs log tree commit diff
path: root/src/test/ui/asm
AgeCommit message (Collapse)AuthorLines
2022-02-09Rollup merge of #92611 - Amanieu:asm-reference, r=m-ou-seMatthias Krüger-0/+36
Add links to the reference and rust by example for asm! docs and lints These were previously removed in #91728 due to broken links. cc ``@ehuss`` since this updates the rust-by-example submodule
2021-12-12Re-bless asm tests for aarch64Amanieu d'Antras-152/+154
2021-12-12Stabilize asm! and global_asm!Amanieu d'Antras-338/+351
They are also removed from the prelude as per the decision in https://github.com/rust-lang/rust/issues/87228. stdarch and compiler-builtins are updated to work with the new, stable asm! and global_asm! macros.
2021-12-12Remove automatic rustfix of asm! to llvm_asm!Amanieu d'Antras-58/+0
This no longer works now that asm! needs an explicit import. Also, it's been over a year since asm! landed, everyone should have transitioned by now.
2021-12-11Fix AArch64 asm ui testsAmanieu d'Antras-19/+11
2021-12-03fix inline asm test by not hardcoding symbol namescynecx-6/+18
2021-12-03add clobber_abi("C") to may_unwind inline-asm testscynecx-2/+2
2021-12-03add tests for asm's options(may_unwind)cynecx-0/+71
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-44/+44
2021-11-12fix aarch test error annotationsasquared31415-4/+4
2021-11-10add missing sym featureasquared31415-1/+1
2021-11-10Fix aarch testsasquared31415-60/+51
2021-11-10Add support for specifying multiple clobber_abi in `asm!`asquared31415-100/+258
Allow multiple clobber_abi in asm Update docs Fix aarch64 test Combine abis Emit duplicate ABI error, empty ABI list error multiple clobber_abi
2021-11-07Restrict tests that use needs-asm-support to non-experimentalAmanieu d'Antras-2/+3
architectures
2021-11-07Add features gates for experimental asm featuresAmanieu d'Antras-79/+92
2021-10-26Add a regression test for issue-89875Yuki Okushi-0/+14
2021-10-23bless the line changes in ui/asm/aarch64/srcloc.rsJosh Stone-23/+23
2021-10-22Update the minimum external LLVM to 12Josh Stone-1/+1
2021-10-22Update the minimum external LLVM to 11Josh Stone-30/+25
2021-10-16Auto merge of #89860 - camsteffen:macro-semi, r=petrochenkovbors-40/+40
Remove trailing semicolon from macro call span Macro call site spans are now less surprising/more consistent since they no longer contain a semicolon after the macro call. The downside is that we need to do a little guesswork to get the semicolon in diagnostics. But this should not be noticeable since it is rare for the semicolon to not immediately follow the macro call.
2021-10-15Bless testsCameron Steffen-40/+40
2021-10-14Use non-checking TLS relocation in aarch64 asm! sym test.Adam Gemmell-1/+1
The checking variant ensures that the offset required is not larger than 12 bits - hence we wouldn't ever need the upper 12 bits.
2021-10-07make #[target_feature] work with `asm` register classesasquared31415-34/+84
2021-09-29Rollup merge of #89311 - FabianWolff:issue-89305, r=oli-obkEric Huss-0/+29
Add unit assignment to MIR for `asm!()` Fixes #89305. `ExprKind::LlvmInlineAsm` gets a `push_assign_unit()` here: https://github.com/rust-lang/rust/blob/2b6ed3b675475abc01ce7e68bb75b457f0c85684/compiler/rustc_mir_build/src/build/expr/into.rs#L475-L479 The same should probably happen for `ExprKind::InlineAsm`, which fixes the "use of possibly-uninitialized variable" error described in #89305.
2021-09-28Add unit assignment to MIR for `asm!()`Fabian Wolff-0/+29
2021-09-24Disable some tests for platforms without registers.Adam Gemmell-188/+296
Update new tests to run on aarch64 platforms.
2021-09-24Add inline asm! tests for aarch64Adam Gemmell-76/+2570
Enable tests which are largely architecture-independent on all supported platforms
2021-09-11Rollup merge of #88209 - Amanieu:asm_in_underscore, r=nagisaJubilee-25/+49
Improve error message when _ is used for in/inout asm operands As suggested by ```@Commeownist``` in https://github.com/rust-lang/rust/issues/72016#issuecomment-903102415.
2021-09-01Stop sorting bodies by span.Camille GILLOT-15/+15
The definition order is already close to the span order, and only differs in corner cases.
2021-08-24Move `named_asm_labels` to a HIR lintasquared31415-32/+159
2021-08-21Improve error message when _ is used for in/inout asm operandsAmanieu d'Antras-25/+49
2021-08-18Auto merge of #87985 - nbdd0121:asm, r=Amanieubors-0/+27
Forbid `!` from being used in `asm!` output Fixes #87802 r? `@Amanieu`
2021-08-15Fix ui tests for llvm_asm! deprecationAmanieu d'Antras-35/+38
2021-08-14Auto merge of #87581 - Amanieu:asm_clobber_abi, r=nagisabors-56/+225
Add support for clobber_abi to asm! This PR adds the `clobber_abi` feature that was proposed in #81092. Fixes #81092 cc `@rust-lang/wg-inline-asm` r? `@nagisa`
2021-08-14Auto merge of #87324 - asquared31415:named-asm-labels, r=Amanieubors-0/+406
Lint against named asm labels This adds a deny-by-default lint to prevent the use of named labels in inline `asm!`. Without a solution to #81088 about whether the compiler should rewrite named labels or a special syntax for labels, a lint against them should prevent users from writing assembly that could break for internal compiler reasons, such as inlining or anything else that could change the number of actual inline assembly blocks emitted. This does **not** resolve the issue with rewriting labels, that still needs a decision if the compiler should do any more work to try to make them work.
2021-08-12Forbid `!` from being used in `asm!` outputGary Guo-0/+27
2021-08-12Add support for clobber_abi to asm!Amanieu d'Antras-50/+219
2021-08-12Fix error message typo for pure asm without outputsAmanieu d'Antras-6/+6
2021-08-07Auto merge of #87772 - npmccallum:naked_abi, r=Amanieubors-14/+8
Move naked function ABI check to its own lint This check was previously categorized under the lint named `UNSUPPORTED_NAKED_FUNCTIONS`. That lint is future incompatible and will be turned into an error in a future release. However, as defined in the Constrained Naked Functions RFC, this check should only be a warning. This is because it is possible for a naked function to be implemented in such a way that it does not break even the undefined ABI. For example, a `jmp` to a `const`. Therefore, this patch defines a new lint named `UNDEFINED_NAKED_FUNCTION_ABI` which contains just this single check. Unlike `UNSUPPORTED_NAKED_FUNCTIONS`, `UNDEFINED_NAKED_FUNCTION_ABI` will not be converted to an error in the future. rust-lang/rfcs#2774 rust-lang/rfcs#2972
2021-08-06Rollup merge of #87742 - npmccallum:naked_ffi, r=AmanieuYuki Okushi-0/+32
Validate FFI-safety warnings on naked functions Test that FFI-safety warnings don't get accidentally dropped on naked functions. The big picture is that if you implement a naked function with the Rust ABI you'll get a warning. Further, if you implement a naked function with a standardized ABI, but use non-FFI-safe types you will still get a warning. rust-lang/rfcs#2774 rust-lang/rfcs#2972 cc ``````@joshtriplett`````` ``````@Amanieu`````` ``````@haraldh``````
2021-08-04Combine spans into one error, deduplicate codeasquared31415-91/+34
2021-08-04Disable unused variable lint for naked functionsNathaniel McCallum-71/+1
In most calling conventions, accessing function parameters may require stack access. However, naked functions have no assembly prelude to set up stack access. This is why naked functions may only contain a single `asm!()` block. All parameter access is done inside the `asm!()` block, so we cannot validate the liveness of the input parameters. Therefore, we should disable the lint for naked functions. rust-lang/rfcs#2774 rust-lang/rfcs#2972
2021-08-04Add test for naked function unused variables lintNathaniel McCallum-0/+220
This test proves that naked functions are treated the same as regular functions regarding unused function parameters. We will change this behavior in the next patch.
2021-08-04Move naked function ABI check to its own lintNathaniel McCallum-14/+8
This check was previously categorized under the lint named `UNSUPPORTED_NAKED_FUNCTIONS`. That lint is future incompatible and will be turned into an error in a future release. However, as defined in the Constrained Naked Functions RFC, this check should only be a warning. This is because it is possible for a naked function to be implemented in such a way that it does not break even the undefined ABI. For example, a `jmp` to a `const`. Therefore, this patch defines a new lint named `UNDEFINED_NAKED_FUNCTION_ABI` which contains just this single check. Unlike `UNSUPPORTED_NAKED_FUNCTIONS`, `UNDEFINED_NAKED_FUNCTION_ABI` will not be converted to an error in the future. rust-lang/rfcs#2774 rust-lang/rfcs#2972
2021-08-04Update error messageasquared31415-105/+105
2021-08-04Fix lint capitalization and ignoring, test with include_strasquared31415-100/+142
2021-08-04Handle leading colons properlyasquared31415-33/+43
2021-08-04Proper characters in labels, ignore commentsasquared31415-20/+36
2021-08-04Lint against named asm labelsasquared31415-0/+395
2021-08-03Validate FFI-safety warnings on naked functionsNathaniel McCallum-0/+32
Test that FFI-safety warnings don't get accidentally dropped on naked functions. The big picture is that if you implement a naked function with the Rust ABI you'll get a warning. Further, if you implement a naked function with a standardized ABI, but use non-FFI-safe types you will still get a warning. rust-lang/rfcs#2774 rust-lang/rfcs#2972