2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2013-10-23 08:49:18 +00:00
|
|
|
|
2013-04-30 19:05:06 +00:00
|
|
|
/*!
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2023-12-27 22:11:58 +00:00
|
|
|
enum List<X> { Nil, Cons(X, #[allow(dead_code)] Box<List<X>>) }
|
2013-04-30 19:05:06 +00:00
|
|
|
pub fn main() {
|
2021-08-25 00:39:40 +00:00
|
|
|
match List::Cons(10, Box::new(List::Nil)) {
|
2015-01-25 21:05:03 +00:00
|
|
|
List::Cons(10, _) => {}
|
2014-11-06 08:05:53 +00:00
|
|
|
List::Nil => {}
|
2014-10-09 19:17:22 +00:00
|
|
|
_ => panic!()
|
2013-04-30 19:05:06 +00:00
|
|
|
}
|
|
|
|
}
|