diff --git a/doc/rust.md b/doc/rust.md index 136c7ee9da3..9f81b38009f 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -2393,7 +2393,7 @@ variables in the arm's block, and control enters the block. An example of an `match` expression: -~~~~ {.xfail-test} +~~~~ # fn process_pair(a: int, b: int) { } # fn process_ten() { } diff --git a/src/llvm b/src/llvm index 56dd407f4f9..2e9f0d21fe3 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 56dd407f4f97a01b8df6554c569170d2fc276fcb +Subproject commit 2e9f0d21fe321849a4759a01fc28eae82ef196d6 diff --git a/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs new file mode 100644 index 00000000000..b5cf15f3b38 --- /dev/null +++ b/src/test/run-pass/enum-nullable-simplifycfg-misopt.rs @@ -0,0 +1,24 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +/*! + * This is a regression test for a bug in LLVM, fixed in upstream r179587, + * where the switch instructions generated for destructuring enums + * represented with nullable pointers could be misoptimized in some cases. + */ + +enum List { Nil, Cons(X, @List) } +pub fn main() { + match Cons(10, @Nil) { + Cons(10, _) => {} + Nil => {} + _ => fail!() + } +}