about summary refs log tree commit diff
path: root/src/test/ui/asm
AgeCommit message (Collapse)AuthorLines
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
2021-08-02Validate that naked functions are never inlinedNathaniel McCallum-1/+98
Reject all uses of the inline attribute on naked functions. rust-lang/rfcs#2774 rust-lang/rfcs#2972
2021-07-11Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisabors-22/+57
Add clobber-only register classes for asm! These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
2021-07-10Add clobber-only register classes for asm!Amanieu d'Antras-22/+57
These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
2021-06-30Move some UI tests to more suitable subdirsYuki Okushi-0/+47
2021-06-25Auto merge of #86599 - Amanieu:asm_raw, r=nagisabors-22/+22
Add a "raw" option for asm! which ignores format string specifiers This is useful when including raw assembly snippets using `include_str!`.
2021-06-24Add a "raw" option for asm! which ignores format string specifiersAmanieu d'Antras-22/+22
2021-06-24compiletest: ignore tests on a per-revision basisSimonas Kazlauskas-13/+13
Otherwise something that ought to seemingly work like `//[x86] needs-llvm-components: x86` or `//[nll_beyond]should-fail` do not get evaluated properly.
2021-06-24Re-Annotate the tests with needs-llvm-componentsSimonas Kazlauskas-1/+3
Doesn't work though, because compiletest doesn't process ignores on a per-revision manner.
2021-05-16Auto merge of #85290 - Amanieu:asm_const_int, r=nagisabors-43/+65
Remove support for floating-point constants in asm! Floating-point constants aren't very useful anyways and this simplifies the code since the type check can now be done in typeck. cc `@rust-lang/wg-inline-asm` r? `@nagisa`
2021-05-16Fix comments in testsAmanieu d'Antras-2/+2
2021-05-14Remove support for floating-point constants in asm!Amanieu d'Antras-43/+65
Floating-point constants aren't very useful anyways and this simplifies the code since the type check can now be done in typeck.
2021-05-14Add tests where asm! is properly in unsafe blockSmitty-26/+235
2021-05-13Fix testsAmanieu d'Antras-3/+3
2021-05-13Clarify error message when both asm! and global_asm! are unsupportedAmanieu d'Antras-4/+4
2021-05-13Add tests for global_asm!Amanieu d'Antras-32/+441
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-7/+7
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-04-30Update LLVM submoduleAmanieu d'Antras-2/+0
Fixes #84025
2021-04-13Auto merge of #84099 - tmiasko:asm-only-x86_64, r=Amanieubors-1/+1
Check for asm support in UI tests that require it Add `needs-asm-support` compiletest directive, and use it in asm tests that require asm support without relying on any architecture specific features. Closes #84038.
2021-04-13Check for asm support in UI tests that require itTomasz Miąsko-1/+1
Add `needs-asm-support` compiletest directive, and use it in asm tests that require asm support without relying on any architecture specific features.
2021-04-12Auto merge of #84068 - Amanieu:fix_lint, r=lcnrbors-12/+15
Add `bad_asm_style` to HardwiredLints This was missed when the lint was added, which prevents the lint from being ignored with `#[allow]`.
2021-04-11Add test to allow bad_asm_styleAmanieu d'Antras-12/+15
2021-04-09Auto merge of #81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrumbors-0/+2
reduce threads spawned by ui-tests The test harness already spawns enough tests to keep all cores busy. Individual tests should keep their own threading to a minimum to avoid context switch overhead. When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine. Resolves #81946
2021-04-09reduce threads spawned by ui-testsThe8472-0/+2
the test harness already spawns enough tests for all cores, individual tests should keep their own threading to a minimum to avoid context switch overhead some tests fail with 1 CGU, so explicit compile flags have been added to keep their old behavior
2021-04-07Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkovDylan DPC-96/+147
Use AnonConst for asm! constants This replaces the old system which used explicit promotion. See #83169 for more background. The syntax for `const` operands is still the same as before: `const <expr>`. Fixes #83169 Because the implementation is heavily based on inline consts, we suffer from the same issues: - We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`. - We are hitting the same ICEs as inline consts, for example #78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.
2021-04-06Use AnonConst for asm! constantsAmanieu d'Antras-96/+147
2021-04-05Disallow the use of high byte registes as operands on x86_64Amanieu d'Antras-7/+15
They are still allowed on x86 though. Fixes #83495
2021-03-27Rollup merge of #83328 - tmiasko:asm-test, r=joshtriplettYuki Okushi-2/+2
Fixes to inline assmebly tests * Join test thread to make assertion effective in sym.rs test case * Use a single codegen unit to reduce non-determinism in srcloc.rs test #82886
2021-03-26Rollup merge of #83485 - Amanieu:asm_llvm10, r=joshtriplettDylan DPC-3/+3
Mark asm tests as requiring LLVM 10.0.1
2021-03-25Mark inline asm tests as requiring LLVM 10.0.1Amanieu d'Antras-3/+3
2021-03-25Refactor #82270 as lint instead of an errorAmanieu d'Antras-46/+103
2021-03-20add arm llvm requirementasquared31415-8/+9