]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/msvc-embedded-natvis.rs
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / debuginfo / msvc-embedded-natvis.rs
1 // only-cdb
2 // compile-flags:-g
3
4 // === CDB TESTS ==================================================================================
5
6 // cdb-command: g
7
8 // cdb-command: .nvlist
9 // cdb-check:    [...].exe (embedded NatVis "[...]msvc_embedded_natvis-0.natvis")
10
11 // cdb-command: dx point_a
12 // cdb-check:point_a          : (0, 0) [Type: msvc_embedded_natvis::Point]
13 // cdb-check:    [<Raw View>]     [Type: msvc_embedded_natvis::Point]
14 // cdb-check:    [x]              : 0 [Type: int]
15 // cdb-check:    [y]              : 0 [Type: int]
16
17 // cdb-command: dx point_b
18 // cdb-check:point_b          : (5, 8) [Type: msvc_embedded_natvis::Point]
19 // cdb-check:    [<Raw View>]     [Type: msvc_embedded_natvis::Point]
20 // cdb-check:    [x]              : 5 [Type: int]
21 // cdb-check:    [y]              : 8 [Type: int]
22
23 // cdb-command: dx line
24 // cdb-check:line             : ((0, 0), (5, 8)) [Type: msvc_embedded_natvis::Line]
25 // cdb-check:    [<Raw View>]     [Type: msvc_embedded_natvis::Line]
26 // cdb-check:    [a]              : (0, 0) [Type: msvc_embedded_natvis::Point]
27 // cdb-check:    [b]              : (5, 8) [Type: msvc_embedded_natvis::Point]
28
29 #![feature(debugger_visualizer)]
30 #![debugger_visualizer(natvis_file = "msvc-embedded-natvis.natvis")]
31
32 pub struct Point {
33     x: i32,
34     y: i32,
35 }
36
37 impl Point {
38     pub fn new(x: i32, y: i32) -> Point {
39         Point { x: x, y: y }
40     }
41 }
42
43 pub struct Line {
44     a: Point,
45     b: Point,
46 }
47
48 impl Line {
49     pub fn new(a: Point, b: Point) -> Line {
50         Line { a: a, b: b }
51     }
52 }
53
54 fn main() {
55     let point_a = Point::new(0, 0);
56     let point_b = Point::new(5, 8);
57     let line = Line::new(point_a, point_b);
58
59     zzz(); // #break
60 }
61
62 fn zzz() {
63     ()
64 }