]> git.proxmox.com Git - rustc.git/blame - src/test/debuginfo/generic-struct.rs
Imported Upstream version 1.0.0~0alpha
[rustc.git] / src / test / debuginfo / generic-struct.rs
CommitLineData
1a4d82fc
JJ
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// ignore-android: FIXME(#10381)
13// min-lldb-version: 310
14
15// compile-flags:-g
16
17// === GDB TESTS ===================================================================================
18
19// gdb-command:run
20
21// gdb-command:print int_int
22// gdb-check:$1 = {key = 0, value = 1}
23// gdb-command:print int_float
24// gdb-check:$2 = {key = 2, value = 3.5}
25// gdb-command:print float_int
26// gdb-check:$3 = {key = 4.5, value = 5}
27// gdb-command:print float_int_float
28// gdb-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}}
29
30// === LLDB TESTS ==================================================================================
31
32// lldb-command:run
33
34// lldb-command:print int_int
35// lldb-check:[...]$0 = AGenericStruct<isize, isize> { key: 0, value: 1 }
36// lldb-command:print int_float
37// lldb-check:[...]$1 = AGenericStruct<isize, f64> { key: 2, value: 3.5 }
38// lldb-command:print float_int
39// lldb-check:[...]$2 = AGenericStruct<f64, isize> { key: 4.5, value: 5 }
40
41// lldb-command:print float_int_float
42// lldb-check:[...]$3 = AGenericStruct<f64, generic-struct::AGenericStruct<isize, f64>> { key: 6.5, value: AGenericStruct<isize, f64> { key: 7, value: 8.5 } }
43
44
45#![omit_gdb_pretty_printer_section]
46
47struct AGenericStruct<TKey, TValue> {
48 key: TKey,
49 value: TValue
50}
51
52fn main() {
53
54 let int_int = AGenericStruct { key: 0i, value: 1i };
55 let int_float = AGenericStruct { key: 2i, value: 3.5f64 };
56 let float_int = AGenericStruct { key: 4.5f64, value: 5i };
57 let float_int_float = AGenericStruct {
58 key: 6.5f64,
59 value: AGenericStruct { key: 7i, value: 8.5f64 },
60 };
61
62 zzz(); // #break
63}
64
65fn zzz() { () }