about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/asm/unsupported-option.fixed10
-rw-r--r--tests/ui/asm/unsupported-option.rs10
-rw-r--r--tests/ui/asm/unsupported-option.stderr20
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/ui/asm/unsupported-option.fixed b/tests/ui/asm/unsupported-option.fixed
new file mode 100644
index 00000000000..c2ff13bbc55
--- /dev/null
+++ b/tests/ui/asm/unsupported-option.fixed
@@ -0,0 +1,10 @@
+//@ run-rustfix
+
+use std::arch::global_asm;
+
+fn main() {}
+
+global_asm!("", options(att_syntax,    raw));
+//~^ ERROR the `nomem` option cannot be used with `global_asm!`
+//~| ERROR the `readonly` option cannot be used with `global_asm!`
+//~| ERROR the `noreturn` option cannot be used with `global_asm!`
diff --git a/tests/ui/asm/unsupported-option.rs b/tests/ui/asm/unsupported-option.rs
new file mode 100644
index 00000000000..672aedf230c
--- /dev/null
+++ b/tests/ui/asm/unsupported-option.rs
@@ -0,0 +1,10 @@
+//@ run-rustfix
+
+use std::arch::global_asm;
+
+fn main() {}
+
+global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
+//~^ ERROR the `nomem` option cannot be used with `global_asm!`
+//~| ERROR the `readonly` option cannot be used with `global_asm!`
+//~| ERROR the `noreturn` option cannot be used with `global_asm!`
diff --git a/tests/ui/asm/unsupported-option.stderr b/tests/ui/asm/unsupported-option.stderr
new file mode 100644
index 00000000000..c040b0364d7
--- /dev/null
+++ b/tests/ui/asm/unsupported-option.stderr
@@ -0,0 +1,20 @@
+error: the `nomem` option cannot be used with `global_asm!`
+  --> $DIR/unsupported-option.rs:7:37
+   |
+LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
+   |                                     ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly
+
+error: the `readonly` option cannot be used with `global_asm!`
+  --> $DIR/unsupported-option.rs:7:44
+   |
+LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
+   |                                            ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly
+
+error: the `noreturn` option cannot be used with `global_asm!`
+  --> $DIR/unsupported-option.rs:7:54
+   |
+LL | global_asm!("", options(att_syntax, nomem, readonly, noreturn, raw));
+   |                                                      ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly
+
+error: aborting due to 3 previous errors
+