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