about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-03-26 22:04:27 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-04-14 17:25:35 +0200
commit5d52ef5091b8e993477fff36efd4cc6f2df33491 (patch)
treead01daa58e23d1731011348e960bfb8a78bc94a0 /src/test
parent44c686113fe93bb67ac2dcb1db500b5b8cbf0b6a (diff)
downloadrust-5d52ef5091b8e993477fff36efd4cc6f2df33491.tar.gz
rust-5d52ef5091b8e993477fff36efd4cc6f2df33491.zip
Add tests and longer error explanation
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/E0660.rs (renamed from src/test/compile-fail/issue-21045.rs)5
-rw-r--r--src/test/ui/E0660.stderr15
-rw-r--r--src/test/ui/E0661.rs16
-rw-r--r--src/test/ui/E0661.stderr9
4 files changed, 43 insertions, 2 deletions
diff --git a/src/test/compile-fail/issue-21045.rs b/src/test/ui/E0660.rs
index 134240f8c8a..dbea0c8e7d8 100644
--- a/src/test/compile-fail/issue-21045.rs
+++ b/src/test/ui/E0660.rs
@@ -7,10 +7,11 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
+
 #![feature(asm)]
 
 fn main() {
     let a;
-    asm!("nop" "nop"); //~ ERROR malformed inline assembly
-    asm!("nop" "nop" : "=r"(a)); //~ ERROR malformed inline assembly
+    asm!("nop" "nop");
+    asm!("nop" "nop" : "=r"(a));
 }
diff --git a/src/test/ui/E0660.stderr b/src/test/ui/E0660.stderr
new file mode 100644
index 00000000000..0ef8fc46487
--- /dev/null
+++ b/src/test/ui/E0660.stderr
@@ -0,0 +1,15 @@
+error[E0660]: malformed inline assembly
+  --> $DIR/E0660.rs:15:5
+   |
+LL |     asm!("nop" "nop");
+   |     ^^^^^^^^^^^^^^^^^^
+
+error[E0660]: malformed inline assembly
+  --> $DIR/E0660.rs:16:5
+   |
+LL |     asm!("nop" "nop" : "=r"(a));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0660`.
diff --git a/src/test/ui/E0661.rs b/src/test/ui/E0661.rs
new file mode 100644
index 00000000000..be932a0d471
--- /dev/null
+++ b/src/test/ui/E0661.rs
@@ -0,0 +1,16 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(asm)]
+
+fn main() {
+    let a;
+    asm!("nop" : "r"(a));
+}
diff --git a/src/test/ui/E0661.stderr b/src/test/ui/E0661.stderr
new file mode 100644
index 00000000000..90aeca5612a
--- /dev/null
+++ b/src/test/ui/E0661.stderr
@@ -0,0 +1,9 @@
+error[E0661]: output operand constraint lacks '=' or '+'
+  --> $DIR/E0661.rs:15:18
+   |
+LL |     asm!("nop" : "r"(a));
+   |                  ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0661`.