2020-05-20 16:39:19 -05:00
|
|
|
// revisions: rpass1 cfail1 rpass3
|
2021-12-29 08:14:50 -06:00
|
|
|
// needs-asm-support
|
2020-05-20 16:39:19 -05:00
|
|
|
// only-x86_64
|
|
|
|
// Regression test for issue #72386
|
|
|
|
// Checks that we don't ICE when switching to an invalid register
|
|
|
|
// and back again
|
|
|
|
|
2021-12-09 18:15:33 -06:00
|
|
|
use std::arch::asm;
|
2020-05-20 16:39:19 -05:00
|
|
|
|
|
|
|
#[cfg(any(rpass1, rpass3))]
|
|
|
|
fn main() {
|
2021-12-09 18:15:33 -06:00
|
|
|
unsafe { asm!("nop") }
|
2020-05-20 16:39:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(cfail1)]
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
asm!("nop",out("invalid_reg")_)
|
|
|
|
//[cfail1]~^ ERROR invalid register
|
|
|
|
}
|
|
|
|
}
|