summaryrefslogtreecommitdiffstats
path: root/tests/ui/asm/const-error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/asm/const-error.rs')
-rw-r--r--tests/ui/asm/const-error.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/asm/const-error.rs b/tests/ui/asm/const-error.rs
new file mode 100644
index 000000000..4e14becf7
--- /dev/null
+++ b/tests/ui/asm/const-error.rs
@@ -0,0 +1,15 @@
+// only-x86_64
+// needs-asm-support
+
+#![feature(asm_const)]
+
+// Test to make sure that we emit const errors eagerly for inline asm
+
+use std::arch::asm;
+
+fn test<T>() {
+ unsafe { asm!("/* {} */", const 1 / 0); }
+ //~^ ERROR evaluation of
+}
+
+fn main() {}