about summary refs log tree commit diff
path: root/src/test/ui/asm/srcloc.rs
AgeCommit message (Collapse)AuthorLines
2021-09-24Add inline asm! tests for aarch64Adam Gemmell-124/+0
Enable tests which are largely architecture-independent on all supported platforms
2021-03-27Rollup merge of #83328 - tmiasko:asm-test, r=joshtriplettYuki Okushi-1/+1
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-25Mark inline asm tests as requiring LLVM 10.0.1Amanieu d'Antras-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.
2020-06-15asm: Allow multiple template strings; interpret them as newline-separatedJosh Triplett-0/+80
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.
2020-06-09Handle assembler warnings properlyAmanieu d'Antras-0/+3
2020-05-29Improve inline asm error diagnosticsAmanieu d'Antras-0/+41