about summary refs log tree commit diff
path: root/src/test/ui/asm/asm-parse-errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/asm/asm-parse-errors.rs')
-rw-r--r--src/test/ui/asm/asm-parse-errors.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/asm/asm-parse-errors.rs b/src/test/ui/asm/asm-parse-errors.rs
new file mode 100644
index 00000000000..e712ac5826e
--- /dev/null
+++ b/src/test/ui/asm/asm-parse-errors.rs
@@ -0,0 +1,15 @@
+#![feature(asm)]
+
+fn main() {
+    asm!(); //~ ERROR requires a string literal as an argument
+    asm!("nop" : struct); //~ ERROR expected string literal
+    asm!("mov %eax, $$0x2" : struct); //~ ERROR expected string literal
+    asm!("mov %eax, $$0x2" : "={eax}" struct); //~ ERROR expected `(`
+    asm!("mov %eax, $$0x2" : "={eax}"(struct)); //~ ERROR expected expression
+    asm!("in %dx, %al" : "={al}"(result) : struct); //~ ERROR expected string literal
+    asm!("in %dx, %al" : "={al}"(result) : "{dx}" struct); //~ ERROR expected `(`
+    asm!("in %dx, %al" : "={al}"(result) : "{dx}"(struct)); //~ ERROR expected expression
+    asm!("mov $$0x200, %eax" : : : struct); //~ ERROR expected string literal
+    asm!("mov eax, 2" : "={eax}"(foo) : : : struct); //~ ERROR expected string literal
+    asm!(123); //~ ERROR inline assembly must be a string literal
+}