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.
11 // ignore-tidy-linelength
12 // ignore-android: FIXME(#10381)
13 // min-lldb-version: 310
17 // === GDB TESTS ===================================================================================
22 // gdb-command:print *self
23 // gdb-check:$1 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, 117901063}}
24 // gdb-command:print arg1
26 // gdb-command:print arg2
28 // gdb-command:continue
31 // gdb-command:print self
32 // gdb-check:$4 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, 117901063}}
33 // gdb-command:print arg1
35 // gdb-command:print arg2
37 // gdb-command:continue
40 // gdb-command:print *self
41 // gdb-check:$7 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
42 // gdb-command:print arg1
44 // gdb-command:print arg2
46 // gdb-command:continue
49 // gdb-command:print self
50 // gdb-check:$10 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
51 // gdb-command:print arg1
53 // gdb-command:print arg2
55 // gdb-command:continue
58 // gdb-command:print *self
59 // gdb-check:$13 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
60 // gdb-command:print arg1
62 // gdb-command:print arg2
63 // gdb-check:$15 = -10
64 // gdb-command:continue
67 // === LLDB TESTS ==================================================================================
72 // lldb-command:print *self
73 // lldb-check:[...]$0 = Variant2(117901063)
74 // lldb-command:print arg1
75 // lldb-check:[...]$1 = -1
76 // lldb-command:print arg2
77 // lldb-check:[...]$2 = -2
78 // lldb-command:continue
81 // lldb-command:print self
82 // lldb-check:[...]$3 = Variant2(117901063)
83 // lldb-command:print arg1
84 // lldb-check:[...]$4 = -3
85 // lldb-command:print arg2
86 // lldb-check:[...]$5 = -4
87 // lldb-command:continue
90 // lldb-command:print *self
91 // lldb-check:[...]$6 = Variant1 { x: 1799, y: 1799 }
92 // lldb-command:print arg1
93 // lldb-check:[...]$7 = -5
94 // lldb-command:print arg2
95 // lldb-check:[...]$8 = -6
96 // lldb-command:continue
99 // lldb-command:print self
100 // lldb-check:[...]$9 = Variant1 { x: 1799, y: 1799 }
101 // lldb-command:print arg1
102 // lldb-check:[...]$10 = -7
103 // lldb-command:print arg2
104 // lldb-check:[...]$11 = -8
105 // lldb-command:continue
108 // lldb-command:print *self
109 // lldb-check:[...]$12 = Variant1 { x: 1799, y: 1799 }
110 // lldb-command:print arg1
111 // lldb-check:[...]$13 = -9
112 // lldb-command:print arg2
113 // lldb-check:[...]$14 = -10
114 // lldb-command:continue
117 Variant1 { x: u16, y: u16 },
123 fn self_by_ref(&self, arg1: int, arg2: int) -> int {
128 fn self_by_val(self, arg1: int, arg2: int) -> int {
133 fn self_owned(self: Box<Enum>, arg1: int, arg2: int) -> int {
140 let stack = Enum::Variant2(117901063);
141 let _ = stack.self_by_ref(-1, -2);
142 let _ = stack.self_by_val(-3, -4);
144 let owned = box Enum::Variant1{ x: 1799, y: 1799 };
145 let _ = owned.self_by_ref(-5, -6);
146 let _ = owned.self_by_val(-7, -8);
147 let _ = owned.self_owned(-9, -10);
152 impl Copy for Enum {}