Skip to content

Commit 9329bd6

Browse files
committed
auto merge of #6136 : jld/rust/simplifycfg-unrevert, r=thestinger
Also add the clearly marked test case that should have been there all along, and un-xfail the not-so-obvious doc test that was affected.
2 parents 9d966ae + 4701716 commit 9329bd6

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

doc/rust.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,7 @@ variables in the arm's block, and control enters the block.
23932393
An example of an `match` expression:
23942394

23952395

2396-
~~~~ {.xfail-test}
2396+
~~~~
23972397
# fn process_pair(a: int, b: int) { }
23982398
# fn process_ten() { }
23992399
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
/*!
12+
* This is a regression test for a bug in LLVM, fixed in upstream r179587,
13+
* where the switch instructions generated for destructuring enums
14+
* represented with nullable pointers could be misoptimized in some cases.
15+
*/
16+
17+
enum List<X> { Nil, Cons(X, @List<X>) }
18+
pub fn main() {
19+
match Cons(10, @Nil) {
20+
Cons(10, _) => {}
21+
Nil => {}
22+
_ => fail!()
23+
}
24+
}

0 commit comments

Comments
 (0)