2014-02-07 13:08:32 -06:00
|
|
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
2013-06-24 10:18:10 -05:00
|
|
|
// 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.
|
|
|
|
|
2014-02-07 13:08:32 -06:00
|
|
|
// ignore-android: FIXME(#10381)
|
2013-11-04 00:53:01 -06:00
|
|
|
|
2013-07-02 03:33:51 -05:00
|
|
|
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
|
2013-06-24 10:18:10 -05:00
|
|
|
// its numerical value.
|
|
|
|
|
2014-02-06 21:57:09 -06:00
|
|
|
// compile-flags:-g
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:rbreak zzz
|
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print *bool_ref
|
|
|
|
// gdb-check:$1 = true
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *int_ref
|
|
|
|
// gdb-check:$2 = -1
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *char_ref
|
|
|
|
// gdb-check:$3 = 97
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i8_ref
|
|
|
|
// gdb-check:$4 = 68 'D'
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i16_ref
|
|
|
|
// gdb-check:$5 = -16
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i32_ref
|
|
|
|
// gdb-check:$6 = -32
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *i64_ref
|
|
|
|
// gdb-check:$7 = -64
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *uint_ref
|
|
|
|
// gdb-check:$8 = 1
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u8_ref
|
|
|
|
// gdb-check:$9 = 100 'd'
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u16_ref
|
|
|
|
// gdb-check:$10 = 16
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u32_ref
|
|
|
|
// gdb-check:$11 = 32
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *u64_ref
|
|
|
|
// gdb-check:$12 = 64
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *f32_ref
|
|
|
|
// gdb-check:$13 = 2.5
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:print *f64_ref
|
|
|
|
// gdb-check:$14 = 3.5
|
2013-06-24 10:18:10 -05:00
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === 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
|
|
|
|
|
2014-04-14 10:30:31 -05:00
|
|
|
#![allow(unused_variable)]
|
2013-08-17 10:37:42 -05:00
|
|
|
|
2013-06-24 10:18:10 -05:00
|
|
|
fn main() {
|
|
|
|
let bool_val: bool = true;
|
2013-07-16 05:17:55 -05:00
|
|
|
let bool_ref: &bool = &bool_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let int_val: int = -1;
|
2013-07-16 05:17:55 -05:00
|
|
|
let int_ref: &int = &int_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let char_val: char = 'a';
|
2013-07-16 05:17:55 -05:00
|
|
|
let char_ref: &char = &char_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let i8_val: i8 = 68;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i8_ref: &i8 = &i8_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let i16_val: i16 = -16;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i16_ref: &i16 = &i16_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let i32_val: i32 = -32;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i32_ref: &i32 = &i32_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let uint_val: i64 = -64;
|
2013-07-16 05:17:55 -05:00
|
|
|
let i64_ref: &i64 = &uint_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let uint_val: uint = 1;
|
2013-07-16 05:17:55 -05:00
|
|
|
let uint_ref: &uint = &uint_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u8_val: u8 = 100;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u8_ref: &u8 = &u8_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u16_val: u16 = 16;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u16_ref: &u16 = &u16_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u32_val: u32 = 32;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u32_ref: &u32 = &u32_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let u64_val: u64 = 64;
|
2013-07-16 05:17:55 -05:00
|
|
|
let u64_ref: &u64 = &u64_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let f32_val: f32 = 2.5;
|
2013-07-16 05:17:55 -05:00
|
|
|
let f32_ref: &f32 = &f32_val;
|
2013-06-24 10:18:10 -05:00
|
|
|
|
|
|
|
let f64_val: f64 = 3.5;
|
2013-07-16 05:17:55 -05:00
|
|
|
let f64_ref: &f64 = &f64_val;
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
zzz(); // #break
|
2013-06-24 10:18:10 -05:00
|
|
|
}
|
|
|
|
|
2013-08-17 10:37:42 -05:00
|
|
|
fn zzz() {()}
|