This commit adds LLDB autotests to the test suite but does not activate them by default yet.
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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() {
let u64: u64 = 64;
let f32: f32 = 2.5;
let f64: f64 = 3.5;
- _zzz();
+ _zzz(); // #break
}
fn _zzz() {()}
// its numerical value.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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() {
let f64_val: f64 = 3.5;
let f64_ref: &f64 = &f64_val;
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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 }
let the_c = TheC;
let the_c_ref: &ABC = &the_c;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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)]
let univariant = TheOnlyCase(4820353753753434);
let univariant_ref: &Univariant = &univariant;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// its numerical value.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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};
let f64_box: Gc<f64> = box(GC) 3.5;
let f64_ref: &f64 = f64_box;
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
// except according to those terms.
// ignore-android: FIXME(#10381)
-
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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)]
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() {()}
#![feature(managed_boxes)]
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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};
let unique_val: Box<(i16, f32)> = box() (-17, -22f32);
let unique_val_ref: &(i16, f32) = unique_val;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// its numerical value.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// 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
+
+// d ebugger:print *char_ref
+// c heck:[...]$3 = 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)]
let f64_box: Box<f64> = box 3.5;
let f64_ref: &f64 = f64_box;
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print d->val
// gdb-check:$4 = false
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print *a
+// lldb-check:[...]$0 = 1
+// lldb-command:print *b
+// lldb-check:[...]$1 = (2, 3.5)
+// lldb-command:print c->val
+// lldb-check:[...]$2 = 4
+// lldb-command:print d->val
+// lldb-check:[...]$3 = false
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
let b = box() (2i, 3.5f64);
let c = box(GC) 4i;
let d = box(GC) false;
- _zzz();
+
+ zzz(); // #break
}
-fn _zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print managed_dtor->val
// gdb-check:$4 = {x = 33, y = 333, z = 3333, w = 33333}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *unique
+// lldb-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 }
+
+// lldb-command:print managed->val
+// lldb-check:[...]$1 = StructWithSomePadding { x: 88, y: 888, z: 8888, w: 88888 }
+
+// lldb-command:print *unique_dtor
+// lldb-check:[...]$2 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }
+
+// lldb-command:print managed_dtor->val
+// lldb-check:[...]$3 = StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 }
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
let unique_dtor = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 };
let managed_dtor = box(GC) StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 };
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$7 = {{Case1, x = 0, y = 8970181431921507452}, {Case1, 0, 2088533116, 2088533116}}
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print s
+// lldb-check:[...]$0 = Struct { a: 1, b: 2.5 }
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = Struct { a: 3, b: 4.5 }
+// lldb-command:print y
+// lldb-check:[...]$2 = 5
+// lldb-command:print z
+// lldb-check:[...]$3 = 6.5
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$4 = (7, 8, 9.5, 10.5)
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$5 = Newtype(11.5, 12.5, 13, 14)
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$6 = Case1 { x: 0, y: 8970181431921507452 }
+// lldb-command:continue
+
#![feature(struct_variant)]
#[deriving(Clone)]
}
fn fun(s: Struct) {
- zzz();
+ zzz(); // #break
}
fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) {
- zzz();
+ zzz(); // #break
}
fn tup(a: (int, uint, f64, f64)) {
- zzz();
+ zzz(); // #break
}
struct Newtype(f64, f64, int, uint);
fn new_type(a: Newtype) {
- zzz();
+ zzz(); // #break
}
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
}
fn by_val_enum(x: Enum) {
- zzz();
+ zzz(); // #break
}
fn main() {
by_val_enum(Case1 { x: 0, y: 8970181431921507452 });
}
-fn zzz() {()}
+fn zzz() { () }
#![feature(managed_boxes)]
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$4 = 8888
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print self
+// lldb-check:[...]$0 = 1111
+// lldb-command:continue
+
+// lldb-command:print self
+// lldb-check:[...]$1 = Struct { x: 2222, y: 3333 }
+// lldb-command:continue
+
+// lldb-command:print self
+// lldb-check:[...]$2 = (4444.5, 5555, 6666, 7777.5)
+// lldb-command:continue
+
+// lldb-command:print self->val
+// lldb-check:[...]$3 = 8888
+// lldb-command:continue
+
use std::gc::{Gc, GC};
trait Trait {
impl Trait for int {
fn method(self) -> int {
- zzz();
+ zzz(); // #break
self
}
}
impl Trait for Struct {
fn method(self) -> Struct {
- zzz();
+ zzz(); // #break
self
}
}
impl Trait for (f64, int, int, f64) {
fn method(self) -> (f64, int, int, f64) {
- zzz();
+ zzz(); // #break
self
}
}
impl Trait for Gc<int> {
fn method(self) -> Gc<int> {
- zzz();
+ zzz(); // #break
self
}
}
let _ = (box(GC) 8888).method();
}
-fn zzz() {()}
+fn zzz() { () }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// ignore-tidy-linelength
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print struct_with_drop
// gdb-check:$7 = {{a = OneHundred, b = Vienna}, 9}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print tuple_interior_padding
+// lldb-check:[...]$0 = (0, OneHundred)
+
+// lldb-command:print tuple_padding_at_end
+// lldb-check:[...]$1 = ((1, OneThousand), 2)
+// lldb-command:print tuple_different_enums
+// lldb-check:[...]$2 = (OneThousand, MountainView, OneMillion, Vienna)
+
+// lldb-command:print padded_struct
+// lldb-check:[...]$3 = PaddedStruct { a: 3, b: OneMillion, c: 4, d: Toronto, e: 5 }
+
+// lldb-command:print packed_struct
+// lldb-check:[...]$4 = PackedStruct { a: 6, b: OneHundred, c: 7, d: Vienna, e: 8 }
+
+// lldb-command:print non_padded_struct
+// lldb-check:[...]$5 = NonPaddedStruct { a: OneMillion, b: MountainView, c: OneThousand, d: Toronto }
+
+// lldb-command:print struct_with_drop
+// lldb-check:[...]$6 = (StructWithDrop { a: OneHundred, b: Vienna }, 9)
+
#![allow(unused_variable)]
enum AnEnum {
let struct_with_drop = (StructWithDrop { a: OneHundred, b: Vienna }, 9_i64);
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:print 'c-style-enum::SINGLE_VARIANT'
// gdb-command:print 'c-style-enum::MANUAL_THREE'
// gdb-check:$18 = OneMillion
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print auto_one
+// lldb-check:[...]$0 = One
+
+// lldb-command:print auto_two
+// lldb-check:[...]$1 = Two
+
+// lldb-command:print auto_three
+// lldb-check:[...]$2 = Three
+
+// lldb-command:print manual_one_hundred
+// lldb-check:[...]$3 = OneHundred
+
+// lldb-command:print manual_one_thousand
+// lldb-check:[...]$4 = OneThousand
+
+// lldb-command:print manual_one_million
+// lldb-check:[...]$5 = OneMillion
+
+// lldb-command:print single_variant
+// lldb-check:[...]$6 = TheOnlyVariant
+
#![allow(unused_variable)]
#![allow(dead_code)]
MANUAL_THREE = OneMillion;
};
- zzz();
+ zzz(); // #break
let a = SINGLE_VARIANT;
let a = unsafe { AUTO_ONE };
let a = unsafe { MANUAL_ONE };
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$4 = 110
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = 0.5
+// lldb-command:print y
+// lldb-check:[...]$1 = 10
+// lldb-command:continue
+
+// lldb-command:print *x
+// lldb-check:[...]$2 = 29
+// lldb-command:print *y
+// lldb-check:[...]$3 = 110
+// lldb-command:continue
+
fn some_generic_fun<T1, T2>(a: T1, b: T2) -> (T2, T1) {
let closure = |x, y| {
- zzz();
+ zzz(); // #break
(y, x)
};
some_generic_fun(&29i, box 110i);
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$49 = 62
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+// lldb-command:run
+
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = false
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$2 = 2
+// lldb-command:print b
+// lldb-check:[...]$3 = 3
+// lldb-command:print c
+// lldb-check:[...]$4 = 4
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$5 = 5
+// lldb-command:print b
+// lldb-check:[...]$6 = (6, 7)
+// lldb-command:continue
+
+// lldb-command:print h
+// lldb-check:[...]$7 = 8
+// lldb-command:print i
+// lldb-check:[...]$8 = Struct { a: 9, b: 10 }
+// lldb-command:print j
+// lldb-check:[...]$9 = 11
+// lldb-command:continue
+
+// lldb-command:print k
+// lldb-check:[...]$10 = 12
+// lldb-command:print l
+// lldb-check:[...]$11 = 13
+// lldb-command:continue
+
+// lldb-command:print m
+// lldb-check:[...]$12 = 14
+// lldb-command:print n
+// lldb-check:[...]$13 = 16
+// lldb-command:continue
+
+// lldb-command:print o
+// lldb-check:[...]$14 = 18
+// lldb-command:continue
+
+// lldb-command:print p
+// lldb-check:[...]$15 = 19
+// lldb-command:print q
+// lldb-check:[...]$16 = 20
+// lldb-command:print r
+// lldb-check:[...]$17 = Struct { a: 21, b: 22 }
+// lldb-command:continue
+
+// lldb-command:print s
+// lldb-check:[...]$18 = 24
+// lldb-command:print t
+// lldb-check:[...]$19 = 23
+// lldb-command:continue
+
+// lldb-command:print u
+// lldb-check:[...]$20 = 25
+// lldb-command:print v
+// lldb-check:[...]$21 = 26
+// lldb-command:print w
+// lldb-check:[...]$22 = 27
+// lldb-command:print x
+// lldb-check:[...]$23 = 28
+// lldb-command:print y
+// lldb-check:[...]$24 = 29
+// lldb-command:print z
+// lldb-check:[...]$25 = 30
+// lldb-command:print ae
+// lldb-check:[...]$26 = 31
+// lldb-command:print oe
+// lldb-check:[...]$27 = 32
+// lldb-command:print ue
+// lldb-check:[...]$28 = 33
+// lldb-command:continue
+
+// lldb-command:print aa
+// lldb-check:[...]$29 = (34, 35)
+// lldb-command:continue
+
+// lldb-command:print bb
+// lldb-check:[...]$30 = (36, 37)
+// lldb-command:continue
+
+// lldb-command:print cc
+// lldb-check:[...]$31 = 38
+// lldb-command:continue
+
+// lldb-command:print dd
+// lldb-check:[...]$32 = (40, 41, 42)
+// lldb-command:continue
+
+// lldb-command:print *ee
+// lldb-check:[...]$33 = (43, 44, 45)
+// lldb-command:continue
+
+// lldb-command:print *ff
+// lldb-check:[...]$34 = 46
+// lldb-command:print gg
+// lldb-check:[...]$35 = (47, 48)
+// lldb-command:continue
+
+// lldb-command:print *hh
+// lldb-check:[...]$36 = 50
+// lldb-command:continue
+
+// lldb-command:print ii
+// lldb-check:[...]$37 = 51
+// lldb-command:continue
+
+// lldb-command:print *jj
+// lldb-check:[...]$38 = 52
+// lldb-command:continue
+
+// lldb-command:print kk
+// lldb-check:[...]$39 = 53
+// lldb-command:print ll
+// lldb-check:[...]$40 = 54
+// lldb-command:continue
+
+// lldb-command:print mm
+// lldb-check:[...]$41 = 55
+// lldb-command:print *nn
+// lldb-check:[...]$42 = 56
+// lldb-command:continue
+
+// lldb-command:print oo
+// lldb-check:[...]$43 = 57
+// lldb-command:print pp
+// lldb-check:[...]$44 = 58
+// lldb-command:print qq
+// lldb-check:[...]$45 = 59
+// lldb-command:continue
+
+// lldb-command:print rr
+// lldb-check:[...]$46 = 60
+// lldb-command:print ss
+// lldb-check:[...]$47 = 61
+// lldb-command:print tt
+// lldb-check:[...]$48 = 62
+// lldb-command:continue
+
#![allow(unused_variable)]
fn simple_tuple((a, b): (int, bool)) {
- zzz();
+ zzz(); // #break
}
fn nested_tuple((a, (b, c)): (int, (u16, u16))) {
- zzz();
+ zzz(); // #break
}
fn destructure_only_first_level((a, b): (int, (u32, u32))) {
- zzz();
+ zzz(); // #break
}
fn struct_as_tuple_element((h, i, j): (i16, Struct, i16)) {
- zzz();
+ zzz(); // #break
}
fn struct_pattern(Struct { a: k, b: l }: Struct) {
- zzz();
+ zzz(); // #break
}
fn ignored_tuple_element((m, _, n): (int, u16, i32)) {
- zzz();
+ zzz(); // #break
}
fn ignored_struct_field(Struct { b: o, .. }: Struct) {
- zzz();
+ zzz(); // #break
}
fn one_struct_destructured_one_not((Struct { a: p, b: q }, r): (Struct, Struct)) {
- zzz();
+ zzz(); // #break
}
fn different_order_of_struct_fields(Struct { b: s, a: t }: Struct ) {
- zzz();
+ zzz(); // #break
}
fn complex_nesting(((u, v ), ((w, (x, Struct { a: y, b: z})), Struct { a: ae, b: oe }), ue ):
((i16, i32), ((i64, (i32, Struct, )), Struct ), u16))
{
- zzz();
+ zzz(); // #break
}
fn managed_box(&aa: &(int, int)) {
- zzz();
+ zzz(); // #break
}
fn borrowed_pointer(&bb: &(int, int)) {
- zzz();
+ zzz(); // #break
}
fn contained_borrowed_pointer((&cc, _): (&int, int)) {
- zzz();
+ zzz(); // #break
}
fn unique_pointer(box dd: Box<(int, int, int)>) {
- zzz();
+ zzz(); // #break
}
fn ref_binding(ref ee: (int, int, int)) {
- zzz();
+ zzz(); // #break
}
fn ref_binding_in_tuple((ref ff, gg): (int, (int, int))) {
- zzz();
+ zzz(); // #break
}
fn ref_binding_in_struct(Struct { b: ref hh, .. }: Struct) {
- zzz();
+ zzz(); // #break
}
fn univariant_enum(Unit(ii): Univariant) {
- zzz();
+ zzz(); // #break
}
fn univariant_enum_with_ref_binding(Unit(ref jj): Univariant) {
- zzz();
+ zzz(); // #break
}
fn tuple_struct(TupleStruct(kk, ll): TupleStruct) {
- zzz();
+ zzz(); // #break
}
fn tuple_struct_with_ref_binding(TupleStruct(mm, ref nn): TupleStruct) {
- zzz();
+ zzz(); // #break
}
fn multiple_arguments((oo, pp): (int, int), qq : int) {
- zzz();
+ zzz(); // #break
}
fn main() {
multiple_arguments((57, 58), 59);
fn nested_function(rr: int, (ss, tt): (int, int)) {
- zzz();
+ zzz(); // #break
}
nested_function(60, (61, 62));
}
-
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print *nn
// gdb-check:$43 = 56
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = false
+
+// lldb-command:print c
+// lldb-check:[...]$2 = 2
+// lldb-command:print d
+// lldb-check:[...]$3 = 3
+// lldb-command:print e
+// lldb-check:[...]$4 = 4
+
+// lldb-command:print f
+// lldb-check:[...]$5 = 5
+// lldb-command:print g
+// lldb-check:[...]$6 = (6, 7)
+
+// lldb-command:print h
+// lldb-check:[...]$7 = 8
+// lldb-command:print i
+// lldb-check:[...]$8 = Struct { a: 9, b: 10 }
+// lldb-command:print j
+// lldb-check:[...]$9 = 11
+
+// lldb-command:print k
+// lldb-check:[...]$10 = 12
+// lldb-command:print l
+// lldb-check:[...]$11 = 13
+
+// lldb-command:print m
+// lldb-check:[...]$12 = 14
+// lldb-command:print n
+// lldb-check:[...]$13 = 16
+
+// lldb-command:print o
+// lldb-check:[...]$14 = 18
+
+// lldb-command:print p
+// lldb-check:[...]$15 = 19
+// lldb-command:print q
+// lldb-check:[...]$16 = 20
+// lldb-command:print r
+// lldb-check:[...]$17 = Struct { a: 21, b: 22 }
+
+// lldb-command:print s
+// lldb-check:[...]$18 = 24
+// lldb-command:print t
+// lldb-check:[...]$19 = 23
+
+// lldb-command:print u
+// lldb-check:[...]$20 = 25
+// lldb-command:print v
+// lldb-check:[...]$21 = 26
+// lldb-command:print w
+// lldb-check:[...]$22 = 27
+// lldb-command:print x
+// lldb-check:[...]$23 = 28
+// lldb-command:print y
+// lldb-check:[...]$24 = 29
+// lldb-command:print z
+// lldb-check:[...]$25 = 30
+// lldb-command:print ae
+// lldb-check:[...]$26 = 31
+// lldb-command:print oe
+// lldb-check:[...]$27 = 32
+// lldb-command:print ue
+// lldb-check:[...]$28 = 33
+
+// lldb-command:print aa
+// lldb-check:[...]$29 = (34, 35)
+
+// lldb-command:print bb
+// lldb-check:[...]$30 = (36, 37)
+
+// lldb-command:print cc
+// lldb-check:[...]$31 = 38
+
+// lldb-command:print dd
+// lldb-check:[...]$32 = (40, 41, 42)
+
+// lldb-command:print *ee
+// lldb-check:[...]$33 = (43, 44, 45)
+
+// lldb-command:print *ff
+// lldb-check:[...]$34 = 46
+
+// lldb-command:print gg
+// lldb-check:[...]$35 = (47, 48)
+
+// lldb-command:print *hh
+// lldb-check:[...]$36 = 50
+
+// lldb-command:print ii
+// lldb-check:[...]$37 = 51
+
+// lldb-command:print *jj
+// lldb-check:[...]$38 = 52
+
+// lldb-command:print kk
+// lldb-check:[...]$39 = 53
+
+// lldb-command:print ll
+// lldb-check:[...]$40 = 54
+
+// lldb-command:print mm
+// lldb-check:[...]$41 = 55
+
+// lldb-command:print *nn
+// lldb-check:[...]$42 = 56
+
+
#![allow(unused_variable)]
struct Struct {
// tuple struct with ref binding
let &TupleStruct(mm, ref nn) = &TupleStruct(55.0, 56);
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print struct_padded_at_end
// gdb-check:$5 = {x = {22, 23}, y = {24, 25}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print no_padding1
+// lldb-check:[...]$0 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] }
+// lldb-command:print no_padding2
+// lldb-check:[...]$1 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] }
+
+// lldb-command:print struct_internal_padding
+// lldb-check:[...]$2 = StructInternalPadding { x: [13, 14], y: [15, 16] }
+
+// lldb-command:print single_vec
+// lldb-check:[...]$3 = SingleVec { x: [17, 18, 19, 20, 21] }
+
+// lldb-command:print struct_padded_at_end
+// lldb-check:[...]$4 = StructPaddedAtEnd { x: [22, 23], y: [24, 25] }
+
#![allow(unused_variable)]
struct NoPadding1 {
y: [24, 25]
};
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
// compile-flags:-g
// gdb-command:set print pretty off
-// gdb-command:break function-arg-initialization.rs:139
-// gdb-command:break function-arg-initialization.rs:154
-// gdb-command:break function-arg-initialization.rs:158
-// gdb-command:break function-arg-initialization.rs:162
-// gdb-command:break function-arg-initialization.rs:166
-// gdb-command:break function-arg-initialization.rs:170
-// gdb-command:break function-arg-initialization.rs:174
-// gdb-command:break function-arg-initialization.rs:178
-// gdb-command:break function-arg-initialization.rs:182
-// gdb-command:break function-arg-initialization.rs:190
-// gdb-command:break function-arg-initialization.rs:197
-
+// gdb-command:break function-arg-initialization.rs:243
+// gdb-command:break function-arg-initialization.rs:258
+// gdb-command:break function-arg-initialization.rs:262
+// gdb-command:break function-arg-initialization.rs:266
+// gdb-command:break function-arg-initialization.rs:270
+// gdb-command:break function-arg-initialization.rs:274
+// gdb-command:break function-arg-initialization.rs:278
+// gdb-command:break function-arg-initialization.rs:282
+// gdb-command:break function-arg-initialization.rs:286
+// gdb-command:break function-arg-initialization.rs:294
+// gdb-command:break function-arg-initialization.rs:301
+
+// === GDB TESTS ===================================================================================
// gdb-command:run
// gdb-check:$32 = 45
// gdb-command:continue
-#![allow(unused_variable)]
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = true
+// lldb-command:print c
+// lldb-check:[...]$2 = 2.5
+// lldb-command:continue
+
+// NON IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
+// lldb-command:print b
+// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
+// lldb-command:continue
+
+// BINDING
+// lldb-command:print a
+// lldb-check:[...]$5 = 19
+// lldb-command:print b
+// lldb-check:[...]$6 = 20
+// lldb-command:print c
+// lldb-check:[...]$7 = 21.5
+// lldb-command:continue
+
+// ASSIGNMENT
+// lldb-command:print a
+// lldb-check:[...]$8 = 22
+// lldb-command:print b
+// lldb-check:[...]$9 = 23
+// lldb-command:print c
+// lldb-check:[...]$10 = 24.5
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print x
+// lldb-check:[...]$11 = 25
+// lldb-command:print y
+// lldb-check:[...]$12 = 26
+// lldb-command:print z
+// lldb-check:[...]$13 = 27.5
+// lldb-command:continue
+
+// EXPR
+// lldb-command:print x
+// lldb-check:[...]$14 = 28
+// lldb-command:print y
+// lldb-check:[...]$15 = 29
+// lldb-command:print z
+// lldb-check:[...]$16 = 30.5
+// lldb-command:continue
+
+// RETURN EXPR
+// lldb-command:print x
+// lldb-check:[...]$17 = 31
+// lldb-command:print y
+// lldb-check:[...]$18 = 32
+// lldb-command:print z
+// lldb-check:[...]$19 = 33.5
+// lldb-command:continue
+
+// ARITHMETIC EXPR
+// lldb-command:print x
+// lldb-check:[...]$20 = 34
+// lldb-command:print y
+// lldb-check:[...]$21 = 35
+// lldb-command:print z
+// lldb-check:[...]$22 = 36.5
+// lldb-command:continue
+
+// IF EXPR
+// lldb-command:print x
+// lldb-check:[...]$23 = 37
+// lldb-command:print y
+// lldb-check:[...]$24 = 38
+// lldb-command:print z
+// lldb-check:[...]$25 = 39.5
+// lldb-command:continue
+
+// WHILE EXPR
+// lldb-command:print x
+// lldb-check:[...]$26 = 40
+// lldb-command:print y
+// lldb-check:[...]$27 = 41
+// lldb-command:print z
+// lldb-check:[...]$28 = 42
+// lldb-command:continue
+
+// LOOP EXPR
+// lldb-command:print x
+// lldb-check:[...]$29 = 43
+// lldb-command:print y
+// lldb-check:[...]$30 = 44
+// lldb-command:print z
+// lldb-check:[...]$31 = 45
+// lldb-command:continue
+
+
+
+#![allow(unused_variable)]
fn immediate_args(a: int, b: bool, c: f64) {
- ()
+ () // #break
}
struct BigStruct {
}
fn non_immediate_args(a: BigStruct, b: BigStruct) {
- ()
+ () // #break
}
fn binding(a: i64, b: u64, c: f64) {
- let x = 0i;
+ let x = 0i; // #break
}
fn assignment(mut a: u64, b: u64, c: f64) {
- a = b;
+ a = b; // #break
}
fn function_call(x: u64, y: u64, z: f64) {
- std::io::stdio::print("Hi!")
+ std::io::stdio::print("Hi!") // #break
}
fn identifier(x: u64, y: u64, z: f64) -> u64 {
- x
+ x // #break
}
fn return_expr(x: u64, y: u64, z: f64) -> u64 {
- return x;
+ return x; // #break
}
fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
- x + y
+ x + y // #break
}
fn if_expr(x: u64, y: u64, z: f64) -> u64 {
- if x + y < 1000 {
+ if x + y < 1000 { // #break
x
} else {
y
}
fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
- while x + y < 1000 {
+ while x + y > 1000 { // #break
x += z
}
return x;
}
fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
- loop {
+ loop { // #break
x += z;
if x + y > 1000 {
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print b
// gdb-check:$4 = 3000
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = 111102
+// lldb-command:print y
+// lldb-check:[...]$1 = true
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$2 = 2000
+// lldb-command:print b
+// lldb-check:[...]$3 = 3000
+// lldb-command:continue
+
fn main() {
fun(111102, true);
nested(2000, 3000);
fn nested(a: i32, b: i64) -> (i32, i64) {
- zzz();
+ zzz(); // #break
(a, b)
}
}
fn fun(x: int, y: bool) -> (int, bool) {
- zzz();
+ zzz(); // #break
(x, y)
}
-fn zzz() {()}
+fn zzz() { () }
// beginning of a function. Functions with the #[no_split_stack] attribute have the same prologue as
// regular C functions compiled with GCC or Clang and therefore are better handled by GDB. As a
// consequence, and as opposed to regular Rust functions, we can set the breakpoints via the
-// function name (and don't have to fall back on using line numbers).
+// function name (and don't have to fall back on using line numbers). For LLDB this shouldn't make
+// a difference because it can handle both cases.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak immediate_args
// gdb-command:rbreak binding
// gdb-check:$32 = 45
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:breakpoint set --name immediate_args
+// lldb-command:breakpoint set --name non_immediate_args
+// lldb-command:breakpoint set --name binding
+// lldb-command:breakpoint set --name assignment
+// lldb-command:breakpoint set --name function_call
+// lldb-command:breakpoint set --name identifier
+// lldb-command:breakpoint set --name return_expr
+// lldb-command:breakpoint set --name arithmetic_expr
+// lldb-command:breakpoint set --name if_expr
+// lldb-command:breakpoint set --name while_expr
+// lldb-command:breakpoint set --name loop_expr
+// lldb-command:run
+
+// IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = true
+// lldb-command:print c
+// lldb-check:[...]$2 = 2.5
+// lldb-command:continue
+
+// NON IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
+// lldb-command:print b
+// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
+// lldb-command:continue
+
+// BINDING
+// lldb-command:print a
+// lldb-check:[...]$5 = 19
+// lldb-command:print b
+// lldb-check:[...]$6 = 20
+// lldb-command:print c
+// lldb-check:[...]$7 = 21.5
+// lldb-command:continue
+
+// ASSIGNMENT
+// lldb-command:print a
+// lldb-check:[...]$8 = 22
+// lldb-command:print b
+// lldb-check:[...]$9 = 23
+// lldb-command:print c
+// lldb-check:[...]$10 = 24.5
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print x
+// lldb-check:[...]$11 = 25
+// lldb-command:print y
+// lldb-check:[...]$12 = 26
+// lldb-command:print z
+// lldb-check:[...]$13 = 27.5
+// lldb-command:continue
+
+// EXPR
+// lldb-command:print x
+// lldb-check:[...]$14 = 28
+// lldb-command:print y
+// lldb-check:[...]$15 = 29
+// lldb-command:print z
+// lldb-check:[...]$16 = 30.5
+// lldb-command:continue
+
+// RETURN EXPR
+// lldb-command:print x
+// lldb-check:[...]$17 = 31
+// lldb-command:print y
+// lldb-check:[...]$18 = 32
+// lldb-command:print z
+// lldb-check:[...]$19 = 33.5
+// lldb-command:continue
+
+// ARITHMETIC EXPR
+// lldb-command:print x
+// lldb-check:[...]$20 = 34
+// lldb-command:print y
+// lldb-check:[...]$21 = 35
+// lldb-command:print z
+// lldb-check:[...]$22 = 36.5
+// lldb-command:continue
+
+// IF EXPR
+// lldb-command:print x
+// lldb-check:[...]$23 = 37
+// lldb-command:print y
+// lldb-check:[...]$24 = 38
+// lldb-command:print z
+// lldb-check:[...]$25 = 39.5
+// lldb-command:continue
+
+// WHILE EXPR
+// lldb-command:print x
+// lldb-check:[...]$26 = 40
+// lldb-command:print y
+// lldb-check:[...]$27 = 41
+// lldb-command:print z
+// lldb-check:[...]$28 = 42
+// lldb-command:continue
+
+// LOOP EXPR
+// lldb-command:print x
+// lldb-check:[...]$29 = 43
+// lldb-command:print y
+// lldb-check:[...]$30 = 44
+// lldb-command:print z
+// lldb-check:[...]$31 = 45
+// lldb-command:continue
+
#![allow(unused_variable)]
#[no_split_stack]
--- /dev/null
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// This test case checks if function arguments already have the correct value when breaking at the
+// beginning of a function.
+
+// ignore-gdb
+// compile-flags:-g
+
+// lldb-command:breakpoint set --name immediate_args
+// lldb-command:breakpoint set --name non_immediate_args
+// lldb-command:breakpoint set --name binding
+// lldb-command:breakpoint set --name assignment
+// lldb-command:breakpoint set --name function_call
+// lldb-command:breakpoint set --name identifier
+// lldb-command:breakpoint set --name return_expr
+// lldb-command:breakpoint set --name arithmetic_expr
+// lldb-command:breakpoint set --name if_expr
+// lldb-command:breakpoint set --name while_expr
+// lldb-command:breakpoint set --name loop_expr
+// lldb-command:run
+
+// IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = true
+// lldb-command:print c
+// lldb-check:[...]$2 = 2.5
+// lldb-command:continue
+
+// NON IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
+// lldb-command:print b
+// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
+// lldb-command:continue
+
+// BINDING
+// lldb-command:print a
+// lldb-check:[...]$5 = 19
+// lldb-command:print b
+// lldb-check:[...]$6 = 20
+// lldb-command:print c
+// lldb-check:[...]$7 = 21.5
+// lldb-command:continue
+
+// ASSIGNMENT
+// lldb-command:print a
+// lldb-check:[...]$8 = 22
+// lldb-command:print b
+// lldb-check:[...]$9 = 23
+// lldb-command:print c
+// lldb-check:[...]$10 = 24.5
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print x
+// lldb-check:[...]$11 = 25
+// lldb-command:print y
+// lldb-check:[...]$12 = 26
+// lldb-command:print z
+// lldb-check:[...]$13 = 27.5
+// lldb-command:continue
+
+// EXPR
+// lldb-command:print x
+// lldb-check:[...]$14 = 28
+// lldb-command:print y
+// lldb-check:[...]$15 = 29
+// lldb-command:print z
+// lldb-check:[...]$16 = 30.5
+// lldb-command:continue
+
+// RETURN EXPR
+// lldb-command:print x
+// lldb-check:[...]$17 = 31
+// lldb-command:print y
+// lldb-check:[...]$18 = 32
+// lldb-command:print z
+// lldb-check:[...]$19 = 33.5
+// lldb-command:continue
+
+// ARITHMETIC EXPR
+// lldb-command:print x
+// lldb-check:[...]$20 = 34
+// lldb-command:print y
+// lldb-check:[...]$21 = 35
+// lldb-command:print z
+// lldb-check:[...]$22 = 36.5
+// lldb-command:continue
+
+// IF EXPR
+// lldb-command:print x
+// lldb-check:[...]$23 = 37
+// lldb-command:print y
+// lldb-check:[...]$24 = 38
+// lldb-command:print z
+// lldb-check:[...]$25 = 39.5
+// lldb-command:continue
+
+// WHILE EXPR
+// lldb-command:print x
+// lldb-check:[...]$26 = 40
+// lldb-command:print y
+// lldb-check:[...]$27 = 41
+// lldb-command:print z
+// lldb-check:[...]$28 = 42
+// lldb-command:continue
+
+// LOOP EXPR
+// lldb-command:print x
+// lldb-check:[...]$29 = 43
+// lldb-command:print y
+// lldb-check:[...]$30 = 44
+// lldb-command:print z
+// lldb-check:[...]$31 = 45
+// lldb-command:continue
+
+#![allow(unused_variable)]
+
+fn immediate_args(a: int, b: bool, c: f64) {
+ ()
+}
+
+struct BigStruct {
+ a: u64,
+ b: u64,
+ c: u64,
+ d: u64,
+ e: u64,
+ f: u64,
+ g: u64,
+ h: u64
+}
+
+fn non_immediate_args(a: BigStruct, b: BigStruct) {
+ ()
+}
+
+fn binding(a: i64, b: u64, c: f64) {
+ let x = 0i;
+}
+
+fn assignment(mut a: u64, b: u64, c: f64) {
+ a = b;
+}
+
+fn function_call(x: u64, y: u64, z: f64) {
+ std::io::stdio::print("Hi!")
+}
+
+fn identifier(x: u64, y: u64, z: f64) -> u64 {
+ x
+}
+
+fn return_expr(x: u64, y: u64, z: f64) -> u64 {
+ return x;
+}
+
+fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
+ x + y
+}
+
+fn if_expr(x: u64, y: u64, z: f64) -> u64 {
+ if x + y < 1000 {
+ x
+ } else {
+ y
+ }
+}
+
+fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
+ while x + y < 1000 {
+ x += z
+ }
+ return x;
+}
+
+fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
+ loop {
+ x += z;
+
+ if x + y > 1000 {
+ return x;
+ }
+ }
+}
+
+fn main() {
+ immediate_args(1, true, 2.5);
+
+ non_immediate_args(
+ BigStruct {
+ a: 3,
+ b: 4,
+ c: 5,
+ d: 6,
+ e: 7,
+ f: 8,
+ g: 9,
+ h: 10
+ },
+ BigStruct {
+ a: 11,
+ b: 12,
+ c: 13,
+ d: 14,
+ e: 15,
+ f: 16,
+ g: 17,
+ h: 18
+ }
+ );
+
+ binding(19, 20, 21.5);
+ assignment(22, 23, 24.5);
+ function_call(25, 26, 27.5);
+ identifier(28, 29, 30.5);
+ return_expr(31, 32, 33.5);
+ arithmetic_expr(34, 35, 36.5);
+ if_expr(37, 38, 39.5);
+ while_expr(40, 41, 42);
+ loop_expr(43, 44, 45);
+}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$9 = {{5, {a = 6, b = 7.5}}, {{a = 6, b = 7.5}, 5}}
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *t0
+// lldb-check:[...]$0 = 1
+// lldb-command:print *t1
+// lldb-check:[...]$1 = 2.5
+// lldb-command:print ret
+// lldb-check:[...]$2 = ((1, 2.5), (2.5, 1))
+// lldb-command:continue
+
+// lldb-command:print *t0
+// lldb-check:[...]$3 = 3.5
+// lldb-command:print *t1
+// lldb-check:[...]$4 = 4
+// lldb-command:print ret
+// lldb-check:[...]$5 = ((3.5, 4), (4, 3.5))
+// lldb-command:continue
+
+// lldb-command:print *t0
+// lldb-check:[...]$6 = 5
+// lldb-command:print *t1
+// lldb-check:[...]$7 = Struct { a: 6, b: 7.5 }
+// lldb-command:print ret
+// lldb-check:[...]$8 = ((5, Struct { a: 6, b: 7.5 }), (Struct { a: 6, b: 7.5 }, 5))
+// lldb-command:continue
+
+
#[deriving(Clone)]
struct Struct {
a: int,
fn dup_tup<T0: Clone, T1: Clone>(t0: &T0, t1: &T1) -> ((T0, T1), (T1, T0)) {
let ret = ((t0.clone(), t1.clone()), (t1.clone(), t0.clone()));
- zzz();
+ zzz(); // #break
ret
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$8 = 2.5
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = -1
+// lldb-command:print y
+// lldb-check:[...]$1 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = -1
+// lldb-command:print y
+// lldb-check:[...]$3 = 2.5
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = -2.5
+// lldb-command:print y
+// lldb-check:[...]$5 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$6 = -2.5
+// lldb-command:print y
+// lldb-check:[...]$7 = 2.5
+// lldb-command:continue
+
fn outer<TA: Clone>(a: TA) {
inner(a.clone(), 1i);
inner(a.clone(), 2.5f64);
fn inner<TX, TY>(x: TX, y: TY) {
- zzz();
+ zzz(); // #break
}
}
outer(-2.5f64);
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$1 = {x = {8888, -8888}}
// gdb-command:print arg1
// gdb-check:$2 = -1
-// gdb-command:print/d arg2
-// gdb-check:$3 = -2
+// gdb-command:print arg2
+// gdb-check:$3 = 2
// gdb-command:continue
// STACK BY VAL
// gdb-check:$15 = -10.5
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) }
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = 2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) }
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Struct<f64> { x: 1234.5 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Struct<f64> { x: 1234.5 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Struct<f64> { x: 1234.5 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10.5
+// lldb-command:continue
+
+
struct Struct<T> {
x: T
}
impl<T1> Struct<T1> {
fn self_by_ref<T2>(&self, arg1: int, arg2: T2) -> int {
- zzz();
+ zzz(); // #break
arg1
}
fn self_by_val<T2>(self, arg1: int, arg2: T2) -> int {
- zzz();
+ zzz(); // #break
arg1
}
fn self_owned<T2>(~self, arg1: int, arg2: T2) -> int {
- zzz();
+ zzz(); // #break
arg1
}
}
fn main() {
let stack = Struct { x: (8888_u32, -8888_i32) };
- let _ = stack.self_by_ref(-1, -2_i8);
+ let _ = stack.self_by_ref(-1, 2_u16);
let _ = stack.self_by_val(-3, -4_i16);
let owned = box Struct { x: 1234.5f64 };
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// ignore-tidy-linelength
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print float_int_float
// gdb-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}}
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print int_int
+// lldb-check:[...]$0 = AGenericStruct<int, int> { key: 0, value: 1 }
+// lldb-command:print int_float
+// lldb-check:[...]$1 = AGenericStruct<int, f64> { key: 2, value: 3.5 }
+// lldb-command:print float_int
+// lldb-check:[...]$2 = AGenericStruct<f64, int> { key: 4.5, value: 5 }
+
+// lldb-command:print float_int_float
+// lldb-check:[...]$3 = AGenericStruct<f64, generic-struct::AGenericStruct<int, f64>> { key: 6.5, value: AGenericStruct<int, f64> { key: 7, value: 8.5 } }
+
struct AGenericStruct<TKey, TValue> {
key: TKey,
value: TValue
value: AGenericStruct { key: 7i, value: 8.5f64 },
};
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print union on
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$4 = {{-1}}
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print case1
+// lldb-check:[...]$0 = Case1(0, 31868, 31868, 31868, 31868)
+
+// lldb-command:print case2
+// lldb-check:[...]$1 = Case2(0, 286331153, 286331153)
+
+// lldb-command:print case3
+// lldb-check:[...]$2 = Case3(0, 6438275382588823897)
+
+// lldb-command:print univariant
+// lldb-check:[...]$3 = TheOnlyCase(-1)
+
+
// NOTE: This is a copy of the non-generic test case. The `Txx` type parameters have to be
// substituted with something of size `xx` bits and the same alignment as an integer type of the
// same size.
let univariant = TheOnlyCase(-1_i64);
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
// gdb-command:run
// gdb-command:finish
// gdb-command:print string1.length
-// gdb-check:$1 = 49
+// gdb-check:$1 = 48
// gdb-command:print string2.length
// gdb-check:$2 = 49
// gdb-command:print string3.length
-// gdb-check:$3 = 49
+// gdb-check:$3 = 50
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print string1.length
+// lldb-check:[...]$0 = 48
+// lldb-command:print string2.length
+// lldb-check:[...]$1 = 49
+// lldb-command:print string3.length
+// lldb-check:[...]$2 = 50
+
+// lldb-command:continue
+
#![allow(unused_variable)]
// This test case makes sure that debug info does not ICE when include_str is
let string1 = include_str!("text-to-include-1.txt");
let string2 = include_str!("text-to-include-2.txt");
let string3 = include_str!("text-to-include-3.txt");
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$7 = 1000000
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// FIRST ITERATION
+// lldb-command:print x
+// lldb-check:[...]$0 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = -1
+// lldb-command:continue
+
+// SECOND ITERATION
+// lldb-command:print x
+// lldb-check:[...]$2 = 2
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$3 = -2
+// lldb-command:continue
+
+// THIRD ITERATION
+// lldb-command:print x
+// lldb-check:[...]$4 = 3
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$5 = -3
+// lldb-command:continue
+
+// AFTER LOOP
+// lldb-command:print x
+// lldb-check:[...]$6 = 1000000
+// lldb-command:continue
+
fn main() {
let range = [1i, 2, 3];
let x = 1000000i; // wan meeeljen doollaars!
for &x in range.iter() {
- zzz();
+ zzz(); // #break
sentinel();
let x = -1i * x;
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$16 = -1
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// BEFORE if
+// lldb-command:print x
+// lldb-check:[...]$0 = 999
+// lldb-command:print y
+// lldb-check:[...]$1 = -1
+// lldb-command:continue
+
+// AT BEGINNING of 'then' block
+// lldb-command:print x
+// lldb-check:[...]$2 = 999
+// lldb-command:print y
+// lldb-check:[...]$3 = -1
+// lldb-command:continue
+
+// AFTER 1st redeclaration of 'x'
+// lldb-command:print x
+// lldb-check:[...]$4 = 1001
+// lldb-command:print y
+// lldb-check:[...]$5 = -1
+// lldb-command:continue
+
+// AFTER 2st redeclaration of 'x'
+// lldb-command:print x
+// lldb-check:[...]$6 = 1002
+// lldb-command:print y
+// lldb-check:[...]$7 = 1003
+// lldb-command:continue
+
+// AFTER 1st if expression
+// lldb-command:print x
+// lldb-check:[...]$8 = 999
+// lldb-command:print y
+// lldb-check:[...]$9 = -1
+// lldb-command:continue
+
+// BEGINNING of else branch
+// lldb-command:print x
+// lldb-check:[...]$10 = 999
+// lldb-command:print y
+// lldb-check:[...]$11 = -1
+// lldb-command:continue
+
+// BEGINNING of else branch
+// lldb-command:print x
+// lldb-check:[...]$12 = 1004
+// lldb-command:print y
+// lldb-check:[...]$13 = 1005
+// lldb-command:continue
+
+// BEGINNING of else branch
+// lldb-command:print x
+// lldb-check:[...]$14 = 999
+// lldb-command:print y
+// lldb-check:[...]$15 = -1
+// lldb-command:continue
+
+
fn main() {
let x = 999i;
let y = -1i;
- zzz();
+ zzz(); // #break
sentinel();
if x < 1000 {
- zzz();
+ zzz(); // #break
sentinel();
let x = 1001i;
- zzz();
+ zzz(); // #break
sentinel();
let x = 1002i;
let y = 1003i;
- zzz();
+ zzz(); // #break
sentinel();
} else {
unreachable!();
}
- zzz();
+ zzz(); // #break
sentinel();
if x > 1000 {
unreachable!();
} else {
- zzz();
+ zzz(); // #break
sentinel();
let x = 1004i;
let y = 1005i;
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$18 = 232
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print shadowed
+// lldb-check:[...]$0 = 231
+// lldb-command:print not_shadowed
+// lldb-check:[...]$1 = 232
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$2 = 233
+// lldb-command:print not_shadowed
+// lldb-check:[...]$3 = 232
+// lldb-command:print local_to_arm
+// lldb-check:[...]$4 = 234
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$5 = 236
+// lldb-command:print not_shadowed
+// lldb-check:[...]$6 = 232
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$7 = 237
+// lldb-command:print not_shadowed
+// lldb-check:[...]$8 = 232
+// lldb-command:print local_to_arm
+// lldb-check:[...]$9 = 238
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$10 = 239
+// lldb-command:print not_shadowed
+// lldb-check:[...]$11 = 232
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$12 = 241
+// lldb-command:print not_shadowed
+// lldb-check:[...]$13 = 232
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$14 = 243
+// lldb-command:print *local_to_arm
+// lldb-check:[...]$15 = 244
+// lldb-command:continue
+
+// lldb-command:print shadowed
+// lldb-check:[...]$16 = 231
+// lldb-command:print not_shadowed
+// lldb-check:[...]$17 = 232
+// lldb-command:continue
+
+
struct Struct {
x: int,
y: int
let shadowed = 231i;
let not_shadowed = 232i;
- zzz();
+ zzz(); // #break
sentinel();
match (233i, 234i) {
(shadowed, local_to_arm) => {
- zzz();
+ zzz(); // #break
sentinel();
}
}
// with literal
(235, shadowed) => {
- zzz();
+ zzz(); // #break
sentinel();
}
_ => {}
match (Struct { x: 237, y: 238 }) {
Struct { x: shadowed, y: local_to_arm } => {
- zzz();
+ zzz(); // #break
sentinel();
}
}
// ignored field
Struct { x: shadowed, .. } => {
- zzz();
+ zzz(); // #break
sentinel();
}
}
// with literal
Struct { x: shadowed, y: 242 } => {
- zzz();
+ zzz(); // #break
sentinel();
}
_ => {}
match (243i, 244i) {
(shadowed, ref local_to_arm) => {
- zzz();
+ zzz(); // #break
sentinel();
}
}
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$6 = false
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = false
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = false
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 1000
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$3 = 2.5
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$5 = false
+// lldb-command:continue
+
fn main() {
let x = false;
- zzz();
+ zzz(); // #break
sentinel();
let stack_closure: |int| = |x| {
- zzz();
+ zzz(); // #break
sentinel();
let x = 2.5f64;
- zzz();
+ zzz(); // #break
sentinel();
let x = true;
- zzz();
+ zzz(); // #break
sentinel();
};
- zzz();
+ zzz(); // #break
sentinel();
stack_closure(1000);
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$13 = 2
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// FIRST ITERATION
+// lldb-command:print x
+// lldb-check:[...]$0 = 0
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 101
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$3 = 101
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = -987
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$5 = 101
+// lldb-command:continue
+
+
+// SECOND ITERATION
+// lldb-command:print x
+// lldb-check:[...]$6 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$7 = 2
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$8 = 102
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$9 = 102
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$10 = -987
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$11 = 102
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$12 = 2
+// lldb-command:continue
+
fn main() {
let mut x = 0i;
break;
}
- zzz();
+ zzz(); // #break
sentinel();
x += 1;
- zzz();
+ zzz(); // #break
sentinel();
// Shadow x
let x = x + 100;
- zzz();
+ zzz(); // #break
sentinel();
// open scope within loop's top level scope
{
- zzz();
+ zzz(); // #break
sentinel();
let x = -987i;
- zzz();
+ zzz(); // #break
sentinel();
}
// Check that we get the x before the inner scope again
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$6 = false
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = false
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = false
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 1000
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$3 = 2.5
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$5 = false
+// lldb-command:continue
+
fn main() {
let x = false;
- zzz();
+ zzz(); // #break
sentinel();
let unique_closure: proc(int) = proc(x) {
- zzz();
+ zzz(); // #break
sentinel();
let x = 2.5f64;
- zzz();
+ zzz(); // #break
sentinel();
let x = true;
- zzz();
+ zzz(); // #break
sentinel();
};
- zzz();
+ zzz(); // #break
sentinel();
unique_closure(1000);
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$13 = 2
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// FIRST ITERATION
+// lldb-command:print x
+// lldb-check:[...]$0 = 0
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 101
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$3 = 101
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = -987
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$5 = 101
+// lldb-command:continue
+
+
+// SECOND ITERATION
+// lldb-command:print x
+// lldb-check:[...]$6 = 1
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$7 = 2
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$8 = 102
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$9 = 102
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$10 = -987
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$11 = 102
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$12 = 2
+// lldb-command:continue
+
+
fn main() {
let mut x = 0i;
while x < 2 {
- zzz();
+ zzz(); // #break
sentinel();
x += 1;
- zzz();
+ zzz(); // #break
sentinel();
// Shadow x
let x = x + 100;
- zzz();
+ zzz(); // #break
sentinel();
// open scope within loop's top level scope
{
- zzz();
+ zzz(); // #break
sentinel();
let x = -987i;
- zzz();
+ zzz(); // #break
sentinel();
}
// Check that we get the x before the inner scope again
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = 400
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print a
+// lldb-check:[...]$0 = 10
+// lldb-command:print b
+// lldb-check:[...]$1 = 34
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$2 = 890242
+// lldb-command:print b
+// lldb-check:[...]$3 = 34
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$4 = 10
+// lldb-command:print b
+// lldb-check:[...]$5 = 34
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$6 = 102
+// lldb-command:print b
+// lldb-check:[...]$7 = 34
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$8 = 110
+// lldb-command:print b
+// lldb-check:[...]$9 = 34
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$10 = 10
+// lldb-command:print b
+// lldb-check:[...]$11 = 34
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$12 = 10
+// lldb-command:print b
+// lldb-check:[...]$13 = 34
+// lldb-command:print c
+// lldb-check:[...]$14 = 400
+// lldb-command:continue
+
+
#![feature(macro_rules)]
macro_rules! trivial(
macro_rules! new_scope(
() => ({
let a = 890242i;
- zzz();
+ zzz(); // #break
sentinel();
})
)
($e1:expr) => ({
let a = $e1 + 2;
- zzz();
+ zzz(); // #break
sentinel();
let a = $e1 + 10;
- zzz();
+ zzz(); // #break
sentinel();
})
)
let a = trivial!(10i);
let b = no_new_scope!(33i);
- zzz();
+ zzz(); // #break
sentinel();
new_scope!();
- zzz();
+ zzz(); // #break
sentinel();
shadow_within_macro!(100i);
- zzz();
+ zzz(); // #break
sentinel();
let c = dup_expr!(10i * 20);
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$57 = 10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STRUCT EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$0 = -1
+// lldb-command:print ten
+// lldb-check:[...]$1 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$2 = 11
+// lldb-command:print ten
+// lldb-check:[...]$3 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$4 = -1
+// lldb-command:print ten
+// lldb-check:[...]$5 = 10
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print val
+// lldb-check:[...]$6 = -1
+// lldb-command:print ten
+// lldb-check:[...]$7 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$8 = 12
+// lldb-command:print ten
+// lldb-check:[...]$9 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$10 = -1
+// lldb-command:print ten
+// lldb-check:[...]$11 = 10
+// lldb-command:continue
+
+// TUPLE EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$12 = -1
+// lldb-command:print ten
+// lldb-check:[...]$13 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$14 = 13
+// lldb-command:print ten
+// lldb-check:[...]$15 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$16 = -1
+// lldb-command:print ten
+// lldb-check:[...]$17 = 10
+// lldb-command:continue
+
+// VEC EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$18 = -1
+// lldb-command:print ten
+// lldb-check:[...]$19 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$20 = 14
+// lldb-command:print ten
+// lldb-check:[...]$21 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$22 = -1
+// lldb-command:print ten
+// lldb-check:[...]$23 = 10
+// lldb-command:continue
+
+// REPEAT VEC EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$24 = -1
+// lldb-command:print ten
+// lldb-check:[...]$25 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$26 = 15
+// lldb-command:print ten
+// lldb-check:[...]$27 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$28 = -1
+// lldb-command:print ten
+// lldb-check:[...]$29 = 10
+// lldb-command:continue
+
+// ASSIGNMENT EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$30 = -1
+// lldb-command:print ten
+// lldb-check:[...]$31 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$32 = 16
+// lldb-command:print ten
+// lldb-check:[...]$33 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$34 = -1
+// lldb-command:print ten
+// lldb-check:[...]$35 = 10
+// lldb-command:continue
+
+
+// ARITHMETIC EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$36 = -1
+// lldb-command:print ten
+// lldb-check:[...]$37 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$38 = 17
+// lldb-command:print ten
+// lldb-check:[...]$39 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$40 = -1
+// lldb-command:print ten
+// lldb-check:[...]$41 = 10
+// lldb-command:continue
+
+// INDEX EXPRESSION
+// lldb-command:print val
+// lldb-check:[...]$42 = -1
+// lldb-command:print ten
+// lldb-check:[...]$43 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$44 = 18
+// lldb-command:print ten
+// lldb-check:[...]$45 = 10
+// lldb-command:continue
+
+// lldb-command:print val
+// lldb-check:[...]$46 = -1
+// lldb-command:print ten
+// lldb-check:[...]$47 = 10
+// lldb-command:continue
+
#![allow(unused_variable)]
#![allow(dead_assignment)]
// surrounded by struct expression
let point = Point {
x: {
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 1;
unsafe {MUT_INT = 1;};
- zzz();
+ zzz(); // #break
sentinel();
val
y: 10
};
- zzz();
+ zzz(); // #break
sentinel();
// surrounded by function call
let _ = a_function({
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 2;
unsafe {MUT_INT = 2;};
- zzz();
+ zzz(); // #break
sentinel();
val
});
- zzz();
+ zzz(); // #break
sentinel();
// surrounded by tup
let _ = ({
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 3;
unsafe {MUT_INT = 3;};
- zzz();
+ zzz(); // #break
sentinel();
val
}, 0i);
- zzz();
+ zzz(); // #break
sentinel();
// surrounded by vec
let _ = [{
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 4;
unsafe {MUT_INT = 4;};
- zzz();
+ zzz(); // #break
sentinel();
val
}, 0, 0];
- zzz();
+ zzz(); // #break
sentinel();
// surrounded by repeat vec
let _ = [{
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 5;
unsafe {MUT_INT = 5;};
- zzz();
+ zzz(); // #break
sentinel();
val
}, ..10];
- zzz();
+ zzz(); // #break
sentinel();
// assignment expression
let mut var = 0;
var = {
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 6;
unsafe {MUT_INT = 6;};
- zzz();
+ zzz(); // #break
sentinel();
val
};
- zzz();
+ zzz(); // #break
sentinel();
// arithmetic expression
var = 10 + -{
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 7;
unsafe {MUT_INT = 7;};
- zzz();
+ zzz(); // #break
sentinel();
val
} * 5;
- zzz();
+ zzz(); // #break
sentinel();
// index expression
let a_vector = [10i, ..20];
let _ = a_vector[{
- zzz();
+ zzz(); // #break
sentinel();
let val = ten + 8;
unsafe {MUT_INT = 8;};
- zzz();
+ zzz(); // #break
sentinel();
val as uint
}];
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
+// ignore-lldb
+
// compile-flags:--debuginfo=1
// Make sure functions have proper names
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print univariant->val
// gdb-check:$3 = {{-9747455}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print the_a->val
+// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 }
+
+// lldb-command:print the_b->val
+// lldb-check:[...]$1 = TheB(0, 286331153, 286331153)
+
+// lldb-command:print univariant->val
+// lldb-check:[...]$2 = TheOnlyCase(-9747455)
+
#![allow(unused_variable)]
#![feature(struct_variant, managed_boxes)]
let univariant = box(GC) TheOnlyCase(-9747455);
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
#![feature(managed_boxes)]
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print unique.ptr[3]->val
// gdb-check:$4 = 13
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print unique.ptr[0]->val
+// lldb-check:[...]$0 = 10
+
+// lldb-command:print unique.ptr[1]->val
+// lldb-check:[...]$1 = 11
+
+// lldb-command:print unique.ptr[2]->val
+// lldb-check:[...]$2 = 12
+
+// lldb-command:print unique.ptr[3]->val
+// lldb-check:[...]$3 = 13
+
+
#![allow(unused_variable)]
use std::gc::{Gc, GC};
let unique: Vec<Gc<i64>> = vec!(box(GC) 10, box(GC) 11, box(GC) 12, box(GC) 13);
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
#![feature(managed_boxes)]
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print managed_within_unique->y->val
// gdb-check:$3 = -4
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *ordinary_unique
+// lldb-check:[...]$0 = (-1, -2)
+
+// lldb-command:print managed_within_unique->x
+// lldb-check:[...]$1 = -3
+
+// lldb-command:print managed_within_unique->y->val
+// lldb-check:[...]$2 = -4
+
#![allow(unused_variable)]
use std::gc::{GC, Gc};
let managed_within_unique = box ContainsManaged { x: -3, y: box(GC) -4i };
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = -10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Variant2(117901063)
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = -2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Variant2(117901063)
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Variant1 { x: 1799, y: 1799 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Variant1 { x: 1799, y: 1799 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Variant1 { x: 1799, y: 1799 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10
+// lldb-command:continue
+
#![feature(struct_variant)]
enum Enum {
impl Enum {
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_by_val(self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_owned(~self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = -10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) }
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = -2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) }
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Struct<f64> { x: 1234.5 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Struct<f64> { x: 1234.5 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Struct<f64> { x: 1234.5 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10
+// lldb-command:continue
+
+
struct Struct<T> {
x: T
}
impl<T> Struct<T> {
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_by_val(self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_owned(~self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = -10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Struct { x: 100 }
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = -2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Struct { x: 100 }
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10
+// lldb-command:continue
+
struct Struct {
x: int
}
impl Struct {
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
self.x + arg1 + arg2
}
fn self_by_val(self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
self.x + arg1 + arg2
}
fn self_owned(~self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
self.x + arg1 + arg2
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = -10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Struct { x: 100 }
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = -2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Struct { x: 100 }
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10
+// lldb-command:continue
+
struct Struct {
x: int
}
impl Trait for Struct {
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
self.x + arg1 + arg2
}
fn self_by_val(self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
self.x + arg1 + arg2
}
fn self_owned(~self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
self.x + arg1 + arg2
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = -10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = TupleStruct(100, -100.5)
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = -2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = TupleStruct(100, -100.5)
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = TupleStruct(200, -200.5)
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = TupleStruct(200, -200.5)
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = TupleStruct(200, -200.5)
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10
+// lldb-command:continue
+
struct TupleStruct(int, f64);
impl TupleStruct {
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_by_val(self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_owned(~self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print abc
// gdb-check:$3 = 30303
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print abc
+// lldb-check:[...]$0 = 10101
+// lldb-command:continue
+
+// lldb-command:print abc
+// lldb-check:[...]$1 = 20202
+// lldb-command:continue
+
+// lldb-command:print abc
+// lldb-check:[...]$2 = 30303
+
#![allow(unused_variable)]
fn function_one() {
let abc = 10101i;
- zzz();
+ zzz(); // #break
}
fn function_two() {
let abc = 20202i;
- zzz();
+ zzz(); // #break
}
fn function_three() {
let abc = 30303i;
- zzz();
+ zzz(); // #break
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print c
// gdb-check:$3 = 30303
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print a
+// lldb-check:[...]$0 = 10101
+// lldb-command:continue
+
+// lldb-command:print b
+// lldb-check:[...]$1 = 20202
+// lldb-command:continue
+
+// lldb-command:print c
+// lldb-check:[...]$2 = 30303
+
#![allow(unused_variable)]
fn function_one() {
let a = 10101i;
- zzz();
+ zzz(); // #break
}
fn function_two() {
let b = 20202i;
- zzz();
+ zzz(); // #break
}
fn function_three() {
let c = 30303i;
- zzz();
+ zzz(); // #break
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$12 = 20
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = false
+// lldb-command:print y
+// lldb-check:[...]$1 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 10
+// lldb-command:print y
+// lldb-check:[...]$3 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = 10.5
+// lldb-command:print y
+// lldb-check:[...]$5 = 20
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$6 = true
+// lldb-command:print y
+// lldb-check:[...]$7 = 2220
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$8 = 203203.5
+// lldb-command:print y
+// lldb-check:[...]$9 = 2220
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$10 = 10.5
+// lldb-command:print y
+// lldb-check:[...]$11 = 20
+// lldb-command:continue
+
fn main() {
let x = false;
let y = true;
- zzz();
+ zzz(); // #break
sentinel();
let x = 10i;
- zzz();
+ zzz(); // #break
sentinel();
let x = 10.5f64;
let y = 20i;
- zzz();
+ zzz(); // #break
sentinel();
{
let x = true;
let y = 2220i;
- zzz();
+ zzz(); // #break
sentinel();
let x = 203203.5f64;
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// LLDB can't handle zero-sized values
+// ignore-lldb
+
// ignore-android: FIXME(#10381)
// compile-flags:-g
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print full
// gdb-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {454545, 0x87654321, 9988}}
-// gdb-command:print empty->discr
+// gdb-command:print empty_gdb->discr
// gdb-check:$4 = (int *) 0x0
// gdb-command:print droid
// gdb-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}}
-// gdb-command:print void_droid->internals
+// gdb-command:print void_droid_gdb->internals
// gdb-check:$6 = (int *) 0x0
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print some
+// lldb-check:[...]$0 = Some(&0x12345678)
+
+// lldb-command:print none
+// lldb-check:[...]$1 = None
+
+// lldb-command:print full
+// lldb-check:[...]$2 = Full(454545, &0x87654321, 9988)
+
+// lldb-command:print empty
+// lldb-check:[...]$3 = Empty
+
+// lldb-command:print droid
+// lldb-check:[...]$4 = Droid { id: 675675, range: 10000001, internals: &0x43218765 }
+
+// lldb-command:print void_droid
+// lldb-check:[...]$5 = Void
+
+
#![feature(struct_variant)]
// If a struct has exactly two variants, one of them is empty, and the other one
let full = Full(454545, unsafe { std::mem::transmute(0x87654321u) }, 9988);
- let int_val = 0i;
- let empty: &MoreFieldsRepr = unsafe { std::mem::transmute(&Empty) };
+ let empty = Empty;
+ let empty_gdb: &MoreFieldsRepr = unsafe { std::mem::transmute(&Empty) };
let droid = Droid {
id: 675675,
internals: unsafe { std::mem::transmute(0x43218765u) }
};
- let void_droid: &NamedFieldsRepr = unsafe { std::mem::transmute(&Void) };
+ let void_droid = Void;
+ let void_droid_gdb: &NamedFieldsRepr = unsafe { std::mem::transmute(&Void) };
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print deeplyNested
// gdb-check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print packed
+// lldb-check:[...]$0 = Packed { x: 123, y: 234, z: 345 }
+
+// lldb-command:print packedInPacked
+// lldb-check:[...]$1 = PackedInPacked { a: 1111, b: Packed { x: 2222, y: 3333, z: 4444 }, c: 5555, d: Packed { x: 6666, y: 7777, z: 8888 } }
+
+// lldb-command:print packedInUnpacked
+// lldb-check:[...]$2 = PackedInUnpacked { a: -1111, b: Packed { x: -2222, y: -3333, z: -4444 }, c: -5555, d: Packed { x: -6666, y: -7777, z: -8888 } }
+
+// lldb-command:print unpackedInPacked
+// lldb-check:[...]$3 = UnpackedInPacked { a: 987, b: Unpacked { x: 876, y: 765, z: 654 }, c: Unpacked { x: 543, y: 432, z: 321 }, d: 210 }
+
+// lldb-command:print packedInPackedWithDrop
+// lldb-check:[...]$4 = PackedInPackedWithDrop { a: 11, b: Packed { x: 22, y: 33, z: 44 }, c: 55, d: Packed { x: 66, y: 77, z: 88 } }
+
+// lldb-command:print packedInUnpackedWithDrop
+// lldb-check:[...]$5 = PackedInUnpackedWithDrop { a: -11, b: Packed { x: -22, y: -33, z: -44 }, c: -55, d: Packed { x: -66, y: -77, z: -88 } }
+
+// lldb-command:print unpackedInPackedWithDrop
+// lldb-check:[...]$6 = UnpackedInPackedWithDrop { a: 98, b: Unpacked { x: 87, y: 76, z: 65 }, c: Unpacked { x: 54, y: 43, z: 32 }, d: 21 }
+
+// lldb-command:print deeplyNested
+// lldb-check:[...]$7 = DeeplyNested { a: PackedInPacked { a: 1, b: Packed { x: 2, y: 3, z: 4 }, c: 5, d: Packed { x: 6, y: 7, z: 8 } }, b: UnpackedInPackedWithDrop { a: 9, b: Unpacked { x: 10, y: 11, z: 12 }, c: Unpacked { x: 13, y: 14, z: 15 }, d: 16 }, c: PackedInUnpacked { a: 17, b: Packed { x: 18, y: 19, z: 20 }, c: 21, d: Packed { x: 22, y: 23, z: 24 } }, d: PackedInUnpackedWithDrop { a: 25, b: Packed { x: 26, y: 27, z: 28 }, c: 29, d: Packed { x: 30, y: 31, z: 32 } }, e: UnpackedInPacked { a: 33, b: Unpacked { x: 34, y: 35, z: 36 }, c: Unpacked { x: 37, y: 38, z: 39 }, d: 40 }, f: PackedInPackedWithDrop { a: 41, b: Packed { x: 42, y: 43, z: 44 }, c: 45, d: Packed { x: 46, y: 47, z: 48 } } }
+
+
#![allow(unused_variable)]
#[packed]
}
};
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print sizeof(packedInPacked)
// gdb-check:$6 = 40
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print packed
+// lldb-check:[...]$0 = Packed { x: 123, y: 234, z: 345 }
+
+// lldb-command:print packedInPacked
+// lldb-check:[...]$1 = PackedInPacked { a: 1111, b: Packed { x: 2222, y: 3333, z: 4444 }, c: 5555, d: Packed { x: 6666, y: 7777, z: 8888 } }
+
+// lldb-command:print packedInUnpacked
+// lldb-check:[...]$2 = PackedInUnpacked { a: -1111, b: Packed { x: -2222, y: -3333, z: -4444 }, c: -5555, d: Packed { x: -6666, y: -7777, z: -8888 } }
+
+// lldb-command:print unpackedInPacked
+// lldb-check:[...]$3 = UnpackedInPacked { a: 987, b: Unpacked { x: 876, y: 765, z: 654, w: 543 }, c: Unpacked { x: 432, y: 321, z: 210, w: 109 }, d: -98 }
+
+// lldb-command:print sizeof(packed)
+// lldb-check:[...]$4 = 14
+
+// lldb-command:print sizeof(packedInPacked)
+// lldb-check:[...]$5 = 40
+
#![allow(unused_variable)]
#[packed]
d: -98
};
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
+// ignore-lldb
+
// compile-flags:-g
// gdb-command:run
// ignore-tidy-linelength
// ignore-android: FIXME(#10381)
+// ignore-lldb
#![feature(managed_boxes)]
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$15 = -10
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Struct { x: 100 }
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = -2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Struct { x: 100 }
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Struct { x: 200 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10
+// lldb-command:continue
+
+
struct Struct {
x: int
}
trait Trait {
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_by_val(self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
fn self_owned(~self, arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$1 = {x = 987}
// gdb-command:print arg1
// gdb-check:$2 = -1
-// gdb-command:print/d arg2
-// gdb-check:$3 = -2
+// gdb-command:print arg2
+// gdb-check:$3 = 2
// gdb-command:continue
// STACK BY VAL
// gdb-check:$15 = -10.5
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STACK BY REF
+// lldb-command:print *self
+// lldb-check:[...]$0 = Struct { x: 987 }
+// lldb-command:print arg1
+// lldb-check:[...]$1 = -1
+// lldb-command:print arg2
+// lldb-check:[...]$2 = 2
+// lldb-command:continue
+
+// STACK BY VAL
+// lldb-command:print self
+// lldb-check:[...]$3 = Struct { x: 987 }
+// lldb-command:print arg1
+// lldb-check:[...]$4 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$5 = -4
+// lldb-command:continue
+
+// OWNED BY REF
+// lldb-command:print *self
+// lldb-check:[...]$6 = Struct { x: 879 }
+// lldb-command:print arg1
+// lldb-check:[...]$7 = -5
+// lldb-command:print arg2
+// lldb-check:[...]$8 = -6
+// lldb-command:continue
+
+// OWNED BY VAL
+// lldb-command:print self
+// lldb-check:[...]$9 = Struct { x: 879 }
+// lldb-command:print arg1
+// lldb-check:[...]$10 = -7
+// lldb-command:print arg2
+// lldb-check:[...]$11 = -8
+// lldb-command:continue
+
+// OWNED MOVED
+// lldb-command:print *self
+// lldb-check:[...]$12 = Struct { x: 879 }
+// lldb-command:print arg1
+// lldb-check:[...]$13 = -9
+// lldb-command:print arg2
+// lldb-check:[...]$14 = -10.5
+// lldb-command:continue
+
+
struct Struct {
x: int
}
trait Trait {
fn self_by_ref<T>(&self, arg1: int, arg2: T) -> int {
- zzz();
+ zzz(); // #break
arg1
}
fn self_by_val<T>(self, arg1: int, arg2: T) -> int {
- zzz();
+ zzz(); // #break
arg1
}
fn self_owned<T>(~self, arg1: int, arg2: T) -> int {
- zzz();
+ zzz(); // #break
arg1
}
}
fn main() {
let stack = Struct { x: 987 };
- let _ = stack.self_by_ref(-1, -2_i8);
+ let _ = stack.self_by_ref(-1, 2_u16);
let _ = stack.self_by_val(-3, -4_i16);
let owned = box Struct { x: 879 };
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$6 = 20
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = false
+// lldb-command:print y
+// lldb-check:[...]$1 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 10
+// lldb-command:print y
+// lldb-check:[...]$3 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = 10.5
+// lldb-command:print y
+// lldb-check:[...]$5 = 20
+// lldb-command:continue
+
fn a_function(x: bool, y: bool) {
- zzz();
+ zzz(); // #break
sentinel();
let x = 10i;
- zzz();
+ zzz(); // #break
sentinel();
let x = 10.5f64;
let y = 20i;
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$6 = 20
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = false
+// lldb-command:print y
+// lldb-check:[...]$1 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 10
+// lldb-command:print y
+// lldb-check:[...]$3 = true
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = 10.5
+// lldb-command:print y
+// lldb-check:[...]$5 = 20
+// lldb-command:continue
+
fn main() {
let x = false;
let y = true;
- zzz();
+ zzz(); // #break
sentinel();
let x = 10i;
- zzz();
+ zzz(); // #break
sentinel();
let x = 10.5f64;
let y = 20i;
- zzz();
+ zzz(); // #break
sentinel();
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// Need a fix for LLDB first...
+// ignore-lldb
+
// ignore-android: FIXME(#10381)
// compile-flags:-g
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:continue
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = false
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = false
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$2 = 10
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$3 = 10
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$4 = 10.5
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$5 = 10
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$6 = false
+// lldb-command:continue
+
fn main() {
let x = false;
- zzz();
+ zzz(); // #break
sentinel();
{
- zzz();
+ zzz(); // #break
sentinel();
let x = 10i;
- zzz();
+ zzz(); // #break
sentinel();
{
- zzz();
+ zzz(); // #break
sentinel();
let x = 10.5f64;
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
- zzz();
+ zzz(); // #break
sentinel();
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-check:$19 = {a = 10019, b = -10020, x = -10016, y = -10017.5, z = 10018}
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print no_padding16
+// lldb-check:[...]$0 = NoPadding16 { x: 10000, y: -10001 }
+
+// lldb-command:print no_padding32
+// lldb-check:[...]$1 = NoPadding32 { x: -10002, y: -10003.5, z: 10004 }
+
+// lldb-command:print no_padding64
+// lldb-check:[...]$2 = NoPadding64 { x: -10005.5, y: 10006, z: 10007 }
+
+// lldb-command:print no_padding163264
+// lldb-check:[...]$3 = NoPadding163264 { a: -10008, b: 10009, c: 10010, d: 10011 }
+
+// lldb-command:print internal_padding
+// lldb-check:[...]$4 = InternalPadding { x: 10012, y: -10013 }
+
+// lldb-command:print padding_at_end
+// lldb-check:[...]$5 = PaddingAtEnd { x: -10014, y: 10015 }
+
#![feature(struct_inherit)];
#![allow(unused_variable)];
#![allow(dead_code)];
PADDING_AT_END.y = 28;
}
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:print 'simple-tuple::PADDING_AT_END'
// gdb-check:$21 = {116, 117}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print/d noPadding8
+// lldb-check:[...]$0 = (-100, 100)
+// lldb-command:print noPadding16
+// lldb-check:[...]$1 = (0, 1, 2)
+// lldb-command:print noPadding32
+// lldb-check:[...]$2 = (3, 4.5, 5)
+// lldb-command:print noPadding64
+// lldb-check:[...]$3 = (6, 7.5, 8)
+
+// lldb-command:print internalPadding1
+// lldb-check:[...]$4 = (9, 10)
+// lldb-command:print internalPadding2
+// lldb-check:[...]$5 = (11, 12, 13, 14)
+
+// lldb-command:print paddingAtEnd
+// lldb-check:[...]$6 = (15, 16)
+
#![allow(unused_variable)]
#![allow(dead_code)]
PADDING_AT_END = (116, 117);
}
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$5 = 5
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// STRUCT
+// lldb-command:print arg1
+// lldb-check:[...]$0 = 1
+// lldb-command:print arg2
+// lldb-check:[...]$1 = 2
+// lldb-command:continue
+
+// ENUM
+// lldb-command:print arg1
+// lldb-check:[...]$2 = -3
+// lldb-command:print arg2
+// lldb-check:[...]$3 = 4.5
+// lldb-command:print arg3
+// lldb-check:[...]$4 = 5
+// lldb-command:continue
+
#![feature(struct_variant)]
struct Struct {
impl Struct {
fn static_method(arg1: int, arg2: int) -> int {
- zzz();
+ zzz(); // #break
arg1 + arg2
}
}
impl Enum {
fn static_method(arg1: int, arg2: f64, arg3: uint) -> int {
- zzz();
+ zzz(); // #break
arg1
}
}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print union on
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print univariant
// gdb-check:$3 = {{{x = 123, y = 456, z = 789}}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print case1
+// lldb-check:[...]$0 = Case1(0, Struct { x: 2088533116, y: 2088533116, z: 31868 })
+// lldb-command:print case2
+// lldb-check:[...]$1 = Case2(0, 1229782938247303441, 4369)
+
+// lldb-command:print univariant
+// lldb-check:[...]$2 = TheOnlyCase(Struct { x: 123, y: 456, z: 789 })
+
#![allow(unused_variable)]
struct Struct {
let univariant = TheOnlyCase(Struct { x: 123, y: 456, z: 789 });
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// ignore-tidy-linelength
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print padding_at_end_parent
// gdb-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print three_simple_structs
+// lldb-check:[...]$0 = ThreeSimpleStructs { x: Simple { x: 1 }, y: Simple { x: 2 }, z: Simple { x: 3 } }
+
+// lldb-command:print internal_padding_parent
+// lldb-check:[...]$1 = InternalPaddingParent { x: InternalPadding { x: 4, y: 5 }, y: InternalPadding { x: 6, y: 7 }, z: InternalPadding { x: 8, y: 9 } }
+
+// lldb-command:print padding_at_end_parent
+// lldb-check:[...]$2 = PaddingAtEndParent { x: PaddingAtEnd { x: 10, y: 11 }, y: PaddingAtEnd { x: 12, y: 13 }, z: PaddingAtEnd { x: 14, y: 15 } }
+
+// lldb-command:print mixed
+// lldb-check:[...]$3 = Mixed { x: PaddingAtEnd { x: 16, y: 17 }, y: InternalPadding { x: 18, y: 19 }, z: Simple { x: 20 }, w: 21 }
+
+// lldb-command:print bag
+// lldb-check:[...]$4 = Bag { x: Simple { x: 22 } }
+
+// lldb-command:print bag_in_bag
+// lldb-check:[...]$5 = BagInBag { x: Bag { x: Simple { x: 23 } } }
+
+// lldb-command:print tjo
+// lldb-check:[...]$6 = ThatsJustOverkill { x: BagInBag { x: Bag { x: Simple { x: 24 } } } }
+
+// lldb-command:print tree
+// lldb-check:[...]$7 = Tree { x: Simple { x: 25 }, y: InternalPaddingParent { x: InternalPadding { x: 26, y: 27 }, y: InternalPadding { x: 28, y: 29 }, z: InternalPadding { x: 30, y: 31 } }, z: BagInBag { x: Bag { x: Simple { x: 32 } } } }
+
#![allow(unused_variable)]
struct Simple {
}
};
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print union on
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print univariant
// gdb-check:$4 = {{a = -1}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print case1
+// lldb-check:[...]$0 = Case1 { a: 0, b: 31868, c: 31868, d: 31868, e: 31868 }
+
+// lldb-command:print case2
+// lldb-check:[...]$1 = Case2 { a: 0, b: 286331153, c: 286331153 }
+
+// lldb-command:print case3
+// lldb-check:[...]$2 = Case3 { a: 0, b: 6438275382588823897 }
+
+// lldb-command:print univariant
+// lldb-check:[...]$3 = TheOnlyCase { a: -1 }
+
#![allow(unused_variable)]
#![feature(struct_variant)]
let univariant = TheOnlyCase { a: -1 };
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print nested
// gdb-check:$4 = {a = {a = {x = 7890, y = 9870}}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print simple
+// lldb-check:[...]$0 = WithDestructor { x: 10, y: 20 }
+
+// lldb-command:print noDestructor
+// lldb-check:[...]$1 = NoDestructorGuarded { a: NoDestructor { x: 10, y: 20 }, guard: -1 }
+
+// lldb-command:print withDestructor
+// lldb-check:[...]$2 = WithDestructorGuarded { a: WithDestructor { x: 10, y: 20 }, guard: -1 }
+
+// lldb-command:print nested
+// lldb-check:[...]$3 = NestedOuter { a: NestedInner { a: WithDestructor { x: 7890, y: 9870 } } }
+
#![allow(unused_variable)]
struct NoDestructor {
// <-------NestedOuter-------->
let nested = NestedOuter { a: NestedInner { a: WithDestructor { x: 7890, y: 9870 } } };
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
-some text to include in another file as string 1
+some text to include in another file as string 1
\ No newline at end of file
-some text to include in another file as string 2
+some text to include in another file as string 2.
\ No newline at end of file
-some text to include in another file as string 3
+some text to include in another file as string 3..
\ No newline at end of file
// except according to those terms.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:continue
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print no_padding1
+// lldb-check:[...]$0 = { x = (0, 1) y = 2 z = (3, 4, 5) }
+// lldb-command:print no_padding2
+// lldb-check:[...]$1 = { x = (6, 7) y = { = (8, 9) = 10 } }
+
+// lldb-command:print tuple_internal_padding
+// lldb-check:[...]$2 = { x = (11, 12) y = (13, 14) }
+// lldb-command:print struct_internal_padding
+// lldb-check:[...]$3 = { x = (15, 16) y = (17, 18) }
+// lldb-command:print both_internally_padded
+// lldb-check:[...]$4 = { x = (19, 20, 21) y = (22, 23) }
+
+// lldb-command:print single_tuple
+// lldb-check:[...]$5 = { x = (24, 25, 26) }
+
+// lldb-command:print tuple_padded_at_end
+// lldb-check:[...]$6 = { x = (27, 28) y = (29, 30) }
+// lldb-command:print struct_padded_at_end
+// lldb-check:[...]$7 = { x = (31, 32) y = (33, 34) }
+// lldb-command:print both_padded_at_end
+// lldb-check:[...]$8 = { x = (35, 36, 37) y = (38, 39) }
+
+// lldb-command:print mixed_padding
+// lldb-check:[...]$9 = { x = { = (40, 41, 42) = (43, 44) } y = (45, 46, 47, 48) }
+
struct Struct {
x: int
}
trait Trait {
fn generic_static_default_method<T>(arg1: int, arg2: T) -> int {
- zzz();
+ zzz(); // #break
arg1
}
}
// ignore-android: FIXME(#10381)
+// ignore-lldb
+
// compile-flags:-g
// gdb-command:run
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print padding_at_end2
// gdb-check:$7 = {{21, 22}, 23}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print no_padding1
+// lldb-check:[...]$0 = ((0, 1), 2, 3)
+// lldb-command:print no_padding2
+// lldb-check:[...]$1 = (4, (5, 6), 7)
+// lldb-command:print no_padding3
+// lldb-check:[...]$2 = (8, 9, (10, 11))
+
+// lldb-command:print internal_padding1
+// lldb-check:[...]$3 = (12, (13, 14))
+// lldb-command:print internal_padding2
+// lldb-check:[...]$4 = (15, (16, 17))
+
+// lldb-command:print padding_at_end1
+// lldb-check:[...]$5 = (18, (19, 20))
+// lldb-command:print padding_at_end2
+// lldb-check:[...]$6 = ((21, 22), 23)
+
#![allow(unused_variable)]
fn main() {
let padding_at_end1: (i32, (i32, i16)) = (18, (19, 20));
let padding_at_end2: ((i32, i16), i32) = ((21, 22), 23);
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-check:$6 = {-10014, 10015}
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print no_padding16
+// lldb-check:[...]$0 = NoPadding16(10000, -10001)
+
+// lldb-command:print no_padding32
+// lldb-check:[...]$1 = NoPadding32(-10002, -10003.5, 10004)
+
+// lldb-command:print no_padding64
+// lldb-check:[...]$2 = NoPadding64(-10005.5, 10006, 10007)
+
+// lldb-command:print no_padding163264
+// lldb-check:[...]$3 = NoPadding163264(-10008, 10009, 10010, 10011)
+
+// lldb-command:print internal_padding
+// lldb-check:[...]$4 = InternalPadding(10012, -10013)
+
+// lldb-command:print padding_at_end
+// lldb-check:[...]$5 = PaddingAtEnd(-10014, 10015)
+
// This test case mainly makes sure that no field names are generated for tuple structs (as opposed
// to all fields having the name "<unnamed_field>"). Otherwise they are handled the same a normal
// structs.
let internal_padding = InternalPadding(10012, -10013);
let padding_at_end = PaddingAtEnd(-10014, 10015);
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print union on
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print univariant
// gdb-check:$4 = {{-1}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print case1
+// lldb-check:[...]$0 = Case1(0, 31868, 31868, 31868, 31868)
+
+// lldb-command:print case2
+// lldb-check:[...]$1 = Case2(0, 286331153, 286331153)
+
+// lldb-command:print case3
+// lldb-check:[...]$2 = Case3(0, 6438275382588823897)
+
+// lldb-command:print univariant
+// lldb-check:[...]$3 = TheOnlyCase(-1)
+
#![allow(unused_variable)]
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
let univariant = TheOnlyCase(-1);
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print *univariant
// gdb-check:$3 = {{123234}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *the_a
+// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 }
+
+// lldb-command:print *the_b
+// lldb-check:[...]$1 = TheB(0, 286331153, 286331153)
+
+// lldb-command:print *univariant
+// lldb-check:[...]$2 = TheOnlyCase(123234)
+
#![allow(unused_variable)]
#![feature(struct_variant)]
let univariant = box TheOnlyCase(123234);
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-check:$14 = 8
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print variable
+// lldb-check:[...]$0 = 1
+// lldb-command:print constant
+// lldb-check:[...]$1 = 2
+// lldb-command:print a_struct
+// lldb-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *struct_ref
+// lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *owned
+// lldb-check:[...]$4 = 6
+// lldb-command:print managed->val
+// lldb-check:[...]$5 = 7
+// lldb-command:print closure_local
+// lldb-check:[...]$6 = 8
+// lldb-command:continue
+
+// lldb-command:print variable
+// lldb-check:[...]$7 = 1
+// lldb-command:print constant
+// lldb-check:[...]$8 = 2
+// lldb-command:print a_struct
+// lldb-check:[...]$9 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *struct_ref
+// lldb-check:[...]$10 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *owned
+// lldb-check:[...]$11 = 6
+// lldb-command:print managed->val
+// lldb-check:[...]$12 = 7
+// lldb-command:print closure_local
+// lldb-check:[...]$13 = 8
+// lldb-command:continue
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
let closure_local = 8;
let nested_closure = || {
- zzz();
+ zzz(); // #break
variable = constant + a_struct.a + struct_ref.a + *owned + *managed + closure_local;
};
- zzz();
+ zzz(); // #break
nested_closure();
};
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print *owned
// gdb-check:$3 = 5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print constant
+// lldb-check:[...]$0 = 1
+// lldb-command:print a_struct
+// lldb-check:[...]$1 = Struct { a: -2, b: 3.5, c: 4 }
+// lldb-command:print *owned
+// lldb-check:[...]$2 = 5
+
#![allow(unused_variable)]
struct Struct {
let owned = box 5;
let closure: proc() = proc() {
- zzz();
+ zzz(); // #break
do_something(&constant, &a_struct.a, owned);
};
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
// gdb-command:print managed->val
// gdb-check:$6 = 7
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print variable
+// lldb-check:[...]$0 = 1
+// lldb-command:print constant
+// lldb-check:[...]$1 = 2
+// lldb-command:print a_struct
+// lldb-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *struct_ref
+// lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
+// lldb-command:print *owned
+// lldb-check:[...]$4 = 6
+// lldb-command:print managed->val
+// lldb-check:[...]$5 = 7
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
let managed = box(GC) 7;
let closure = || {
- zzz();
+ zzz(); // #break
variable = constant + a_struct.a + struct_ref.a + *owned + *managed;
};
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print *((int64_t[2]*)('vec-slices::MUT_VECT_SLICE'.data_ptr))
// gdb-check:$15 = {64, 65}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print empty
+// lldb-check:[...]$0 = &[]
+
+// lldb-command:print singleton
+// lldb-check:[...]$1 = &[1]
+
+// lldb-command:print multiple
+// lldb-check:[...]$2 = &[2, 3, 4, 5]
+
+// lldb-command:print slice_of_slice
+// lldb-check:[...]$3 = &[3, 4]
+
+// lldb-command:print padded_tuple
+// lldb-check:[...]$4 = &[(6, 7), (8, 9)]
+
+// lldb-command:print padded_struct
+// lldb-check:[...]$5 = &[AStruct { x: 10, y: 11, z: 12 }, AStruct { x: 13, y: 14, z: 15 }]
+
#![allow(unused_variable)]
struct AStruct {
MUT_VECT_SLICE = VECT_SLICE;
}
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:print vec::VECT
// gdb-check:$2 = {4, 5, 6}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print a
+// lldb-check:[...]$0 = [1, 2, 3]
+
#![allow(unused_variable)]
static mut VECT: [i32, ..3] = [1, 2, 3];
VECT[2] = 6;
}
- zzz();
+ zzz(); // #break
}
fn zzz() {()}