]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/generic-struct.rs
Auto merge of #28816 - petrochenkov:unistruct, r=nrc
[rust.git] / src / test / debuginfo / generic-struct.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 // ignore-tidy-linelength
12 // min-lldb-version: 310
13
14 // compile-flags:-g
15
16 // === GDB TESTS ===================================================================================
17
18 // gdb-command:run
19
20 // gdb-command:print int_int
21 // gdb-check:$1 = {key = 0, value = 1}
22 // gdb-command:print int_float
23 // gdb-check:$2 = {key = 2, value = 3.5}
24 // gdb-command:print float_int
25 // gdb-check:$3 = {key = 4.5, value = 5}
26 // gdb-command:print float_int_float
27 // gdb-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}}
28
29 // === LLDB TESTS ==================================================================================
30
31 // lldb-command:run
32
33 // lldb-command:print int_int
34 // lldb-check:[...]$0 = AGenericStruct<i32, i32> { key: 0, value: 1 }
35 // lldb-command:print int_float
36 // lldb-check:[...]$1 = AGenericStruct<i32, f64> { key: 2, value: 3.5 }
37 // lldb-command:print float_int
38 // lldb-check:[...]$2 = AGenericStruct<f64, i32> { key: 4.5, value: 5 }
39
40 // lldb-command:print float_int_float
41 // lldb-check:[...]$3 = AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } }
42
43
44 #![feature(omit_gdb_pretty_printer_section)]
45 #![omit_gdb_pretty_printer_section]
46
47 struct AGenericStruct<TKey, TValue> {
48     key: TKey,
49     value: TValue
50 }
51
52 fn main() {
53
54     let int_int = AGenericStruct { key: 0, value: 1 };
55     let int_float = AGenericStruct { key: 2, value: 3.5f64 };
56     let float_int = AGenericStruct { key: 4.5f64, value: 5 };
57     let float_int_float = AGenericStruct {
58         key: 6.5f64,
59         value: AGenericStruct { key: 7, value: 8.5f64 },
60     };
61
62     zzz(); // #break
63 }
64
65 fn zzz() { () }