rust/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
470 B
Rust
Raw Normal View History

// run-pass
2013-10-23 03:49:18 -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>>) }
pub fn main() {
match List::Cons(10, Box::new(List::Nil)) {
2015-01-25 15:05:03 -06:00
List::Cons(10, _) => {}
List::Nil => {}
_ => panic!()
}
}