about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-09-29 08:14:23 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-09-29 08:14:23 -0700
commit7784a8d39773517da476a19562cea0ef0cd36eab (patch)
tree603ee2b90f703e8d5f83a5b9ec5651e9672421d8 /src/test
parentb7c002aac149618d4ef7e2ef5a1417c85631dddb (diff)
parent8826fdfe37a7cbf901ddced1d7e2b4320e117461 (diff)
downloadrust-7784a8d39773517da476a19562cea0ef0cd36eab.tar.gz
rust-7784a8d39773517da476a19562cea0ef0cd36eab.zip
rollup merge of #17592 : kmcallister/inline-asm-loc
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/asm-src-loc-codegen-units.rs20
-rw-r--r--src/test/compile-fail/asm-src-loc.rs17
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/compile-fail/asm-src-loc-codegen-units.rs b/src/test/compile-fail/asm-src-loc-codegen-units.rs
new file mode 100644
index 00000000000..1b8fb32a808
--- /dev/null
+++ b/src/test/compile-fail/asm-src-loc-codegen-units.rs
@@ -0,0 +1,20 @@
+// Copyright 2014 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.
+//
+// compile-flags: -C codegen-units=2
+// error-pattern: build without -C codegen-units for more exact errors
+
+#![feature(asm)]
+
+fn main() {
+    unsafe {
+        asm!("nowayisthisavalidinstruction");
+    }
+}
diff --git a/src/test/compile-fail/asm-src-loc.rs b/src/test/compile-fail/asm-src-loc.rs
new file mode 100644
index 00000000000..8da6cca77cc
--- /dev/null
+++ b/src/test/compile-fail/asm-src-loc.rs
@@ -0,0 +1,17 @@
+// Copyright 2014 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() {
+    unsafe {
+        asm!("nowayisthisavalidinstruction"); //~ ERROR invalid instruction mnemonic
+    }
+}