about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/target_modifiers/auxiliary/fixed_x18.rs7
-rw-r--r--tests/ui/target_modifiers/incompatible_fixedx18.error_generated.stderr13
-rw-r--r--tests/ui/target_modifiers/incompatible_fixedx18.rs17
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/target_modifiers/auxiliary/fixed_x18.rs b/tests/ui/target_modifiers/auxiliary/fixed_x18.rs
new file mode 100644
index 00000000000..32eff76ec54
--- /dev/null
+++ b/tests/ui/target_modifiers/auxiliary/fixed_x18.rs
@@ -0,0 +1,7 @@
+//@ no-prefer-dynamic
+//@ compile-flags: --target aarch64-unknown-none -Zfixed-x18
+//@ needs-llvm-components: aarch64
+
+#![feature(no_core)]
+#![crate_type = "rlib"]
+#![no_core]
diff --git a/tests/ui/target_modifiers/incompatible_fixedx18.error_generated.stderr b/tests/ui/target_modifiers/incompatible_fixedx18.error_generated.stderr
new file mode 100644
index 00000000000..096d7cb5f25
--- /dev/null
+++ b/tests/ui/target_modifiers/incompatible_fixedx18.error_generated.stderr
@@ -0,0 +1,13 @@
+error: mixing `-Zfixed-x18` will cause an ABI mismatch in crate `incompatible_fixedx18`
+  --> $DIR/incompatible_fixedx18.rs:12:1
+   |
+LL | #![feature(no_core)]
+   | ^
+   |
+   = help: the `-Zfixed-x18` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
+   = note: unset `-Zfixed-x18` in this crate is incompatible with `-Zfixed-x18=` in dependency `fixed_x18`
+   = help: set `-Zfixed-x18=` in this crate or unset `-Zfixed-x18` in `fixed_x18`
+   = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=fixed-x18` to silence this error
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/target_modifiers/incompatible_fixedx18.rs b/tests/ui/target_modifiers/incompatible_fixedx18.rs
new file mode 100644
index 00000000000..6c13984f608
--- /dev/null
+++ b/tests/ui/target_modifiers/incompatible_fixedx18.rs
@@ -0,0 +1,17 @@
+//@ aux-build:fixed_x18.rs
+//@ compile-flags: --target aarch64-unknown-none
+//@ needs-llvm-components: aarch64
+
+//@ revisions:allow_match allow_mismatch error_generated
+//@[allow_match] compile-flags: -Zfixed-x18
+//@[allow_mismatch] compile-flags: -Cunsafe-allow-abi-mismatch=fixed-x18
+//@[error_generated] compile-flags:
+//@[allow_mismatch] check-pass
+//@[allow_match] check-pass
+
+#![feature(no_core)]
+//[error_generated]~^ ERROR mixing `-Zfixed-x18` will cause an ABI mismatch in crate `incompatible_fixedx18`
+#![crate_type = "rlib"]
+#![no_core]
+
+extern crate fixed_x18;