summary refs log tree commit diff
path: root/src/test/ui/asm
AgeCommit message (Collapse)AuthorLines
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
2021-03-20Join test thread to make assertion effective in sym.rs test caseTomasz Miąsko-1/+1
2021-03-20Use a single codegen unit to reduce non-determinism in srcloc.rs testTomasz Miąsko-1/+1
When building with multiple codegen units the test case can fail with only a subset of all errors. Use a single codegen unit as a workaround.
2021-03-08Test x86 and arm outputsasquared31415-13/+42
2021-02-20Take into account target default syntaxasquared31415-12/+35
2021-02-18Emit error when trying to use assembler syntax directives in `asm!`asquared31415-0/+50
2020-12-07Validate naked functions definitionsTomasz Miąsko-95/+469
2020-12-01Auto merge of #78684 - devsnek:inline-asm-wasm, r=Amanieubors-2/+2
Add wasm32 support to inline asm There is some contention around inline asm and wasm, and I really only made this to figure out the process of hacking on rustc, but I figured as long as the code existed, it was worth uploading. cc `@Amanieu`
2020-12-01Add wasm32 support to inline asmGus Caplan-2/+2
2020-11-26Bless test.Camille GILLOT-8/+8
2020-11-25Validate use of parameters in naked functionsTomasz Miąsko-0/+95
* Reject use of parameters inside naked function body. * Reject use of patterns inside function parameters, to emphasize role of parameters a signature declaration (mirroring existing behaviour for function declarations) and avoid generating code introducing specified bindings.
2020-11-24Validate that `#[naked]` is applied to a function definitionTomasz Miąsko-0/+93
2020-10-06builtin_macros: Fix use of interpolated identifiers in `asm!`Vadim Petrochenkov-0/+75
2020-09-02pretty: trim paths of unique symbolsDan Aloni-9/+9
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-09tests: Mark `ui/asm/bad-arch.rs` as requiring wasm llvm backendVadim Petrochenkov-1/+2
2020-08-06Fix ICE when using asm! on an unsupported architectureAmanieu d'Antras-0/+26
Fixes #75220
2020-07-14Remove `Sized` `on_unimplemented` noteEsteban Küber-3/+0
2020-07-10Avoid "whitelist"Tamir Duberstein-1/+1
Other terms are more inclusive and precise.
2020-06-30Stabilize `#[track_caller]`.Adam Perry-1/+1
Does not yet make its constness stable, though. Use of `Location::caller` in const contexts is still gated by `#![feature(const_caller_location)]`.
2020-06-20Fix duplicate options errorCamelid-9/+9
The UI isn't glitching anymore.
2020-06-20Make suggestion machine-applicableCamelid-10/+37
2020-06-20Add more to duplicate options testCamelid-1/+26
2020-06-20Use `span_suggestion` instead of `span_label`Camelid-6/+6
2020-06-20Update duplicate options testCamelid-53/+11
2020-06-20Make warning an error; use help instead of suggestion; clean up codeCamelid-25/+66
For some reason, the help message is now in a separate message, which adds a lot of noise. I would like to try to get it back to one message.
2020-06-20Add UI test for duplicate `asm!` options warningCamelid-0/+57
2020-06-20Update testsCamelid-41/+12
2020-06-15asm: Allow multiple template strings; interpret them as newline-separatedJosh Triplett-5/+325
Allow the `asm!` macro to accept a series of template arguments, and interpret them as if they were concatenated with a '\n' between them. This allows writing an `asm!` where each line of assembly appears in a separate template string argument. This syntax makes it possible for rustfmt to reliably format and indent each line of assembly, without risking changes to the inside of a template string. It also avoids the complexity of having the user carefully format and indent a multi-line string (including where to put the surrounding quotes), and avoids the extra indentation and lines of a call to `concat!`. For example, rewriting the second example from the [blog post on the new inline assembly syntax](https://blog.rust-lang.org/inside-rust/2020/06/08/new-inline-asm.html) using multiple template strings: ```rust fn main() { let mut bits = [0u8; 64]; for value in 0..=1024u64 { let popcnt; unsafe { asm!( " popcnt {popcnt}, {v}", "2:", " blsi rax, {v}", " jz 1f", " xor {v}, rax", " tzcnt rax, rax", " stosb", " jmp 2b", "1:", v = inout(reg) value => _, popcnt = out(reg) popcnt, out("rax") _, // scratch inout("rdi") bits.as_mut_ptr() => _, ); } println!("bits of {}: {:?}", value, &bits[0..popcnt]); } } ``` Note that all the template strings must appear before all other arguments; you cannot, for instance, provide a series of template strings intermixed with the corresponding operands. In order to get srcloc mappings right for macros that generate multi-line string literals, create one line_span for each line in the string literal, each pointing to the macro. Make `rustc_parse_format::Parser::curarg` `pub`, so that we can propagate it from one template string argument to the next.