summary refs log tree commit diff
path: root/src/test/ui/asm
AgeCommit message (Collapse)AuthorLines
2020-05-31Clarify errors and warnings about the transition to the new asm!Amanieu d'Antras-6/+12
2020-05-30Rollup merge of #72625 - Amanieu:asm-srcloc, r=petrochenkovRalf Jung-0/+115
Improve inline asm error diagnostics Previously we were just using the raw LLVM error output (with line, caret, etc) as the diagnostic message, which ends up looking rather out of place with our existing diagnostics. The new diagnostics properly format the diagnostics and also take advantage of LLVM's per-line `srcloc` attribute to map an error in inline assembly directly to the relevant line of source code. Incidentally also fixes #71639 by disabling `srcloc` metadata during LTO builds since we don't know what crate it might have come from. We can only resolve `srcloc`s from the currently crate since it indexes into the source map for the current crate. Fixes #72664 Fixes #71639 r? @petrochenkov ### Old style ```rust #![feature(llvm_asm)] fn main() { unsafe { let _x: i32; llvm_asm!( "mov $0, $1 invalid_instruction $0, $1 mov $0, $1" : "=&r" (_x) : "r" (0) :: "intel" ); } } ``` ``` error: <inline asm>:3:14: error: invalid instruction mnemonic 'invalid_instruction' invalid_instruction ecx, eax ^~~~~~~~~~~~~~~~~~~ --> src/main.rs:6:9 | 6 | / llvm_asm!( 7 | | "mov $0, $1 8 | | invalid_instruction $0, $1 9 | | mov $0, $1" ... | 12 | | :: "intel" 13 | | ); | |__________^ ``` ### New style ```rust #![feature(asm)] fn main() { unsafe { asm!( "mov {0}, {1} invalid_instruction {0}, {1} mov {0}, {1}", out(reg) _, in(reg) 0i64, ); } } ``` ``` error: invalid instruction mnemonic 'invalid_instruction' --> test.rs:7:14 | 7 | invalid_instruction {0}, {1} | ^ | note: instantiated into assembly here --> <inline asm>:3:14 | 3 | invalid_instruction rax, rcx | ^^^^^^^^^^^^^^^^^^^ ```
2020-05-30Rollup merge of #72607 - Amanieu:fix-72570, r=oli-obkRalf Jung-0/+18
Eagerly lower asm sub-expressions to HIR even if there is an error Fixes #72570 r? @oli-obk
2020-05-29Improve inline asm error diagnosticsAmanieu d'Antras-0/+115
2020-05-26Fix testAmanieu d'Antras-0/+11
2020-05-26Eagerly lower asm sub-expressions to HIR even if there is an errorAmanieu d'Antras-0/+7
Fixes #72570
2020-05-24Properly handle InlineAsmOperand::SymFn when collecting monomorphized itemsAmanieu d'Antras-0/+38
Fixes #72484
2020-05-18Fix const handling and add tests for const operandsAmanieu d'Antras-0/+56
2020-05-18Add borrow-check testAmanieu d'Antras-1/+50
2020-05-18Implement att_syntax optionAmanieu d'Antras-4/+4
2020-05-18Add support for high byte registers on x86Amanieu d'Antras-46/+40
2020-05-18Apply review feedbackAmanieu d'Antras-18/+33
2020-05-18Add tests for asm!Amanieu d'Antras-0/+1131
2020-04-17Rename `asm` test directory in favor of `llvm_asm`Yuki Okushi-432/+0
2020-04-17Add test for issue-54067Yuki Okushi-0/+12
2020-04-11rustc: Add a warning count upon completionRoccoDev-0/+2
2020-03-26Update tests to use llvm_asm!Amanieu d'Antras-98/+98
2020-03-13Add test for issue-69092Yuki Okushi-0/+21
2020-03-09Check if output is immediate valueYuki Okushi-0/+22
2019-12-21rework run-fail and support check,build-failMazdak Farrokhzad-1/+2
2019-11-17Add some more testsVadim Petrochenkov-0/+12
2019-11-17Address review commentsVadim Petrochenkov-5/+5
2019-11-14Fix ui tests with better error code usageGuillaume Gomez-0/+5
2019-10-22Add test for issue-51431Yuki Okushi-0/+18
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-3/+3
2019-06-16compiletest: Remove `skip-codegen`Vadim Petrochenkov-6/+4
2019-04-22update tests for migrate mode by defaultMatthew Jasper-29/+4
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-4/+0
2019-03-11Update testsVadim Petrochenkov-14/+14
2019-01-02make `panictry!` private to libsyntaxAndy Russell-0/+83
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2018-12-25Remove licensesMark Rousskov-70/+10
2018-11-07Removed `#[rustc_error]` from tests that are all `// compile-pass`.Felix S. Klock II-18/+4
I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
2018-11-07remove `#[rustc_error]` from ui/ tests that remain compile-fail tests.Felix S. Klock II-2/+2
2018-10-09Point to variable in `asm!` macro when failing borrowckEsteban Küber-4/+4
2018-09-12use structured suggestion for "missing mut" labelAndy Russell-1/+1
Fixes #54133.
2018-08-14Moved problematic tests on armhf-gnu back to compile-fail.David Wood-63/+0
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+424