summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-eval/unwind-abort.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/consts/const-eval/unwind-abort.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-eval/unwind-abort.rs b/src/test/ui/consts/const-eval/unwind-abort.rs
new file mode 100644
index 000000000..2b0e58166
--- /dev/null
+++ b/src/test/ui/consts/const-eval/unwind-abort.rs
@@ -0,0 +1,12 @@
+#![feature(c_unwind, const_extern_fn)]
+
+const extern "C" fn foo() {
+ panic!() //~ ERROR evaluation of constant value failed
+}
+
+const _: () = foo();
+// Ensure that the CTFE engine handles calls to `extern "C"` aborting gracefully
+
+fn main() {
+ let _ = foo();
+}