about summary refs log tree commit diff
diff options
context:
space:
mode:
authorasquared31415 <34665709+asquared31415@users.noreply.github.com>2021-03-08 23:48:08 -0500
committerasquared31415 <34665709+asquared31415@users.noreply.github.com>2021-03-08 23:48:08 -0500
commit4b13b8120e67e2b3173c8f6ce0d175847b745085 (patch)
treeb7283de8dce2c38fab30b1da3b22b9508f176ab4
parent05ae66607fe2aaab786e6444f4b674499fd79319 (diff)
downloadrust-4b13b8120e67e2b3173c8f6ce0d175847b745085.tar.gz
rust-4b13b8120e67e2b3173c8f6ce0d175847b745085.zip
Test x86 and arm outputs
-rw-r--r--src/test/ui/asm/inline-syntax.arm.stderr14
-rw-r--r--src/test/ui/asm/inline-syntax.rs29
-rw-r--r--src/test/ui/asm/inline-syntax.x86_64.stderr (renamed from src/test/ui/asm/inline-syntax.stderr)12
3 files changed, 42 insertions, 13 deletions
diff --git a/src/test/ui/asm/inline-syntax.arm.stderr b/src/test/ui/asm/inline-syntax.arm.stderr
new file mode 100644
index 00000000000..b1b61f0211a
--- /dev/null
+++ b/src/test/ui/asm/inline-syntax.arm.stderr
@@ -0,0 +1,14 @@
+error: att syntax is the default syntax on this target, and trying to use this directive may cause issues
+  --> $DIR/inline-syntax.rs:22:15
+   |
+LL |         asm!(".att_syntax noprefix", "nop");
+   |               ^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
+
+error: att syntax is the default syntax on this target, and trying to use this directive may cause issues
+  --> $DIR/inline-syntax.rs:25:15
+   |
+LL |         asm!(".att_syntax bbb noprefix", "nop");
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/asm/inline-syntax.rs b/src/test/ui/asm/inline-syntax.rs
index 31e7f2cc796..9e9c7badfca 100644
--- a/src/test/ui/asm/inline-syntax.rs
+++ b/src/test/ui/asm/inline-syntax.rs
@@ -1,23 +1,38 @@
-#![feature(asm, llvm_asm)]
+// revisions: x86_64 arm
+//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
+//[arm] compile-flags: --target armv7-unknown-linux-gnueabihf
+
+#![feature(no_core, lang_items, rustc_attrs)]
+#![no_core]
+
+#[rustc_builtin_macro]
+macro_rules! asm {
+    () => {};
+}
+
+#[lang = "sized"]
+trait Sized {}
 
 fn main() {
     unsafe {
         asm!(".intel_syntax noprefix", "nop");
-        //~^ ERROR intel syntax is the default syntax on this target
+        //[x86_64]~^ ERROR intel syntax is the default syntax on this target
         asm!(".intel_syntax aaa noprefix", "nop");
-        //~^ ERROR intel syntax is the default syntax on this target
+        //[x86_64]~^ ERROR intel syntax is the default syntax on this target
         asm!(".att_syntax noprefix", "nop");
-        //~^ ERROR using the .att_syntax directive may cause issues
+        //[x86_64]~^ ERROR using the .att_syntax directive may cause issues
+        //[arm]~^^ att syntax is the default syntax on this target
         asm!(".att_syntax bbb noprefix", "nop");
-        //~^ ERROR using the .att_syntax directive may cause issues
+        //[x86_64]~^ ERROR using the .att_syntax directive may cause issues
+        //[arm]~^^ att syntax is the default syntax on this target
         asm!(".intel_syntax noprefix; nop");
-        //~^ ERROR intel syntax is the default syntax on this target
+        //[x86_64]~^ ERROR intel syntax is the default syntax on this target
 
         asm!(
             r"
             .intel_syntax noprefix
             nop"
         );
-        //~^^^ ERROR intel syntax is the default syntax on this target
+        //[x86_64]~^^^ ERROR intel syntax is the default syntax on this target
     }
 }
diff --git a/src/test/ui/asm/inline-syntax.stderr b/src/test/ui/asm/inline-syntax.x86_64.stderr
index 241b302ad64..c54c2742a57 100644
--- a/src/test/ui/asm/inline-syntax.stderr
+++ b/src/test/ui/asm/inline-syntax.x86_64.stderr
@@ -1,17 +1,17 @@
 error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
-  --> $DIR/inline-syntax.rs:5:15
+  --> $DIR/inline-syntax.rs:18:15
    |
 LL |         asm!(".intel_syntax noprefix", "nop");
    |               ^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
 
 error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
-  --> $DIR/inline-syntax.rs:7:15
+  --> $DIR/inline-syntax.rs:20:15
    |
 LL |         asm!(".intel_syntax aaa noprefix", "nop");
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
 
 error: using the .att_syntax directive may cause issues, use the att_syntax option instead
-  --> $DIR/inline-syntax.rs:9:15
+  --> $DIR/inline-syntax.rs:22:15
    |
 LL |         asm!(".att_syntax noprefix", "nop");
    |               ^^^^^^^^^^^^^^^^^^^^
@@ -22,7 +22,7 @@ LL |         asm!("", "nop", options(att_syntax));
    |              --       ^^^^^^^^^^^^^^^^^^^^^
 
 error: using the .att_syntax directive may cause issues, use the att_syntax option instead
-  --> $DIR/inline-syntax.rs:11:15
+  --> $DIR/inline-syntax.rs:25:15
    |
 LL |         asm!(".att_syntax bbb noprefix", "nop");
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -33,13 +33,13 @@ LL |         asm!("", "nop", options(att_syntax));
    |              --       ^^^^^^^^^^^^^^^^^^^^^
 
 error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
-  --> $DIR/inline-syntax.rs:13:15
+  --> $DIR/inline-syntax.rs:28:15
    |
 LL |         asm!(".intel_syntax noprefix; nop");
    |               ^^^^^^^^^^^^^^^^^^^^^^ help: remove this assembler directive
 
 error: intel syntax is the default syntax on this target, and trying to use this directive may cause issues
-  --> $DIR/inline-syntax.rs:18:14
+  --> $DIR/inline-syntax.rs:33:14
    |
 LL |               .intel_syntax noprefix
    |  ______________^