about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-asm_const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-asm_const.rs')
-rw-r--r--tests/ui/feature-gates/feature-gate-asm_const.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-asm_const.rs b/tests/ui/feature-gates/feature-gate-asm_const.rs
new file mode 100644
index 00000000000..936918a3cfc
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-asm_const.rs
@@ -0,0 +1,16 @@
+// only-x86_64
+
+use std::arch::asm;
+
+unsafe fn foo<const N: usize>() {
+    asm!("mov eax, {}", const N + 1);
+    //~^ ERROR const operands for inline assembly are unstable
+}
+
+fn main() {
+    unsafe {
+        foo::<0>();
+        asm!("mov eax, {}", const 123);
+        //~^ ERROR const operands for inline assembly are unstable
+    }
+}