Skip to content

Commit 7790af4

Browse files
committed
Add test to show issue with ScalarPair parameters
1 parent 3d69b5b commit 7790af4

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// only-cdb
2+
// compile-flags: -g
3+
4+
// cdb-command: g
5+
6+
// cdb-command: dx r1
7+
// cdb-check:r1 : (0xa..0xc) [Type: core::ops::range::Range<u32>]
8+
// cdb-command: dx r2
9+
// cdb-check:r2 : 0x14 [Type: core::ops::range::Range<u64> *]
10+
11+
// cdb-command: g
12+
13+
// cdb-command: dx r1
14+
// cdb-check:r1 : (0x9..0x64) [Type: core::ops::range::Range<u32>]
15+
// cdb-command: dx r2
16+
// cdb-check:r2 : 0xc [Type: core::ops::range::Range<u64> *]
17+
18+
// cdb-command: g
19+
20+
// cdb-command: dx o1
21+
// cdb-check:o1 : Some [Type: enum$<core::option::Option<u32> >]
22+
// cdb-check: [variant] : Some
23+
// cdb-check: [+0x004] __0 : 0x4d2 [Type: [...]]
24+
// cdb-command: dx o2
25+
// cdb-check:o2 : 0x1 [Type: enum$<core::option::Option<u64> > *]
26+
// cdb-check: [variant]
27+
28+
// cdb-command: g
29+
30+
// cdb-command: dx t1
31+
// cdb-check:t1 : (0xa, 0x14) [Type: tuple$<u32,u32>]
32+
// cdb-check: [0] : 0xa [Type: unsigned int]
33+
// cdb-check: [1] : 0x14 [Type: unsigned int]
34+
// cdb-command: dx t2
35+
// cdb-check:t2 : 0x1e [Type: tuple$<u64,u64> *]
36+
// cdb-check: [0] : Unable to read memory at Address 0x1e
37+
// cdb-check: [1] : Unable to read memory at Address 0x26
38+
39+
// cdb-command: g
40+
41+
// cdb-command: dx s
42+
// cdb-check:s : "this is a static str" [Type: str]
43+
// cdb-check: [len] : 0x14 [Type: unsigned __int64]
44+
// cdb-check: [chars]
45+
46+
// cdb-command: g
47+
48+
// cdb-command: dx s
49+
// cdb-check:s : { len=0x5 } [Type: slice$<u8>]
50+
// cdb-check: [len] : 0x5 [Type: unsigned __int64]
51+
// cdb-check: [0] : 0x1 [Type: unsigned char]
52+
// cdb-check: [1] : 0x2 [Type: unsigned char]
53+
// cdb-check: [2] : 0x3 [Type: unsigned char]
54+
// cdb-check: [3] : 0x4 [Type: unsigned char]
55+
// cdb-check: [4] : 0x5 [Type: unsigned char]
56+
57+
use std::ops::Range;
58+
59+
fn range(r1: Range<u32>, r2: Range<u64>) {
60+
zzz(); // #break
61+
}
62+
63+
fn range_mut(mut r1: Range<u32>, mut r2: Range<u64>) {
64+
if r1.start == 9 {
65+
r1.end = 100;
66+
}
67+
68+
if r2.start == 12 {
69+
r2.end = 90;
70+
}
71+
72+
zzz(); // #break
73+
}
74+
75+
fn option(o1: Option<u32>, o2: Option<u64>) {
76+
zzz(); // #break
77+
}
78+
79+
fn tuple(t1: (u32, u32), t2: (u64, u64)) {
80+
zzz(); // #break
81+
}
82+
83+
fn str(s: &str) {
84+
zzz(); // #break
85+
}
86+
87+
fn slice(s: &[u8]) {
88+
zzz(); // #break
89+
}
90+
91+
fn zzz() { }
92+
93+
fn main() {
94+
range(10..12, 20..30);
95+
range_mut(9..20, 12..80);
96+
option(Some(1234), Some(5678));
97+
tuple((10, 20), (30, 40));
98+
str("this is a static str");
99+
slice(&[1, 2, 3, 4, 5]);
100+
}

0 commit comments

Comments
 (0)