Skip to content

Commit c7f45a9

Browse files
debuginfo: Add LLDB autotests to debuginfo test suite.
This commit adds LLDB autotests to the test suite but does not activate them by default yet.
1 parent b56ef79 commit c7f45a9

File tree

82 files changed

+3316
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3316
-261
lines changed

src/test/debuginfo/basic-types.rs

+40-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
// ignore-android: FIXME(#10381)
1818

1919
// compile-flags:-g
20+
21+
// === GDB TESTS ===================================================================================
22+
2023
// gdb-command:rbreak zzz
2124
// gdb-command:run
2225
// gdb-command:finish
@@ -49,6 +52,42 @@
4952
// gdb-command:print f64
5053
// gdb-check:$14 = 3.5
5154

55+
56+
// === LLDB TESTS ==================================================================================
57+
58+
// lldb-command:run
59+
// lldb-command:print b
60+
// lldb-check:[...]$0 = false
61+
// lldb-command:print i
62+
// lldb-check:[...]$1 = -1
63+
64+
// NOTE: LLDB does not support 32bit chars
65+
// d ebugger:print (uint)(c)
66+
// c heck:$3 = 97
67+
68+
// lldb-command:print i8
69+
// lldb-check:[...]$2 = 'D'
70+
// lldb-command:print i16
71+
// lldb-check:[...]$3 = -16
72+
// lldb-command:print i32
73+
// lldb-check:[...]$4 = -32
74+
// lldb-command:print i64
75+
// lldb-check:[...]$5 = -64
76+
// lldb-command:print u
77+
// lldb-check:[...]$6 = 1
78+
// lldb-command:print u8
79+
// lldb-check:[...]$7 = 'd'
80+
// lldb-command:print u16
81+
// lldb-check:[...]$8 = 16
82+
// lldb-command:print u32
83+
// lldb-check:[...]$9 = 32
84+
// lldb-command:print u64
85+
// lldb-check:[...]$10 = 64
86+
// lldb-command:print f32
87+
// lldb-check:[...]$11 = 2.5
88+
// lldb-command:print f64
89+
// lldb-check:[...]$12 = 3.5
90+
5291
#![allow(unused_variable)]
5392

5493
fn main() {
@@ -66,7 +105,7 @@ fn main() {
66105
let u64: u64 = 64;
67106
let f32: f32 = 2.5;
68107
let f64: f64 = 3.5;
69-
_zzz();
108+
_zzz(); // #break
70109
}
71110

72111
fn _zzz() {()}

src/test/debuginfo/borrowed-basic.rs

+52-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
// its numerical value.
1515

1616
// compile-flags:-g
17+
18+
// === GDB TESTS ===================================================================================
19+
1720
// gdb-command:rbreak zzz
1821
// gdb-command:run
1922
// gdb-command:finish
@@ -59,6 +62,53 @@
5962
// gdb-command:print *f64_ref
6063
// gdb-check:$14 = 3.5
6164

65+
66+
// === LLDB TESTS ==================================================================================
67+
68+
// lldb-command:run
69+
// lldb-command:print *bool_ref
70+
// lldb-check:[...]$0 = true
71+
72+
// lldb-command:print *int_ref
73+
// lldb-check:[...]$1 = -1
74+
75+
// NOTE: lldb doesn't support 32bit chars at the moment
76+
// d ebugger:print *char_ref
77+
// c heck:[...]$x = 97
78+
79+
// lldb-command:print *i8_ref
80+
// lldb-check:[...]$2 = 'D'
81+
82+
// lldb-command:print *i16_ref
83+
// lldb-check:[...]$3 = -16
84+
85+
// lldb-command:print *i32_ref
86+
// lldb-check:[...]$4 = -32
87+
88+
// lldb-command:print *i64_ref
89+
// lldb-check:[...]$5 = -64
90+
91+
// lldb-command:print *uint_ref
92+
// lldb-check:[...]$6 = 1
93+
94+
// lldb-command:print *u8_ref
95+
// lldb-check:[...]$7 = 'd'
96+
97+
// lldb-command:print *u16_ref
98+
// lldb-check:[...]$8 = 16
99+
100+
// lldb-command:print *u32_ref
101+
// lldb-check:[...]$9 = 32
102+
103+
// lldb-command:print *u64_ref
104+
// lldb-check:[...]$10 = 64
105+
106+
// lldb-command:print *f32_ref
107+
// lldb-check:[...]$11 = 2.5
108+
109+
// lldb-command:print *f64_ref
110+
// lldb-check:[...]$12 = 3.5
111+
62112
#![allow(unused_variable)]
63113

64114
fn main() {
@@ -103,7 +153,8 @@ fn main() {
103153

104154
let f64_val: f64 = 3.5;
105155
let f64_ref: &f64 = &f64_val;
106-
zzz();
156+
157+
zzz(); // #break
107158
}
108159

109160
fn zzz() {()}

src/test/debuginfo/borrowed-c-style-enum.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// ignore-android: FIXME(#10381)
1212

1313
// compile-flags:-g
14+
15+
// === GDB TESTS ===================================================================================
16+
1417
// gdb-command:rbreak zzz
1518
// gdb-command:run
1619
// gdb-command:finish
@@ -24,6 +27,20 @@
2427
// gdb-command:print *the_c_ref
2528
// gdb-check:$3 = TheC
2629

30+
31+
// === LLDB TESTS ==================================================================================
32+
33+
// lldb-command:run
34+
35+
// lldb-command:print *the_a_ref
36+
// lldb-check:[...]$0 = TheA
37+
38+
// lldb-command:print *the_b_ref
39+
// lldb-check:[...]$1 = TheB
40+
41+
// lldb-command:print *the_c_ref
42+
// lldb-check:[...]$2 = TheC
43+
2744
#![allow(unused_variable)]
2845

2946
enum ABC { TheA, TheB, TheC }
@@ -38,7 +55,7 @@ fn main() {
3855
let the_c = TheC;
3956
let the_c_ref: &ABC = &the_c;
4057

41-
zzz();
58+
zzz(); // #break
4259
}
4360

4461
fn zzz() {()}

src/test/debuginfo/borrowed-enum.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// ignore-android: FIXME(#10381)
1212

1313
// compile-flags:-g
14+
15+
// === GDB TESTS ===================================================================================
16+
1417
// gdb-command:rbreak zzz
1518
// gdb-command:run
1619
// gdb-command:finish
@@ -24,6 +27,18 @@
2427
// gdb-command:print *univariant_ref
2528
// gdb-check:$3 = {{4820353753753434}}
2629

30+
31+
// === LLDB TESTS ==================================================================================
32+
33+
// lldb-command:run
34+
35+
// lldb-command:print *the_a_ref
36+
// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 }
37+
// lldb-command:print *the_b_ref
38+
// lldb-check:[...]$1 = TheB(0, 286331153, 286331153)
39+
// lldb-command:print *univariant_ref
40+
// lldb-check:[...]$2 = TheOnlyCase(4820353753753434)
41+
2742
#![allow(unused_variable)]
2843
#![feature(struct_variant)]
2944

@@ -59,7 +74,7 @@ fn main() {
5974
let univariant = TheOnlyCase(4820353753753434);
6075
let univariant_ref: &Univariant = &univariant;
6176

62-
zzz();
77+
zzz(); // #break
6378
}
6479

6580
fn zzz() {()}

src/test/debuginfo/borrowed-managed-basic.rs

+55-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
// its numerical value.
1717

1818
// compile-flags:-g
19+
20+
// === GDB TESTS ===================================================================================
21+
1922
// gdb-command:rbreak zzz
2023
// gdb-command:run
2124
// gdb-command:finish
@@ -61,6 +64,56 @@
6164
// gdb-command:print *f64_ref
6265
// gdb-check:$14 = 3.5
6366

67+
68+
// === LLDB TESTS ==================================================================================
69+
70+
// lldb-command:type format add -f decimal char
71+
// lldb-command:type format add -f decimal 'unsigned char'
72+
// lldb-command:run
73+
74+
// lldb-command:print *bool_ref
75+
// lldb-check:[...]$0 = true
76+
77+
// lldb-command:print *int_ref
78+
// lldb-check:[...]$1 = -1
79+
80+
// LLDB can't handle 32bit chars yet
81+
// d ebugger:print *char_ref
82+
// c heck:[...]$x = 97
83+
84+
// lldb-command:print *i8_ref
85+
// lldb-check:[...]$2 = 68
86+
87+
// lldb-command:print *i16_ref
88+
// lldb-check:[...]$3 = -16
89+
90+
// lldb-command:print *i32_ref
91+
// lldb-check:[...]$4 = -32
92+
93+
// lldb-command:print *i64_ref
94+
// lldb-check:[...]$5 = -64
95+
96+
// lldb-command:print *uint_ref
97+
// lldb-check:[...]$6 = 1
98+
99+
// lldb-command:print *u8_ref
100+
// lldb-check:[...]$7 = 100
101+
102+
// lldb-command:print *u16_ref
103+
// lldb-check:[...]$8 = 16
104+
105+
// lldb-command:print *u32_ref
106+
// lldb-check:[...]$9 = 32
107+
108+
// lldb-command:print *u64_ref
109+
// lldb-check:[...]$10 = 64
110+
111+
// lldb-command:print *f32_ref
112+
// lldb-check:[...]$11 = 2.5
113+
114+
// lldb-command:print *f64_ref
115+
// lldb-check:[...]$12 = 3.5
116+
64117
#![allow(unused_variable)]
65118

66119
use std::gc::{Gc, GC};
@@ -107,7 +160,8 @@ fn main() {
107160

108161
let f64_box: Gc<f64> = box(GC) 3.5;
109162
let f64_ref: &f64 = f64_box;
110-
zzz();
163+
164+
zzz(); // #break
111165
}
112166

113167
fn zzz() {()}

src/test/debuginfo/borrowed-struct.rs

+39-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
// except according to those terms.
1010

1111
// ignore-android: FIXME(#10381)
12-
1312
// compile-flags:-g
13+
14+
// === GDB TESTS ===================================================================================
15+
1416
// gdb-command:rbreak zzz
1517
// gdb-command:run
1618
// gdb-command:finish
@@ -45,6 +47,41 @@
4547
// gdb-command:print *unique_val_interior_ref_2
4648
// gdb-check:$10 = 26.5
4749

50+
51+
// === LLDB TESTS ==================================================================================
52+
53+
// lldb-command:run
54+
55+
// lldb-command:print *stack_val_ref
56+
// lldb-check:[...]$0 = SomeStruct { x: 10, y: 23.5 }
57+
58+
// lldb-command:print *stack_val_interior_ref_1
59+
// lldb-check:[...]$1 = 10
60+
61+
// lldb-command:print *stack_val_interior_ref_2
62+
// lldb-check:[...]$2 = 23.5
63+
64+
// lldb-command:print *ref_to_unnamed
65+
// lldb-check:[...]$3 = SomeStruct { x: 11, y: 24.5 }
66+
67+
// lldb-command:print *managed_val_ref
68+
// lldb-check:[...]$4 = SomeStruct { x: 12, y: 25.5 }
69+
70+
// lldb-command:print *managed_val_interior_ref_1
71+
// lldb-check:[...]$5 = 12
72+
73+
// lldb-command:print *managed_val_interior_ref_2
74+
// lldb-check:[...]$6 = 25.5
75+
76+
// lldb-command:print *unique_val_ref
77+
// lldb-check:[...]$7 = SomeStruct { x: 13, y: 26.5 }
78+
79+
// lldb-command:print *unique_val_interior_ref_1
80+
// lldb-check:[...]$8 = 13
81+
82+
// lldb-command:print *unique_val_interior_ref_2
83+
// lldb-check:[...]$9 = 26.5
84+
4885
#![feature(managed_boxes)]
4986
#![allow(unused_variable)]
5087

@@ -72,7 +109,7 @@ fn main() {
72109
let unique_val_interior_ref_1: &int = &unique_val.x;
73110
let unique_val_interior_ref_2: &f64 = &unique_val.y;
74111

75-
zzz();
112+
zzz(); // #break
76113
}
77114

78115
fn zzz() {()}

src/test/debuginfo/borrowed-tuple.rs

+22-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#![feature(managed_boxes)]
1414

1515
// compile-flags:-g
16+
17+
// === GDB TESTS ===================================================================================
18+
1619
// gdb-command:rbreak zzz
1720
// gdb-command:run
1821
// gdb-command:finish
@@ -29,6 +32,24 @@
2932
// gdb-command:print *unique_val_ref
3033
// gdb-check:$4 = {-17, -22}
3134

35+
36+
// === LLDB TESTS ==================================================================================
37+
38+
// lldb-command:run
39+
40+
// lldb-command:print *stack_val_ref
41+
// lldb-check:[...]$0 = (-14, -19)
42+
43+
// lldb-command:print *ref_to_unnamed
44+
// lldb-check:[...]$1 = (-15, -20)
45+
46+
// lldb-command:print *managed_val_ref
47+
// lldb-check:[...]$2 = (-16, -21)
48+
49+
// lldb-command:print *unique_val_ref
50+
// lldb-check:[...]$3 = (-17, -22)
51+
52+
3253
#![allow(unused_variable)]
3354

3455
use std::gc::{Gc, GC};
@@ -44,7 +65,7 @@ fn main() {
4465
let unique_val: Box<(i16, f32)> = box() (-17, -22f32);
4566
let unique_val_ref: &(i16, f32) = unique_val;
4667

47-
zzz();
68+
zzz(); // #break
4869
}
4970

5071
fn zzz() {()}

0 commit comments

Comments
 (0)