From 41d06dbd28a9c26ecf114c020c6d855252fe323c Mon Sep 17 00:00:00 2001 From: Jed Davis Date: Tue, 30 Apr 2013 12:05:06 -0700 Subject: [PATCH 1/2] Reverse accidental src/llvm reversion in 876483dcf, and add test. The test is reduced from a doc test, but making it separate ensures that (1) unrelated changes to the docs won't leave this case uncovered, and (2) the nature of any future failures will be more obvious to whoever sees the tree on fire as a result. --- src/llvm | 2 +- .../enum-nullable-simplifycfg-misopt.rs | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/test/run-pass/enum-nullable-simplifycfg-misopt.rs diff --git a/src/llvm b/src/llvm index 56dd407f4f97a..2e9f0d21fe321 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 0000000000000..b5cf15f3b3863 --- /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!() + } +} From 4701716b56a22e209223110ce7d4aa9be45839da Mon Sep 17 00:00:00 2001 From: Jed Davis Date: Tue, 30 Apr 2013 12:07:10 -0700 Subject: [PATCH 2/2] Revert "doc: XFAIL mysterious failure on bots" This reverts commit 2c6dae081b72d33a2c51b5f46436e6350bb3682f. --- doc/rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/rust.md b/doc/rust.md index 136c7ee9da3f2..9f81b38009fe8 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() { }