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