]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/static-method-on-struct-and-enum.rs
Imported Upstream version 1.0.0-alpha.2
[rustc.git] / src / test / debuginfo / static-method-on-struct-and-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 // min-lldb-version: 310
12
13 // compile-flags:-g
14
15 // === GDB TESTS ===================================================================================
16
17 // gdb-command:run
18
19 // STRUCT
20 // gdb-command:print arg1
21 // gdb-check:$1 = 1
22 // gdb-command:print arg2
23 // gdb-check:$2 = 2
24 // gdb-command:continue
25
26 // ENUM
27 // gdb-command:print arg1
28 // gdb-check:$3 = -3
29 // gdb-command:print arg2
30 // gdb-check:$4 = 4.5
31 // gdb-command:print arg3
32 // gdb-check:$5 = 5
33 // gdb-command:continue
34
35
36 // === LLDB TESTS ==================================================================================
37
38 // lldb-command:run
39
40 // STRUCT
41 // lldb-command:print arg1
42 // lldb-check:[...]$0 = 1
43 // lldb-command:print arg2
44 // lldb-check:[...]$1 = 2
45 // lldb-command:continue
46
47 // ENUM
48 // lldb-command:print arg1
49 // lldb-check:[...]$2 = -3
50 // lldb-command:print arg2
51 // lldb-check:[...]$3 = 4.5
52 // lldb-command:print arg3
53 // lldb-check:[...]$4 = 5
54 // lldb-command:continue
55
56 #![omit_gdb_pretty_printer_section]
57
58 struct Struct {
59 x: int
60 }
61
62 impl Struct {
63
64 fn static_method(arg1: int, arg2: int) -> int {
65 zzz(); // #break
66 arg1 + arg2
67 }
68 }
69
70 enum Enum {
71 Variant1 { x: int },
72 Variant2,
73 Variant3(f64, int, char),
74 }
75
76 impl Enum {
77
78 fn static_method(arg1: int, arg2: f64, arg3: uint) -> int {
79 zzz(); // #break
80 arg1
81 }
82 }
83
84 fn main() {
85 Struct::static_method(1, 2);
86 Enum::static_method(-3, 4.5, 5);
87 }
88
89 fn zzz() {()}