]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/static-method-on-struct-and-enum.rs
Rollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddle
[rust.git] / tests / debuginfo / static-method-on-struct-and-enum.rs
1 // min-lldb-version: 310
2
3 // compile-flags:-g
4
5 // === GDB TESTS ===================================================================================
6
7 // gdb-command:run
8
9 // STRUCT
10 // gdb-command:print arg1
11 // gdb-check:$1 = 1
12 // gdb-command:print arg2
13 // gdb-check:$2 = 2
14 // gdb-command:continue
15
16 // ENUM
17 // gdb-command:print arg1
18 // gdb-check:$3 = -3
19 // gdb-command:print arg2
20 // gdb-check:$4 = 4.5
21 // gdb-command:print arg3
22 // gdb-check:$5 = 5
23 // gdb-command:continue
24
25
26 // === LLDB TESTS ==================================================================================
27
28 // lldb-command:run
29
30 // STRUCT
31 // lldb-command:print arg1
32 // lldbg-check:[...]$0 = 1
33 // lldbr-check:(isize) arg1 = 1
34 // lldb-command:print arg2
35 // lldbg-check:[...]$1 = 2
36 // lldbr-check:(isize) arg2 = 2
37 // lldb-command:continue
38
39 // ENUM
40 // lldb-command:print arg1
41 // lldbg-check:[...]$2 = -3
42 // lldbr-check:(isize) arg1 = -3
43 // lldb-command:print arg2
44 // lldbg-check:[...]$3 = 4.5
45 // lldbr-check:(f64) arg2 = 4.5
46 // lldb-command:print arg3
47 // lldbg-check:[...]$4 = 5
48 // lldbr-check:(usize) arg3 = 5
49 // lldb-command:continue
50
51 #![feature(omit_gdb_pretty_printer_section)]
52 #![omit_gdb_pretty_printer_section]
53
54 struct Struct {
55     x: isize
56 }
57
58 impl Struct {
59
60     fn static_method(arg1: isize, arg2: isize) -> isize {
61         zzz(); // #break
62         arg1 + arg2
63     }
64 }
65
66 enum Enum {
67     Variant1 { x: isize },
68     Variant2,
69     Variant3(f64, isize, char),
70 }
71
72 impl Enum {
73
74     fn static_method(arg1: isize, arg2: f64, arg3: usize) -> isize {
75         zzz(); // #break
76         arg1
77     }
78 }
79
80 fn main() {
81     Struct::static_method(1, 2);
82     Enum::static_method(-3, 4.5, 5);
83 }
84
85 fn zzz() {()}