Skip to content

Commit 2ae9916

Browse files
committedJan 13, 2025
Auto merge of #135192 - jdupak-ms:cdb-tests, r=wesleywiser
Add and improve debuginfo tests for Windows Adds new test for closures and function pointers. Improves robustness of existing tests by sorting wildcard matched outputs. try-job: i686-msvc
·
1.88.01.86.0
2 parents 7a202a9 + 75e9b19 commit 2ae9916

File tree

6 files changed

+294
-49
lines changed

6 files changed

+294
-49
lines changed
 

‎tests/debuginfo/closures.rs

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
//@ only-cdb
2+
//@ compile-flags:-g
3+
4+
// === CDB TESTS ===================================================================================
5+
// Generic functions cause ambigious breakpoints.
6+
// cdb-command:dx @$debuggerRootNamespace.Debugger.Settings.EngineInitialization.ResolveAmbiguousBreakpoints = true;
7+
// cdb-command:bp `closures.rs:57`
8+
// cdb-command:g
9+
// cdb-command:dx add_closure
10+
// cdb-check:add_closure [Type: closures::main::closure_env$0]
11+
// cdb-check: [+0x[...]] _ref__base_value : 0x[...] : 42 [Type: int *]
12+
// cdb-command:dx increment
13+
// cdb-check:increment [Type: closures::main::closure_env$1]
14+
// cdb-check: [+0x[...]] _ref__count : 0x[...] : 2 [Type: int *]
15+
// cdb-command:dx consume_closure
16+
// cdb-check:consume_closure [Type: closures::main::closure_env$2]
17+
// cdb-check: [+0x[...]] x : [...] [Type: alloc::string::String]
18+
// cdb-check: [+0x[...]] _ref__base_value : 0x[...] : 42 [Type: int *]
19+
// cdb-command:dx simple_closure
20+
// cdb-checksimple_closure [Type: closures::main::closure_env$5]
21+
// cdb-check: [+0x[...]] _ref__base_value : 0x[...] : 42 [Type: int *]
22+
// cdb-command:g
23+
// cdb-command:dx first_closure
24+
// cdb-check:first_closure [Type: closures::main::closure_env$6]
25+
// cdb-check: [+0x[...]] _ref__variable : 0x[...] : 1 [Type: int *]
26+
// cdb-check: [+0x[...]] _ref__constant : 0x[...] : 2 [Type: int *]
27+
// cdb-check: [+0x[...]] _ref__a_struct : 0x[...] [Type: closures::Struct *]
28+
// cdb-check: [+0x[...]] _ref__struct_ref : 0x[...] [Type: closures::Struct * *]
29+
// cdb-check: [+0x[...]] _ref__owned_value : 0x[...] [Type: int * *]
30+
// cdb-command:g
31+
// cdb-command:dx many_param_closure
32+
// cdb-check:many_param_closure [Type: closures::main::closure_env$7]
33+
// cdb-check: [+0x[...]] _ref__base_value : 0x[...] : 42 [Type: int *]
34+
// cdb-command:g
35+
// cdb-command:dv
36+
// cdb-command:dx generic_closure
37+
// cdb-check:generic_closure [Type: closures::generic_func::closure_env$0<i32>]
38+
// cdb-check: [+0x[...]] _ref__x : 0x[...] : 42 [Type: int *]
39+
// cdb-command:g
40+
// cdb-command:dx generic_closure
41+
// cdb-check:generic_closure [Type: closures::generic_func::closure_env$0<ref$<str$> >]
42+
// cdb-check: [+0x000] _ref__x : 0x[...] : "base_value" [Type: ref$<str$> *]
43+
// cdb-command:g
44+
// cdb-command:dx second_closure
45+
// cdb-check:second_closure [Type: closures::main::closure_env$8]
46+
// cdb-check: [+0x[...]] _ref__variable : 0x[...] : 2 [Type: int *]
47+
// cdb-check: [+0x[...]] _ref__constant : 0x[...] : 2 [Type: int *]
48+
// cdb-check: [+0x[...]] _ref__a_struct : 0x[...] [Type: closures::Struct *]
49+
// cdb-check: [+0x[...]] _ref__struct_ref : 0x[...] [Type: closures::Struct * *]
50+
// cdb-check: [+0x[...]] _ref__owned_value : 0x[...] [Type: int * *]
51+
52+
#[inline(never)]
53+
fn generic_func<Tfunc: std::fmt::Debug>(x: Tfunc) {
54+
let generic_closure = |a: i32| {
55+
println!("{:?} {}", x, a);
56+
};
57+
58+
_zzz(); // #break
59+
60+
// rustc really wants to inline this closure, so we use black_box instead of calling it
61+
std::hint::black_box(generic_closure);
62+
}
63+
64+
struct Struct {
65+
a: isize,
66+
b: f64,
67+
c: usize,
68+
}
69+
70+
fn main() {
71+
let base_value: i32 = 42;
72+
let mut count: i32 = 0;
73+
74+
let add_closure = |a: i32, b: i32| a + b + base_value;
75+
76+
add_closure(40, 2);
77+
78+
let mut increment = || {
79+
count += 1;
80+
};
81+
82+
increment(); // count: 1
83+
increment(); // count: 2
84+
85+
let x = String::from("hello");
86+
87+
// Define a closure that consumes the captured variable `x`
88+
let consume_closure = move || {
89+
drop(x);
90+
base_value + 1
91+
};
92+
93+
consume_closure();
94+
95+
let paramless_closure = || 42_i32;
96+
97+
let void_closure = |a: i32| {
98+
println!("Closure with arg: {:?}", a);
99+
};
100+
101+
let simple_closure = || {
102+
let incremented_value = base_value + 1;
103+
incremented_value
104+
};
105+
106+
let result = /*42; */ add_closure(40, 2);
107+
println!("Result: {:?}", result);
108+
void_closure(result);
109+
let result = simple_closure();
110+
println!("Result: {:?}", result);
111+
112+
let mut variable: i32 = 1;
113+
let constant: i32 = 2;
114+
115+
let a_struct = Struct { a: -3, b: 4.5, c: 5 };
116+
117+
_zzz(); // #break
118+
119+
let struct_ref = &a_struct;
120+
let owned_value: Box<i32> = Box::new(6);
121+
122+
{
123+
let mut first_closure = || {
124+
variable = constant + a_struct.a as i32 + struct_ref.a as i32 + *owned_value;
125+
};
126+
127+
_zzz(); // #break
128+
129+
first_closure();
130+
}
131+
132+
let many_param_closure =
133+
|a: i32, b: f64, c: usize, d: Struct| base_value + a + b as i32 + c as i32 + d.c as i32;
134+
135+
_zzz(); // #break
136+
137+
many_param_closure(1, 2.0, 3, Struct { a: 4, b: 5.0, c: 6 });
138+
139+
generic_func(42);
140+
generic_func("base_value");
141+
142+
{
143+
let mut second_closure = || {
144+
variable = constant + a_struct.a as i32 + struct_ref.a as i32 + *owned_value;
145+
};
146+
147+
_zzz(); // #break
148+
149+
second_closure();
150+
}
151+
}
152+
153+
fn _zzz() {
154+
()
155+
}

‎tests/debuginfo/coroutine-closure.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#![feature(async_closure)]
2+
//@ only-cdb
3+
//@ compile-flags:-g --edition=2021
4+
5+
// === CDB TESTS ==================================================================================
6+
7+
// cdb-command: g
8+
// cdb-command: dx closure
9+
// cdb-check:closure [Type: coroutine_closure::main::closure_env$0]
10+
// cdb-check: [+0x[...]] y : "" [Type: alloc::string::String]
11+
// cdb-check: [+0x[...]] x : "" [Type: alloc::string::String]
12+
#![allow(unused)]
13+
fn main() {
14+
let x = String::new();
15+
let y = String::new();
16+
let closure = async move || {
17+
drop(y);
18+
println!("{x}");
19+
};
20+
21+
_zzz(); // #break
22+
23+
std::hint::black_box(closure);
24+
}
25+
26+
#[inline(never)]
27+
fn _zzz() {
28+
()
29+
}

‎tests/debuginfo/fn_ptr.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//@ only-cdb
2+
//@ compile-flags:-g
3+
4+
// === CDB TESTS ==================================================================================
5+
6+
// cdb-command: g
7+
// cdb-command: dx basic
8+
// cdb-check: basic : [...] : a!core::ops::function::FnOnce::call_once<fn_ptr::main::closure_env$0,tuple$<i32,i32> >+0x0 [Type: int (__cdecl*)(int,int)]
9+
// cdb-check: a!core::ops::function::FnOnce::call_once<fn_ptr::main::closure_env$0,tuple$<i32,i32> >+0x0 [Type: int __cdecl(int,int)]
10+
11+
// cdb-command: dx paramless
12+
// cdb-check: paramless : [...] : a!core::ops::function::FnOnce::call_once<fn_ptr::main::closure_env$1,tuple$<> >+0x0 [Type: int (__cdecl*)()]
13+
// cdb-check: a!core::ops::function::FnOnce::call_once<fn_ptr::main::closure_env$1,tuple$<> >+0x0 [Type: int __cdecl()]
14+
15+
// cdb-command: dx my_struct
16+
// cdb-check: my_struct [Type: fn_ptr::MyStruct]
17+
// cdb-check: [+0x000] my_field : [...] : a!core::ops::function::FnOnce::call_once<fn_ptr::main::closure_env$2,tuple$<ref$<fn_ptr::MyStruct> > >+0x0 [Type: int (__cdecl*)(fn_ptr::MyStruct *)]
18+
19+
// cdb-command: dx non_rec_struct
20+
// cdb-check: non_rec_struct [Type: fn_ptr::NonRecStruct]
21+
// cdb-check: [+0x000] my_field : [...] : a!core::ops::function::FnOnce::call_once<fn_ptr::main::closure_env$3,tuple$<i32> >+0x0 [Type: int (__cdecl*)(int)]
22+
23+
type BasicFnPtr = fn(i32, i32) -> i32;
24+
25+
pub type ParamlessFnPtr = fn() -> i32;
26+
27+
type MyFnPtr = fn(b: &MyStruct) -> i32;
28+
29+
type NonRecFnPtr = fn(i: i32) -> i32;
30+
31+
struct MyStruct {
32+
my_field: MyFnPtr,
33+
}
34+
35+
struct NonRecStruct {
36+
my_field: NonRecFnPtr,
37+
}
38+
39+
fn main() {
40+
let basic: BasicFnPtr = |a, b| a + b;
41+
let paramless: ParamlessFnPtr = || 1;
42+
let my_struct = MyStruct { my_field: |_| 1 };
43+
let non_rec_struct = NonRecStruct { my_field: |i| i };
44+
45+
_zzz(); // #break
46+
}
47+
48+
#[inline(never)]
49+
fn _zzz() {
50+
()
51+
}

‎tests/debuginfo/lexical-scope-in-if-let.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,33 @@
4747

4848
// === CDB TESTS ==================================================================================
4949

50+
// Note: `/n` causes the the output to be sorted to avoid depending on the order in PDB which may
51+
// be arbitrary.
52+
5053
// cdb-command: g
51-
// cdb-command: dv
54+
// cdb-command: dv /n
5255
// cdb-check:[...]a = 0n123
5356

5457
// cdb-command: g
55-
// cdb-command: dv
58+
// cdb-command: dv /n
5659
// cdb-check:[...]a = 0n123
5760
// cdb-check:[...]x = 0n42
5861

5962
// cdb-command: g
60-
// cdb-command: dv
63+
// cdb-command: dv /n
6164
// cdb-check:[...]a = 0n123
62-
// cdb-check:[...]x = 0n42
6365
// cdb-check:[...]b = 0n456
66+
// cdb-check:[...]x = 0n42
6467
// cdb-check:[...]y = true
6568

6669
// cdb-command: g
67-
// cdb-command: dv
68-
// cdb-check:[...]z = 0n10
69-
// cdb-check:[...]c = 0n789
70+
// cdb-command: dv /n
7071
// cdb-check:[...]a = 0n123
71-
// cdb-check:[...]x = 0n42
7272
// cdb-check:[...]b = 0n456
73+
// cdb-check:[...]c = 0n789
74+
// cdb-check:[...]x = 0n42
7375
// cdb-check:[...]y = true
76+
// cdb-check:[...]z = 0n10
7477

7578
fn main() {
7679
let a = id(123);
@@ -95,6 +98,8 @@ fn main() {
9598
}
9699

97100
#[inline(never)]
98-
fn id<T>(value: T) -> T { value }
101+
fn id<T>(value: T) -> T {
102+
value
103+
}
99104

100-
fn zzz() { }
105+
fn zzz() {}

‎tests/debuginfo/step-into-match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
// gdb-check:[...]match (a, b) {
118118

119119
// gdb-command: s
120-
// gdb-check:[...](_, _) => 5
120+
// gdb-check:[...](_, _) => 5,
121121

122122
// gdb-command: s
123123
// gdb-check:[...]}
@@ -300,7 +300,7 @@
300300
// cdb-check: [...]: match (a, b) {
301301

302302
// cdb-command: t
303-
// cdb-check: [...]: (_, _) => 5
303+
// cdb-check: [...]: (_, _) => 5,
304304

305305
// cdb-command: t
306306
// cdb-check: [...]: }
@@ -378,6 +378,6 @@ fn match_tuple(a: u8, b: i8) -> u32 {
378378
(29, _) => 2,
379379
(5, 12) => 3,
380380
(_, 9) => 4,
381-
(_, _) => 5
381+
(_, _) => 5,
382382
}
383383
}

‎tests/debuginfo/type-names.rs

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
//@ compile-flags:-g
77

8-
// === GDB TESTS ===================================================================================
8+
// === GDB TESTS ==================================================================================
99

1010
// gdb-command:run
1111

@@ -17,7 +17,7 @@
1717
// gdb-check:type = type_names::GenericStruct<type_names::mod1::Struct2, type_names::mod1::mod2::Struct3>
1818

1919
// gdb-command:whatis generic_struct2
20-
// gdb-check:type = type_names::GenericStruct<type_names::Struct1, extern "system" fn(isize) -> usize>
20+
// gdb-check:type = type_names::GenericStruct<type_names::Struct1, extern "fastcall" fn(isize) -> usize>
2121

2222
// gdb-command:whatis mod_struct
2323
// gdb-check:type = type_names::mod1::Struct2
@@ -169,81 +169,85 @@
169169

170170
// === CDB TESTS ==================================================================================
171171

172+
// Note: `/n` causes the wildcard matches to be sorted to avoid depending on order in PDB which
173+
// can be arbitrary.
174+
172175
// cdb-command: g
173176

174177
// STRUCTS
175178
// 0-sized structs appear to be optimized away in some cases, so only check the structs that do
176179
// actually appear.
177-
// cdb-command:dv /t *_struct
180+
// cdb-command:dv /t /n *_struct
178181

179182
// ENUMS
180-
// cdb-command:dv /t *_enum_*
183+
// cdb-command:dv /t /n *_enum_*
184+
// cdb-check:union enum2$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > generic_enum_1 = [...]
185+
// cdb-check:union enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > generic_enum_2 = [...]
181186
// cdb-check:union enum2$<type_names::Enum1> simple_enum_1 = [...]
182187
// cdb-check:union enum2$<type_names::Enum1> simple_enum_2 = [...]
183188
// cdb-check:union enum2$<type_names::mod1::Enum2> simple_enum_3 = [...]
184-
// cdb-check:union enum2$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > generic_enum_1 = [...]
185-
// cdb-check:union enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > generic_enum_2 = [...]
186189

187190
// TUPLES
188-
// cdb-command:dv /t tuple*
191+
// cdb-command:dv /t /n tuple*
189192
// cdb-check:struct tuple$<u32,type_names::Struct1,enum2$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > > tuple1 = [...]
190193
// cdb-check:struct tuple$<tuple$<type_names::Struct1,type_names::mod1::mod2::Struct3>,enum2$<type_names::mod1::Enum2>,char> tuple2 = [...]
191194

192195
// BOX
193-
// cdb-command:dv /t box*
196+
// cdb-command:dv /t /n box*
194197
// cdb-check:struct tuple$<alloc::boxed::Box<f32,alloc::alloc::Global>,i32> box1 = [...]
195198
// cdb-check:struct tuple$<alloc::boxed::Box<enum2$<type_names::mod1::mod2::Enum3<f32> >,alloc::alloc::Global>,i32> box2 = [...]
196199

197200
// REFERENCES
198-
// cdb-command:dv /t *ref*
199-
// cdb-check:struct tuple$<ref$<type_names::Struct1>,i32> ref1 = [...]
200-
// cdb-check:struct tuple$<ref$<type_names::GenericStruct<char,type_names::Struct1> >,i32> ref2 = [...]
201+
// cdb-command:dv /t /n *ref*
201202
// cdb-check:struct tuple$<ref_mut$<type_names::Struct1>,i32> mut_ref1 = [...]
202203
// cdb-check:struct tuple$<ref_mut$<type_names::GenericStruct<enum2$<type_names::mod1::Enum2>,f64> >,i32> mut_ref2 = [...]
204+
// cdb-check:struct tuple$<ref$<type_names::Struct1>,i32> ref1 = [...]
205+
// cdb-check:struct tuple$<ref$<type_names::GenericStruct<char,type_names::Struct1> >,i32> ref2 = [...]
203206

204207
// RAW POINTERS
205-
// cdb-command:dv /t *_ptr*
206-
// cdb-check:struct tuple$<ptr_mut$<type_names::Struct1>,isize> mut_ptr1 = [...]
207-
// cdb-check:struct tuple$<ptr_mut$<isize>,isize> mut_ptr2 = [...]
208-
// cdb-check:struct tuple$<ptr_mut$<enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> mut_ptr3 = [...]
208+
// cdb-command:dv /t /n *_ptr*
209209
// cdb-check:struct tuple$<ptr_const$<type_names::Struct1>,isize> const_ptr1 = [...]
210210
// cdb-check:struct tuple$<ptr_const$<isize>,isize> const_ptr2 = [...]
211211
// cdb-check:struct tuple$<ptr_const$<enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> const_ptr3 = [...]
212+
// cdb-check:struct tuple$<ptr_mut$<type_names::Struct1>,isize> mut_ptr1 = [...]
213+
// cdb-check:struct tuple$<ptr_mut$<isize>,isize> mut_ptr2 = [...]
214+
// cdb-check:struct tuple$<ptr_mut$<enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> mut_ptr3 = [...]
212215

213216
// VECTORS
214-
// cdb-command:dv /t *vec*
217+
// cdb-command:dv /t /n *vec*
215218
// cdb-check:struct tuple$<array$<type_names::Struct1,3>,i16> fixed_size_vec1 = [...]
216219
// cdb-check:struct tuple$<array$<usize,3>,i16> fixed_size_vec2 = [...]
217220
// cdb-check:struct alloc::vec::Vec<usize,alloc::alloc::Global> vec1 = [...]
218221
// cdb-check:struct alloc::vec::Vec<enum2$<type_names::mod1::Enum2>,alloc::alloc::Global> vec2 = [...]
219-
// cdb-command:dv /t slice*
222+
// cdb-command:dv /t /n slice*
220223
// cdb-check:struct ref$<slice2$<usize> > slice1 = [...]
221224
// cdb-check:struct ref_mut$<slice2$<enum2$<type_names::mod1::Enum2> > > slice2 = [...]
222225

223226
// TRAITS
224-
// cdb-command:dv /t *_trait
227+
// cdb-command:dv /t /n *_trait
228+
229+
// cdb-check:struct alloc::boxed::Box<dyn$<type_names::Trait1>,alloc::alloc::Global> box_trait = [...]
230+
// cdb-check:struct alloc::boxed::Box<dyn$<type_names::Trait2<i32,type_names::mod1::Struct2> >,alloc::alloc::Global> generic_box_trait = [...]
225231
// cdb-check:struct ref_mut$<dyn$<type_names::Trait2<type_names::mod1::mod2::Struct3,type_names::GenericStruct<usize,isize> > > > generic_mut_ref_trait = [...]
226232
// cdb-check:struct ref$<dyn$<type_names::Trait2<type_names::Struct1,type_names::Struct1> > > generic_ref_trait = [...]
227-
// cdb-check:struct alloc::boxed::Box<dyn$<type_names::Trait2<i32,type_names::mod1::Struct2> >,alloc::alloc::Global> generic_box_trait = [...]
228-
// cdb-check:struct alloc::boxed::Box<dyn$<type_names::Trait1>,alloc::alloc::Global> box_trait = [...]
229-
// cdb-check:struct ref$<dyn$<type_names::Trait1> > ref_trait = [...]
233+
// cdb-check:struct ref$<dyn$<type_names::TraitNoGenericsButWithAssocType<assoc$<Output,isize> > > > has_associated_type_but_no_generics_trait = struct ref$<dyn$<type_names::TraitNoGenericsButWithAssocType<assoc$<Output,isize> > > >
234+
// cdb-check:struct ref$<dyn$<type_names::Trait3<u32,assoc$<AssocType,isize> >,core::marker::Send> > has_associated_type_trait = struct ref$<dyn$<type_names::Trait3<u32,assoc$<AssocType,isize> >,core::marker::Send> >
230235
// cdb-check:struct ref_mut$<dyn$<type_names::Trait1> > mut_ref_trait = [...]
231236
// cdb-check:struct alloc::boxed::Box<dyn$<core::marker::Send,core::marker::Sync>,alloc::alloc::Global> no_principal_trait = [...]
232-
// cdb-check:struct ref$<dyn$<type_names::Trait3<u32,assoc$<AssocType,isize> >,core::marker::Send> > has_associated_type_trait = struct ref$<dyn$<type_names::Trait3<u32,assoc$<AssocType,isize> >,core::marker::Send> >
233-
// cdb-check:struct ref$<dyn$<type_names::TraitNoGenericsButWithAssocType<assoc$<Output,isize> > > > has_associated_type_but_no_generics_trait = struct ref$<dyn$<type_names::TraitNoGenericsButWithAssocType<assoc$<Output,isize> > > >
237+
// cdb-check:struct ref$<dyn$<type_names::Trait1> > ref_trait = [...]
234238

235239
// BARE FUNCTIONS
236-
// cdb-command:dv /t *_fn*
237-
// cdb-check:struct tuple$<type_names::mod1::Struct2 (*)(type_names::GenericStruct<u16,u8>),usize> unsafe_fn_with_return_value = [...]
240+
// cdb-command:dv /t /n *_fn*
241+
// cdb-check:struct tuple$<void (*)(isize),usize> extern_c_fn = [...]
238242
// cdb-check:struct tuple$<type_names::Struct1 (*)(),usize> extern_c_fn_with_return_value = [...]
243+
// cdb-check:struct tuple$<void (*)(enum2$<core::option::Option<isize> >,enum2$<core::option::Option<ref$<type_names::mod1::Struct2> > >),usize> rust_fn = [...]
239244
// cdb-check:struct tuple$<usize (*)(f64),usize> rust_fn_with_return_value = [...]
240245
// cdb-check:struct tuple$<void (*)(enum2$<core::result::Result<char,f64> >),usize> unsafe_fn = [...]
241-
// cdb-check:struct tuple$<void (*)(isize),usize> extern_c_fn = [...]
242-
// cdb-check:struct tuple$<void (*)(enum2$<core::option::Option<isize> >,enum2$<core::option::Option<ref$<type_names::mod1::Struct2> > >),usize> rust_fn = [...]
243-
// cdb-command:dv /t *_function*
244-
// cdb-check:struct tuple$<isize (*)(ptr_const$<u8>, ...),usize> variadic_function = [...]
245-
// cdb-check:struct tuple$<type_names::mod1::mod2::Struct3 (*)(type_names::mod1::mod2::Struct3),usize> generic_function_struct3 = [...]
246+
// cdb-check:struct tuple$<type_names::mod1::Struct2 (*)(type_names::GenericStruct<u16,u8>),usize> unsafe_fn_with_return_value = [...]
247+
// cdb-command:dv /t /n *_function*
246248
// cdb-check:struct tuple$<isize (*)(isize),usize> generic_function_int = [...]
249+
// cdb-check:struct tuple$<type_names::mod1::mod2::Struct3 (*)(type_names::mod1::mod2::Struct3),usize> generic_function_struct3 = [...]
250+
// cdb-check:struct tuple$<isize (*)(ptr_const$<u8>, ...),usize> variadic_function = [...]
247251
// cdb-command:dx Debugger.State.Scripts.@"type-names.cdb".Contents.getFunctionDetails("rust_fn")
248252
// cdb-check:Return Type: void
249253
// cdb-check:Parameter Types: enum2$<core::option::Option<isize> >,enum2$<core::option::Option<ref$<type_names::mod1::Struct2> > >
@@ -255,24 +259,25 @@
255259
// cdb-check:Parameter Types:
256260

257261
// CLOSURES
258-
// cdb-command:dv /t closure*
259-
// cdb-check:struct tuple$<type_names::main::closure_env$1,usize> closure2 = [...]
262+
// cdb-command:dv /t /n closure*
260263
// cdb-check:struct tuple$<type_names::main::closure_env$0,usize> closure1 = [...]
264+
// cdb-check:struct tuple$<type_names::main::closure_env$1,usize> closure2 = [...]
261265

262266
// FOREIGN TYPES
263-
// cdb-command:dv /t foreign*
264-
// cdb-check:struct type_names::mod1::extern$0::ForeignType2 * foreign2 = [...]
267+
// cdb-command:dv /t /n foreign*
265268
// cdb-check:struct type_names::extern$0::ForeignType1 * foreign1 = [...]
269+
// cdb-check:struct type_names::mod1::extern$0::ForeignType2 * foreign2 = [...]
266270

267271
#![allow(unused_variables)]
268272
#![feature(omit_gdb_pretty_printer_section)]
269273
#![omit_gdb_pretty_printer_section]
270274
#![feature(extern_types)]
271275

272-
use self::Enum1::{Variant1, Variant2};
273276
use std::marker::PhantomData;
274277
use std::ptr;
275278

279+
use self::Enum1::{Variant1, Variant2};
280+
276281
pub struct Struct1;
277282
struct GenericStruct<T1, T2>(PhantomData<(T1, T2)>);
278283

@@ -372,7 +377,7 @@ fn main() {
372377
let simple_struct = Struct1;
373378
let generic_struct1: GenericStruct<mod1::Struct2, mod1::mod2::Struct3> =
374379
GenericStruct(PhantomData);
375-
let generic_struct2: GenericStruct<Struct1, extern "system" fn(isize) -> usize> =
380+
let generic_struct2: GenericStruct<Struct1, extern "fastcall" fn(isize) -> usize> =
376381
GenericStruct(PhantomData);
377382
let mod_struct = mod1::Struct2;
378383

0 commit comments

Comments
 (0)
Please sign in to comment.