about summary refs log tree commit diff
path: root/src/test/ui/asm/bad-options.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/asm/bad-options.rs')
-rw-r--r--src/test/ui/asm/bad-options.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/asm/bad-options.rs b/src/test/ui/asm/bad-options.rs
new file mode 100644
index 00000000000..755fc2ca238
--- /dev/null
+++ b/src/test/ui/asm/bad-options.rs
@@ -0,0 +1,18 @@
+// only-x86_64
+
+#![feature(asm)]
+
+fn main() {
+    let mut foo = 0;
+    unsafe {
+        asm!("", options(nomem, readonly));
+        //~^ ERROR the `nomem` and `readonly` options are mutually exclusive
+        asm!("", options(pure, nomem, noreturn));
+        //~^ ERROR the `pure` and `noreturn` options are mutually exclusive
+        //~^^ ERROR asm with `pure` option must have at least one output
+        asm!("{}", in(reg) foo, options(pure, nomem));
+        //~^ ERROR asm with `pure` option must have at least one output
+        asm!("{}", out(reg) foo, options(noreturn));
+        //~^ ERROR asm outputs are not allowed with the `noreturn` option
+    }
+}