about summary refs log tree commit diff
path: root/src/test/ui/panic-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/panic-runtime')
-rw-r--r--src/test/ui/panic-runtime/auxiliary/depends.rs8
-rw-r--r--src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs6
-rw-r--r--src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs8
-rw-r--r--src/test/ui/panic-runtime/two-panic-runtimes.rs16
-rw-r--r--src/test/ui/panic-runtime/unwind-tables-panic-required.rs11
-rw-r--r--src/test/ui/panic-runtime/unwind-tables-target-required.rs11
-rw-r--r--src/test/ui/panic-runtime/want-abort-got-unwind.rs9
-rw-r--r--src/test/ui/panic-runtime/want-abort-got-unwind2.rs10
8 files changed, 79 insertions, 0 deletions
diff --git a/src/test/ui/panic-runtime/auxiliary/depends.rs b/src/test/ui/panic-runtime/auxiliary/depends.rs
new file mode 100644
index 00000000000..e9bc2f4893e
--- /dev/null
+++ b/src/test/ui/panic-runtime/auxiliary/depends.rs
@@ -0,0 +1,8 @@
+// no-prefer-dynamic
+
+#![feature(panic_runtime)]
+#![crate_type = "rlib"]
+#![panic_runtime]
+#![no_std]
+
+extern crate needs_panic_runtime;
diff --git a/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs
new file mode 100644
index 00000000000..3f030c169f6
--- /dev/null
+++ b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs
@@ -0,0 +1,6 @@
+// no-prefer-dynamic
+
+#![feature(needs_panic_runtime)]
+#![crate_type = "rlib"]
+#![needs_panic_runtime]
+#![no_std]
diff --git a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs
new file mode 100644
index 00000000000..d57f1643e98
--- /dev/null
+++ b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs
@@ -0,0 +1,8 @@
+// dont-check-compiler-stderr
+// aux-build:needs-panic-runtime.rs
+// aux-build:depends.rs
+// error-pattern:cannot depend on a crate that needs a panic runtime
+
+extern crate depends;
+
+fn main() {}
diff --git a/src/test/ui/panic-runtime/two-panic-runtimes.rs b/src/test/ui/panic-runtime/two-panic-runtimes.rs
new file mode 100644
index 00000000000..c968b5ea1e1
--- /dev/null
+++ b/src/test/ui/panic-runtime/two-panic-runtimes.rs
@@ -0,0 +1,16 @@
+// build-fail
+// dont-check-compiler-stderr
+// error-pattern:cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_unwind2
+// ignore-tidy-linelength
+// aux-build:panic-runtime-unwind.rs
+// aux-build:panic-runtime-unwind2.rs
+// aux-build:panic-runtime-lang-items.rs
+
+#![no_std]
+#![no_main]
+
+extern crate panic_runtime_unwind;
+extern crate panic_runtime_unwind2;
+extern crate panic_runtime_lang_items;
+
+fn main() {}
diff --git a/src/test/ui/panic-runtime/unwind-tables-panic-required.rs b/src/test/ui/panic-runtime/unwind-tables-panic-required.rs
new file mode 100644
index 00000000000..6393a27046b
--- /dev/null
+++ b/src/test/ui/panic-runtime/unwind-tables-panic-required.rs
@@ -0,0 +1,11 @@
+// Tests that the compiler errors if the user tries to turn off unwind tables
+// when they are required.
+//
+// dont-check-compiler-stderr
+// compile-flags: -C panic=unwind -C force-unwind-tables=no
+// ignore-tidy-linelength
+//
+// error-pattern: panic=unwind requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no`.
+
+pub fn main() {
+}
diff --git a/src/test/ui/panic-runtime/unwind-tables-target-required.rs b/src/test/ui/panic-runtime/unwind-tables-target-required.rs
new file mode 100644
index 00000000000..14c17893764
--- /dev/null
+++ b/src/test/ui/panic-runtime/unwind-tables-target-required.rs
@@ -0,0 +1,11 @@
+// Tests that the compiler errors if the user tries to turn off unwind tables
+// when they are required.
+//
+// only-x86_64-windows-msvc
+// compile-flags: -C force-unwind-tables=no
+// ignore-tidy-linelength
+//
+// error-pattern: target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no`.
+
+pub fn main() {
+}
diff --git a/src/test/ui/panic-runtime/want-abort-got-unwind.rs b/src/test/ui/panic-runtime/want-abort-got-unwind.rs
new file mode 100644
index 00000000000..e33c3bcc3f0
--- /dev/null
+++ b/src/test/ui/panic-runtime/want-abort-got-unwind.rs
@@ -0,0 +1,9 @@
+// build-fail
+// dont-check-compiler-stderr
+// error-pattern:is not compiled with this crate's panic strategy `abort`
+// aux-build:panic-runtime-unwind.rs
+// compile-flags:-C panic=abort
+
+extern crate panic_runtime_unwind;
+
+fn main() {}
diff --git a/src/test/ui/panic-runtime/want-abort-got-unwind2.rs b/src/test/ui/panic-runtime/want-abort-got-unwind2.rs
new file mode 100644
index 00000000000..438f1d85a28
--- /dev/null
+++ b/src/test/ui/panic-runtime/want-abort-got-unwind2.rs
@@ -0,0 +1,10 @@
+// build-fail
+// dont-check-compiler-stderr
+// error-pattern:is not compiled with this crate's panic strategy `abort`
+// aux-build:panic-runtime-unwind.rs
+// aux-build:wants-panic-runtime-unwind.rs
+// compile-flags:-C panic=abort
+
+extern crate wants_panic_runtime_unwind;
+
+fn main() {}