]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/borrowed-c-style-enum.rs
New upstream version 1.14.0+dfsg1
[rustc.git] / src / test / debuginfo / borrowed-c-style-enum.rs
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.
4 //
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.
10
11
12 // compile-flags:-g
13 // min-lldb-version: 310
14
15 // === GDB TESTS ===================================================================================
16
17 // gdb-command:run
18
19 // gdb-command:print *the_a_ref
20 // gdbg-check:$1 = TheA
21 // gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
22
23 // gdb-command:print *the_b_ref
24 // gdbg-check:$2 = TheB
25 // gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
26
27 // gdb-command:print *the_c_ref
28 // gdbg-check:$3 = TheC
29 // gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
30
31
32 // === LLDB TESTS ==================================================================================
33
34 // lldb-command:run
35
36 // lldb-command:print *the_a_ref
37 // lldb-check:[...]$0 = TheA
38
39 // lldb-command:print *the_b_ref
40 // lldb-check:[...]$1 = TheB
41
42 // lldb-command:print *the_c_ref
43 // lldb-check:[...]$2 = TheC
44
45 #![allow(unused_variables)]
46 #![feature(omit_gdb_pretty_printer_section)]
47 #![omit_gdb_pretty_printer_section]
48
49 enum ABC { TheA, TheB, TheC }
50
51 fn main() {
52 let the_a = ABC::TheA;
53 let the_a_ref: &ABC = &the_a;
54
55 let the_b = ABC::TheB;
56 let the_b_ref: &ABC = &the_b;
57
58 let the_c = ABC::TheC;
59 let the_c_ref: &ABC = &the_c;
60
61 zzz(); // #break
62 }
63
64 fn zzz() {()}