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