rust/tests/ui/asm/const-error.rs

18 lines
344 B
Rust
Raw Normal View History

//@ only-x86_64
//@ needs-asm-support
2024-09-29 01:49:37 -05:00
//@ check-pass
2023-10-05 04:43:55 -05:00
2024-09-29 01:49:37 -05:00
// Test to make sure that we emit const errors late for inline asm,
// which is consistent with inline const blocks.
2023-10-05 04:43:55 -05:00
use std::arch::asm;
fn test<T>() {
2024-08-10 11:13:03 -05:00
unsafe {
2024-09-29 01:49:37 -05:00
// No error here, as this does not get monomorphized.
2024-08-10 11:13:03 -05:00
asm!("/* {} */", const 1 / 0);
}
2023-10-05 04:43:55 -05:00
}
fn main() {}