]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/generic-static-method-on-struct-and-enum.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / generic-static-method-on-struct-and-enum.rs
1 // min-lldb-version: 310
2
3 // compile-flags:-g
4
5 // gdb-command:run
6
7 // STRUCT
8 // gdb-command:print arg1
9 // gdb-check:$1 = 1
10 // gdb-command:print arg2
11 // gdb-check:$2 = 2
12 // gdb-command:continue
13
14 // ENUM
15 // gdb-command:print arg1
16 // gdb-check:$3 = -3
17 // gdb-command:print arg2
18 // gdb-check:$4 = 4.5
19 // gdb-command:print arg3
20 // gdb-check:$5 = 5
21 // gdb-command:continue
22
23
24 #![feature(omit_gdb_pretty_printer_section)]
25 #![omit_gdb_pretty_printer_section]
26
27 struct Struct {
28     x: isize
29 }
30
31 impl Struct {
32
33     fn static_method<T1, T2>(arg1: T1, arg2: T2) -> isize {
34         zzz(); // #break
35         return 0;
36     }
37 }
38
39 enum Enum {
40     Variant1 { x: isize },
41     Variant2,
42     Variant3(f64, isize, char),
43 }
44
45 impl Enum {
46
47     fn static_method<T1, T2, T3>(arg1: T1, arg2: T2, arg3: T3) -> isize {
48         zzz(); // #break
49         return 1;
50     }
51 }
52
53 fn main() {
54     Struct::static_method(1, 2);
55     Enum::static_method(-3, 4.5f64, 5);
56 }
57
58 fn zzz() {()}