1 // This test depends on a patch that was committed to upstream LLVM
2 // before 7.0, then backported to the Rust LLVM fork. It tests that
3 // optimized enum debug info accurately reflects the enum layout.
5 // ignore-tidy-linelength
7 // min-system-llvm-version 8.0
9 // compile-flags: -g -C no-prepopulate-passes
11 // CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_variant_part,{{.*}}size: 32,{{.*}}
12 // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}}
13 // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
15 #![feature(never_type)]
17 #[derive(Copy, Clone)]
19 private: std::num::NonZeroU32,
22 #[derive(Copy, Clone, PartialEq, Eq)]
23 pub struct Declaration;
25 impl TypeFamily for Declaration {
29 fn intern_base_data(_: BaseKind<Self>) {}
32 #[derive(Copy, Clone)]
35 pub trait TypeFamily: Copy + 'static {
37 type Placeholder: Copy;
39 fn intern_base_data(_: BaseKind<Self>);
42 #[derive(Copy, Clone)]
43 pub enum BaseKind<F: TypeFamily> {
45 Placeholder(F::Placeholder),
50 let x = BaseKind::Error::<Declaration>;