Skip to content

Commit

Permalink
debuginfo: Add LLDB autotests to debuginfo test suite.
Browse files Browse the repository at this point in the history
This commit adds LLDB autotests to the test suite but does not activate them by default yet.
  • Loading branch information
michaelwoerister committed Jul 16, 2014
1 parent b56ef79 commit c7f45a9
Show file tree
Hide file tree
Showing 82 changed files with 3,316 additions and 261 deletions.
41 changes: 40 additions & 1 deletion src/test/debuginfo/basic-types.rs
Expand Up @@ -17,6 +17,9 @@
// ignore-android: FIXME(#10381)

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand Down Expand Up @@ -49,6 +52,42 @@
// gdb-command:print f64
// gdb-check:$14 = 3.5


// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:print b
// lldb-check:[...]$0 = false
// lldb-command:print i
// lldb-check:[...]$1 = -1

// NOTE: LLDB does not support 32bit chars
// d ebugger:print (uint)(c)
// c heck:$3 = 97

// lldb-command:print i8
// lldb-check:[...]$2 = 'D'
// lldb-command:print i16
// lldb-check:[...]$3 = -16
// lldb-command:print i32
// lldb-check:[...]$4 = -32
// lldb-command:print i64
// lldb-check:[...]$5 = -64
// lldb-command:print u
// lldb-check:[...]$6 = 1
// lldb-command:print u8
// lldb-check:[...]$7 = 'd'
// lldb-command:print u16
// lldb-check:[...]$8 = 16
// lldb-command:print u32
// lldb-check:[...]$9 = 32
// lldb-command:print u64
// lldb-check:[...]$10 = 64
// lldb-command:print f32
// lldb-check:[...]$11 = 2.5
// lldb-command:print f64
// lldb-check:[...]$12 = 3.5

#![allow(unused_variable)]

fn main() {
Expand All @@ -66,7 +105,7 @@ fn main() {
let u64: u64 = 64;
let f32: f32 = 2.5;
let f64: f64 = 3.5;
_zzz();
_zzz(); // #break
}

fn _zzz() {()}
53 changes: 52 additions & 1 deletion src/test/debuginfo/borrowed-basic.rs
Expand Up @@ -14,6 +14,9 @@
// its numerical value.

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand Down Expand Up @@ -59,6 +62,53 @@
// gdb-command:print *f64_ref
// gdb-check:$14 = 3.5


// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:print *bool_ref
// lldb-check:[...]$0 = true

// lldb-command:print *int_ref
// lldb-check:[...]$1 = -1

// NOTE: lldb doesn't support 32bit chars at the moment
// d ebugger:print *char_ref
// c heck:[...]$x = 97

// lldb-command:print *i8_ref
// lldb-check:[...]$2 = 'D'

// lldb-command:print *i16_ref
// lldb-check:[...]$3 = -16

// lldb-command:print *i32_ref
// lldb-check:[...]$4 = -32

// lldb-command:print *i64_ref
// lldb-check:[...]$5 = -64

// lldb-command:print *uint_ref
// lldb-check:[...]$6 = 1

// lldb-command:print *u8_ref
// lldb-check:[...]$7 = 'd'

// lldb-command:print *u16_ref
// lldb-check:[...]$8 = 16

// lldb-command:print *u32_ref
// lldb-check:[...]$9 = 32

// lldb-command:print *u64_ref
// lldb-check:[...]$10 = 64

// lldb-command:print *f32_ref
// lldb-check:[...]$11 = 2.5

// lldb-command:print *f64_ref
// lldb-check:[...]$12 = 3.5

#![allow(unused_variable)]

fn main() {
Expand Down Expand Up @@ -103,7 +153,8 @@ fn main() {

let f64_val: f64 = 3.5;
let f64_ref: &f64 = &f64_val;
zzz();

zzz(); // #break
}

fn zzz() {()}
19 changes: 18 additions & 1 deletion src/test/debuginfo/borrowed-c-style-enum.rs
Expand Up @@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand All @@ -24,6 +27,20 @@
// gdb-command:print *the_c_ref
// gdb-check:$3 = TheC


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:print *the_a_ref
// lldb-check:[...]$0 = TheA

// lldb-command:print *the_b_ref
// lldb-check:[...]$1 = TheB

// lldb-command:print *the_c_ref
// lldb-check:[...]$2 = TheC

#![allow(unused_variable)]

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

zzz();
zzz(); // #break
}

fn zzz() {()}
17 changes: 16 additions & 1 deletion src/test/debuginfo/borrowed-enum.rs
Expand Up @@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand All @@ -24,6 +27,18 @@
// gdb-command:print *univariant_ref
// gdb-check:$3 = {{4820353753753434}}


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:print *the_a_ref
// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 }
// lldb-command:print *the_b_ref
// lldb-check:[...]$1 = TheB(0, 286331153, 286331153)
// lldb-command:print *univariant_ref
// lldb-check:[...]$2 = TheOnlyCase(4820353753753434)

#![allow(unused_variable)]
#![feature(struct_variant)]

Expand Down Expand Up @@ -59,7 +74,7 @@ fn main() {
let univariant = TheOnlyCase(4820353753753434);
let univariant_ref: &Univariant = &univariant;

zzz();
zzz(); // #break
}

fn zzz() {()}
56 changes: 55 additions & 1 deletion src/test/debuginfo/borrowed-managed-basic.rs
Expand Up @@ -16,6 +16,9 @@
// its numerical value.

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand Down Expand Up @@ -61,6 +64,56 @@
// gdb-command:print *f64_ref
// gdb-check:$14 = 3.5


// === LLDB TESTS ==================================================================================

// lldb-command:type format add -f decimal char
// lldb-command:type format add -f decimal 'unsigned char'
// lldb-command:run

// lldb-command:print *bool_ref
// lldb-check:[...]$0 = true

// lldb-command:print *int_ref
// lldb-check:[...]$1 = -1

// LLDB can't handle 32bit chars yet
// d ebugger:print *char_ref
// c heck:[...]$x = 97

// lldb-command:print *i8_ref
// lldb-check:[...]$2 = 68

// lldb-command:print *i16_ref
// lldb-check:[...]$3 = -16

// lldb-command:print *i32_ref
// lldb-check:[...]$4 = -32

// lldb-command:print *i64_ref
// lldb-check:[...]$5 = -64

// lldb-command:print *uint_ref
// lldb-check:[...]$6 = 1

// lldb-command:print *u8_ref
// lldb-check:[...]$7 = 100

// lldb-command:print *u16_ref
// lldb-check:[...]$8 = 16

// lldb-command:print *u32_ref
// lldb-check:[...]$9 = 32

// lldb-command:print *u64_ref
// lldb-check:[...]$10 = 64

// lldb-command:print *f32_ref
// lldb-check:[...]$11 = 2.5

// lldb-command:print *f64_ref
// lldb-check:[...]$12 = 3.5

#![allow(unused_variable)]

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

let f64_box: Gc<f64> = box(GC) 3.5;
let f64_ref: &f64 = f64_box;
zzz();

zzz(); // #break
}

fn zzz() {()}
41 changes: 39 additions & 2 deletions src/test/debuginfo/borrowed-struct.rs
Expand Up @@ -9,8 +9,10 @@
// except according to those terms.

// ignore-android: FIXME(#10381)

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand Down Expand Up @@ -45,6 +47,41 @@
// gdb-command:print *unique_val_interior_ref_2
// gdb-check:$10 = 26.5


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:print *stack_val_ref
// lldb-check:[...]$0 = SomeStruct { x: 10, y: 23.5 }

// lldb-command:print *stack_val_interior_ref_1
// lldb-check:[...]$1 = 10

// lldb-command:print *stack_val_interior_ref_2
// lldb-check:[...]$2 = 23.5

// lldb-command:print *ref_to_unnamed
// lldb-check:[...]$3 = SomeStruct { x: 11, y: 24.5 }

// lldb-command:print *managed_val_ref
// lldb-check:[...]$4 = SomeStruct { x: 12, y: 25.5 }

// lldb-command:print *managed_val_interior_ref_1
// lldb-check:[...]$5 = 12

// lldb-command:print *managed_val_interior_ref_2
// lldb-check:[...]$6 = 25.5

// lldb-command:print *unique_val_ref
// lldb-check:[...]$7 = SomeStruct { x: 13, y: 26.5 }

// lldb-command:print *unique_val_interior_ref_1
// lldb-check:[...]$8 = 13

// lldb-command:print *unique_val_interior_ref_2
// lldb-check:[...]$9 = 26.5

#![feature(managed_boxes)]
#![allow(unused_variable)]

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

zzz();
zzz(); // #break
}

fn zzz() {()}
23 changes: 22 additions & 1 deletion src/test/debuginfo/borrowed-tuple.rs
Expand Up @@ -13,6 +13,9 @@
#![feature(managed_boxes)]

// compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
Expand All @@ -29,6 +32,24 @@
// gdb-command:print *unique_val_ref
// gdb-check:$4 = {-17, -22}


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:print *stack_val_ref
// lldb-check:[...]$0 = (-14, -19)

// lldb-command:print *ref_to_unnamed
// lldb-check:[...]$1 = (-15, -20)

// lldb-command:print *managed_val_ref
// lldb-check:[...]$2 = (-16, -21)

// lldb-command:print *unique_val_ref
// lldb-check:[...]$3 = (-17, -22)


#![allow(unused_variable)]

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

zzz();
zzz(); // #break
}

fn zzz() {()}

0 comments on commit c7f45a9

Please sign in to comment.