Rollup merge of #73169 - Amanieu:asm-warnings, r=petrochenkov

Handle assembler warnings properly

Previously all inline asm diagnostics were treated as errors, but LLVM sometimes emits warnings and notes as well.

Fixes #73160

r? @petrochenkov
This commit is contained in:
Dylan DPC 2020-06-11 19:04:14 +02:00 committed by GitHub
commit b34111591c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 124 additions and 15 deletions

View file

@ -37,5 +37,8 @@ fn main() {
asm!(concat!("invalid", "_", "instruction"));
//~^ ERROR: invalid instruction mnemonic 'invalid_instruction'
asm!("movaps %xmm3, (%esi, 2)", options(att_syntax));
//~^ WARN: scale factor without index register is ignored
}
}

View file

@ -70,5 +70,17 @@ note: instantiated into assembly here
LL | invalid_instruction
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to 6 previous errors
warning: scale factor without index register is ignored
--> $DIR/srcloc.rs:41:15
|
LL | asm!("movaps %xmm3, (%esi, 2)", options(att_syntax));
| ^
|
note: instantiated into assembly here
--> <inline asm>:1:23
|
LL | movaps %xmm3, (%esi, 2)
| ^
error: aborting due to 6 previous errors; 1 warning emitted