about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-12-02 14:50:00 -0800
committerGraydon Hoare <graydon@mozilla.com>2010-12-02 14:50:00 -0800
commitde9fc72cb458c28505b2e9c1d4a2bc6d3a4b0986 (patch)
treeb90e02b642d85fbbe5f743fc61e1e98bd28c0224 /src
parentb79de6b76cbdcb8f2a8e44433d262c3389f28058 (diff)
downloadrust-de9fc72cb458c28505b2e9c1d4a2bc6d3a4b0986.tar.gz
rust-de9fc72cb458c28505b2e9c1d4a2bc6d3a4b0986.zip
Add test for non-exhaustive match failure.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile1
-rw-r--r--src/test/run-fail/non-exhaustive-match.rs15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
index f41ea356943..c49e7b329e5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -497,6 +497,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
                       explicit-fail.rs \
                       fail.rs \
                       linked-failure.rs \
+                      non-exhaustive-match.rs \
                       pred.rs \
                       str-overrun.rs \
                       vec-overrun.rs \
diff --git a/src/test/run-fail/non-exhaustive-match.rs b/src/test/run-fail/non-exhaustive-match.rs
new file mode 100644
index 00000000000..eb533ef3077
--- /dev/null
+++ b/src/test/run-fail/non-exhaustive-match.rs
@@ -0,0 +1,15 @@
+// -*- rust -*-
+
+// error-pattern:non-exhaustive match failure
+
+tag t {
+  a;
+  b;
+}
+
+fn main() {
+  auto x = a;
+  alt (x) {
+    case (b) { }
+  }
+}