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.
This commit is contained in:
parent
c081ffbd1e
commit
41d06dbd28
2
src/llvm
2
src/llvm
@ -1 +1 @@
|
||||
Subproject commit 56dd407f4f97a01b8df6554c569170d2fc276fcb
|
||||
Subproject commit 2e9f0d21fe321849a4759a01fc28eae82ef196d6
|
24
src/test/run-pass/enum-nullable-simplifycfg-misopt.rs
Normal file
24
src/test/run-pass/enum-nullable-simplifycfg-misopt.rs
Normal file
@ -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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<X> { Nil, Cons(X, @List<X>) }
|
||||
pub fn main() {
|
||||
match Cons(10, @Nil) {
|
||||
Cons(10, _) => {}
|
||||
Nil => {}
|
||||
_ => fail!()
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user