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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
344 B
Rust
Raw Normal View History

2023-10-05 04:43:55 -05:00
//@ 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() {}