1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 // min-lldb-version: 310
16 // === GDB TESTS ===================================================================================
18 // gdb-command:print 'c_style_enum::SINGLE_VARIANT'
19 // gdb-check:$1 = TheOnlyVariant
21 // gdb-command:print 'c_style_enum::AUTO_ONE'
24 // gdb-command:print 'c_style_enum::AUTO_TWO'
27 // gdb-command:print 'c_style_enum::AUTO_THREE'
30 // gdb-command:print 'c_style_enum::MANUAL_ONE'
31 // gdb-check:$5 = OneHundred
33 // gdb-command:print 'c_style_enum::MANUAL_TWO'
34 // gdb-check:$6 = OneHundred
36 // gdb-command:print 'c_style_enum::MANUAL_THREE'
37 // gdb-check:$7 = OneHundred
41 // gdb-command:print auto_one
44 // gdb-command:print auto_two
47 // gdb-command:print auto_three
48 // gdb-check:$10 = Three
50 // gdb-command:print manual_one_hundred
51 // gdb-check:$11 = OneHundred
53 // gdb-command:print manual_one_thousand
54 // gdb-check:$12 = OneThousand
56 // gdb-command:print manual_one_million
57 // gdb-check:$13 = OneMillion
59 // gdb-command:print single_variant
60 // gdb-check:$14 = TheOnlyVariant
62 // gdb-command:print 'c_style_enum::AUTO_TWO'
63 // gdb-check:$15 = Two
65 // gdb-command:print 'c_style_enum::AUTO_THREE'
66 // gdb-check:$16 = Three
68 // gdb-command:print 'c_style_enum::MANUAL_TWO'
69 // gdb-check:$17 = OneThousand
71 // gdb-command:print 'c_style_enum::MANUAL_THREE'
72 // gdb-check:$18 = OneMillion
75 // === LLDB TESTS ==================================================================================
79 // lldb-command:print auto_one
80 // lldb-check:[...]$0 = One
82 // lldb-command:print auto_two
83 // lldb-check:[...]$1 = Two
85 // lldb-command:print auto_three
86 // lldb-check:[...]$2 = Three
88 // lldb-command:print manual_one_hundred
89 // lldb-check:[...]$3 = OneHundred
91 // lldb-command:print manual_one_thousand
92 // lldb-check:[...]$4 = OneThousand
94 // lldb-command:print manual_one_million
95 // lldb-check:[...]$5 = OneMillion
97 // lldb-command:print single_variant
98 // lldb-check:[...]$6 = TheOnlyVariant
100 #![allow(unused_variables)]
102 #![feature(omit_gdb_pretty_printer_section)]
103 #![omit_gdb_pretty_printer_section]
105 use self::AutoDiscriminant::{One, Two, Three};
106 use self::ManualDiscriminant::{OneHundred, OneThousand, OneMillion};
107 use self::SingleVariant::TheOnlyVariant;
109 #[derive(Copy, Clone)]
110 enum AutoDiscriminant {
116 #[derive(Copy, Clone)]
117 enum ManualDiscriminant {
123 #[derive(Copy, Clone)]
128 static SINGLE_VARIANT: SingleVariant = TheOnlyVariant;
130 static mut AUTO_ONE: AutoDiscriminant = One;
131 static mut AUTO_TWO: AutoDiscriminant = One;
132 static mut AUTO_THREE: AutoDiscriminant = One;
134 static mut MANUAL_ONE: ManualDiscriminant = OneHundred;
135 static mut MANUAL_TWO: ManualDiscriminant = OneHundred;
136 static mut MANUAL_THREE: ManualDiscriminant = OneHundred;
142 let auto_three = Three;
144 let manual_one_hundred = OneHundred;
145 let manual_one_thousand = OneThousand;
146 let manual_one_million = OneMillion;
148 let single_variant = TheOnlyVariant;
154 MANUAL_TWO = OneThousand;
155 MANUAL_THREE = OneMillion;
160 let a = SINGLE_VARIANT;
161 let a = unsafe { AUTO_ONE };
162 let a = unsafe { MANUAL_ONE };