]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/msvc-pretty-enums.rs
Delay span bug when failing to normalize negative coherence impl subject due to other...
[rust.git] / src / test / debuginfo / msvc-pretty-enums.rs
1 // only-cdb
2 // compile-flags:-g
3
4 // cdb-command: g
5
6 // cdb-command: dx a
7 // cdb-check:a                :  Some({...}) [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
8 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
9 // cdb-check:    [variant]        :  Some
10 // cdb-check:    [+0x000] __0              : Low (0x2) [Type: msvc_pretty_enums::CStyleEnum]
11
12 // cdb-command: dx b
13 // cdb-check:b                : None [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
14 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
15 // cdb-check:    [variant]        : None
16
17 // cdb-command: dx c
18 // cdb-check:c                : Tag1 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
19 // cdb-check:    [<Raw View>]     [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
20 // cdb-check:    [variant]        : Tag1
21
22 // cdb-command: dx d
23 // cdb-check:d                :  Data({...}) [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
24 // cdb-check:    [<Raw View>]     [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
25 // cdb-check:    [variant]        :  Data
26 // cdb-check:    [+0x000] my_data          : High (0x10) [Type: msvc_pretty_enums::CStyleEnum]
27
28 // cdb-command: dx e
29 // cdb-check:e                : Tag2 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
30 // cdb-check:    [<Raw View>]     [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
31 // cdb-check:    [variant]        : Tag2
32
33 // cdb-command: dx f
34 // cdb-check:f                :  Some({...}) [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
35 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
36 // cdb-check:    [variant]        :  Some
37 // cdb-check:    [+0x000] __0              : 0x[...] : 0x1 [Type: unsigned int *]
38
39 // cdb-command: dx g
40 // cdb-check:g                : None [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
41 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
42 // cdb-check:    [variant]        : None
43
44 // cdb-command: dx h
45 // cdb-check:h                : Some [Type: enum$<core::option::Option<u32> >]
46 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<u32> >]
47 // cdb-check:    [variant]        : Some
48 // cdb-check:    [+0x004] __0              : 0xc [Type: unsigned int]
49
50 // cdb-command: dx i
51 // cdb-check:i                : None [Type: enum$<core::option::Option<u32> >]
52 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<u32> >]
53 // cdb-check:    [variant]        : None
54
55 // cdb-command: dx j
56 // cdb-check:j                : High (0x10) [Type: msvc_pretty_enums::CStyleEnum]
57
58 // cdb-command: dx k
59 // cdb-check:k                :  Some({...}) [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
60 // cdb-check:    [<Raw View>]     [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
61 // cdb-check:    [variant]        :  Some
62 // cdb-check:    [+0x000] __0              : "IAMA optional string!" [Type: alloc::string::String]
63
64 // cdb-command: dx l
65 // cdb-check:l                :  Ok [Type: enum$<core::result::Result<u32,enum$<msvc_pretty_enums::Empty> >, Ok>]
66 // cdb-check:    [<Raw View>]     [Type: enum$<core::result::Result<u32,enum$<msvc_pretty_enums::Empty> >, Ok>]
67 // cdb-check:    [variant]        :  Ok
68 // cdb-check:    [+0x000] __0              : 0x2a [Type: unsigned int]
69
70 pub enum CStyleEnum {
71     Low = 2,
72     High = 16,
73 }
74
75 pub enum NicheLayoutEnum {
76     Tag1,
77     Data { my_data: CStyleEnum },
78     Tag2,
79 }
80
81 pub enum Empty {}
82
83 fn main() {
84     let a = Some(CStyleEnum::Low);
85     let b = Option::<CStyleEnum>::None;
86     let c = NicheLayoutEnum::Tag1;
87     let d = NicheLayoutEnum::Data { my_data: CStyleEnum::High };
88     let e = NicheLayoutEnum::Tag2;
89     let f = Some(&1u32);
90     let g = Option::<&'static u32>::None;
91     let h = Some(12u32);
92     let i = Option::<u32>::None;
93     let j = CStyleEnum::High;
94     let k = Some("IAMA optional string!".to_string());
95     let l = Result::<u32, Empty>::Ok(42);
96
97     zzz(); // #break
98 }
99
100 fn zzz() {
101     ()
102 }