2014-04-24 04:35:48 -05:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
// ignore-android: FIXME(#10381)
|
2014-10-09 09:31:03 -05:00
|
|
|
// min-lldb-version: 310
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
// compile-flags:-g
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 04:35:48 -05:00
|
|
|
// gdb-command:run
|
|
|
|
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$1 = 0
|
|
|
|
|
|
|
|
// STRUCT EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$2 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$3 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$4 = 11
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$5 = 1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$6 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$7 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$8 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// FUNCTION CALL
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$9 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$10 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$11 = 12
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$12 = 2
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$13 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$14 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$15 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// TUPLE EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$16 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$17 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$18 = 13
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$19 = 3
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$20 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$21 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$22 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// VEC EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$23 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$24 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$25 = 14
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$26 = 4
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$27 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$28 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$29 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// REPEAT VEC EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$30 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$31 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$32 = 15
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$33 = 5
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$34 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$35 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$36 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// ASSIGNMENT EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$37 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$38 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$39 = 16
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$40 = 6
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$41 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$42 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$43 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
|
|
|
|
// ARITHMETIC EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$44 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$45 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$46 = 17
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$47 = 7
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$48 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$49 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$50 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// INDEX EXPRESSION
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$51 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$52 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$53 = 18
|
|
|
|
// gdb-command:print 'lexical-scopes-in-block-expression::MUT_INT'
|
|
|
|
// gdb-check:$54 = 8
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$55 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print val
|
|
|
|
// gdb-check:$56 = -1
|
|
|
|
// gdb-command:print ten
|
|
|
|
// gdb-check:$57 = 10
|
|
|
|
// gdb-command:continue
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
|
|
|
|
// === 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
|
|
|
|
|
2014-10-27 17:37:07 -05:00
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![allow(unused_assignments)]
|
2014-12-03 16:48:18 -06:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
static mut MUT_INT: int = 0;
|
|
|
|
|
|
|
|
struct Point {
|
|
|
|
x: int,
|
|
|
|
y: int
|
|
|
|
}
|
|
|
|
|
|
|
|
fn a_function(x: int) -> int {
|
|
|
|
x + 1
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
2014-06-27 14:30:25 -05:00
|
|
|
let val = -1i;
|
|
|
|
let ten = 10i;
|
2014-04-24 04:35:48 -05:00
|
|
|
|
|
|
|
// surrounded by struct expression
|
|
|
|
let point = Point {
|
|
|
|
x: {
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 1;
|
|
|
|
unsafe {MUT_INT = 1;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
|
|
|
},
|
|
|
|
y: 10
|
|
|
|
};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
// surrounded by function call
|
|
|
|
let _ = a_function({
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 2;
|
|
|
|
unsafe {MUT_INT = 2;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
|
|
|
});
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
|
|
|
|
// surrounded by tup
|
|
|
|
let _ = ({
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 3;
|
|
|
|
unsafe {MUT_INT = 3;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
2014-06-27 14:30:25 -05:00
|
|
|
}, 0i);
|
2014-04-24 04:35:48 -05:00
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
// surrounded by vec
|
|
|
|
let _ = [{
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 4;
|
|
|
|
unsafe {MUT_INT = 4;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
|
|
|
}, 0, 0];
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
// surrounded by repeat vec
|
|
|
|
let _ = [{
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 5;
|
|
|
|
unsafe {MUT_INT = 5;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
2014-12-19 20:20:51 -06:00
|
|
|
}; 10];
|
2014-04-24 04:35:48 -05:00
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
// assignment expression
|
|
|
|
let mut var = 0;
|
|
|
|
var = {
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 6;
|
|
|
|
unsafe {MUT_INT = 6;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
|
|
|
};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
// arithmetic expression
|
|
|
|
var = 10 + -{
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 7;
|
|
|
|
unsafe {MUT_INT = 7;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val
|
|
|
|
} * 5;
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
// index expression
|
2014-12-19 20:20:51 -06:00
|
|
|
let a_vector = [10i; 20];
|
2014-04-24 04:35:48 -05:00
|
|
|
let _ = a_vector[{
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
let val = ten + 8;
|
|
|
|
unsafe {MUT_INT = 8;};
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
|
|
|
|
val as uint
|
|
|
|
}];
|
|
|
|
|
2014-07-09 07:46:09 -05:00
|
|
|
zzz(); // #break
|
2014-04-24 04:35:48 -05:00
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|
|
|
|
fn sentinel() {()}
|