Skip to content

Commit 36aa04b

Browse files
debuginfo: Added test cases for tuples.
1 parent 7bb189e commit 36aa04b

File tree

3 files changed

+101
-26
lines changed

3 files changed

+101
-26
lines changed

src/test/debug-info/simple-tuple.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// compile-flags:-Z extra-debug-info
14+
// debugger:set print pretty off
15+
// debugger:break zzz
16+
// debugger:run
17+
// debugger:finish
18+
19+
// debugger:print noPadding8
20+
// check:$1 = {-100 '\234', 100 'd'}
21+
// debugger:print noPadding16
22+
// check:$2 = {0, 1, 2}
23+
// debugger:print noPadding32
24+
// check:$3 = {3, 4.5, 5}
25+
// debugger:print noPadding64
26+
// check:$4 = {6, 7.5, 8}
27+
28+
// debugger:print internalPadding1
29+
// check:$5 = {9, 10}
30+
// debugger:print internalPadding2
31+
// check:$6 = {11, 12, 13, 14}
32+
33+
// debugger:print paddingAtEnd
34+
// check:$7 = {15, 16}
35+
36+
37+
fn main() {
38+
let noPadding8 : (i8, u8) = (-100, 100);
39+
let noPadding16 : (i16, i16, u16) = (0, 1, 2);
40+
let noPadding32 : (i32, f32, u32) = (3, 4.5, 5);
41+
let noPadding64 : (i64, f64, u64) = (6, 7.5, 8);
42+
43+
let internalPadding1 : (i16, i32) = (9, 10);
44+
let internalPadding2 : (i16, i32, u32, u64) = (11, 12, 13, 14);
45+
46+
let paddingAtEnd : (i32, i16) = (15, 16);
47+
48+
zzz();
49+
}
50+
51+
fn zzz() {()}

src/test/debug-info/tuple-in-tuple.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// compile-flags:-Z extra-debug-info
14+
// debugger:set print pretty off
15+
// debugger:break zzz
16+
// debugger:run
17+
// debugger:finish
18+
19+
// debugger:print noPadding1
20+
// check:$1 = {{0, 1}, 2, 3}
21+
// debugger:print noPadding2
22+
// check:$2 = {4, {5, 6}, 7}
23+
// debugger:print noPadding3
24+
// check:$3 = {8, 9, {10, 11}}
25+
26+
// debugger:print internalPadding1
27+
// check:$4 = {12, {13, 14}}
28+
// debugger:print internalPadding2
29+
// check:$5 = {15, {16, 17}}
30+
31+
// debugger:print paddingAtEnd1
32+
// check:$6 = {18, {19, 20}}
33+
// debugger:print paddingAtEnd2
34+
// check:$7 = {{21, 22}, 23}
35+
36+
fn main() {
37+
let noPadding1 : ((u32, u32), u32, u32) = ((0, 1), 2, 3);
38+
let noPadding2 : (u32, (u32, u32), u32) = (4, (5, 6), 7);
39+
let noPadding3 : (u32, u32, (u32, u32)) = (8, 9, (10, 11));
40+
41+
let internalPadding1 : (i16, (i32, i32)) = (12, (13, 14));
42+
let internalPadding2 : (i16, (i16, i32)) = (15, (16, 17));
43+
44+
let paddingAtEnd1 : (i32, (i32, i16)) = (18, (19, 20));
45+
let paddingAtEnd2 : ((i32, i16), i32) = ((21, 22), 23);
46+
47+
zzz();
48+
}
49+
50+
fn zzz() {()}

src/test/debug-info/tuple.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)