2014-02-07 20:08:32 +01:00
|
|
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
2013-08-05 11:12:40 +02: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 20:08:32 +01:00
|
|
|
// ignore-android: FIXME(#10381)
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-02-06 19:57:09 -08:00
|
|
|
// compile-flags:-g
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:rbreak zzz
|
|
|
|
// gdb-command:run
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$1 = 231
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$2 = 232
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$3 = 233
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$4 = 232
|
|
|
|
// gdb-command:print local_to_arm
|
|
|
|
// gdb-check:$5 = 234
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$6 = 236
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$7 = 232
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$8 = 237
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$9 = 232
|
|
|
|
// gdb-command:print local_to_arm
|
|
|
|
// gdb-check:$10 = 238
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$11 = 239
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$12 = 232
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$13 = 241
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$14 = 232
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$15 = 243
|
|
|
|
// gdb-command:print *local_to_arm
|
|
|
|
// gdb-check:$16 = 244
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:finish
|
|
|
|
// gdb-command:print shadowed
|
|
|
|
// gdb-check:$17 = 231
|
|
|
|
// gdb-command:print not_shadowed
|
|
|
|
// gdb-check:$18 = 232
|
|
|
|
// gdb-command:continue
|
2013-08-05 11:12:40 +02:00
|
|
|
|
|
|
|
struct Struct {
|
|
|
|
x: int,
|
|
|
|
y: int
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
2014-06-27 12:30:25 -07:00
|
|
|
let shadowed = 231i;
|
|
|
|
let not_shadowed = 232i;
|
2013-08-05 11:12:40 +02:00
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
|
2014-06-27 12:30:25 -07:00
|
|
|
match (233i, 234i) {
|
2013-08-05 11:12:40 +02:00
|
|
|
(shadowed, local_to_arm) => {
|
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-27 12:30:25 -07:00
|
|
|
match (235i, 236i) {
|
2013-08-05 11:12:40 +02:00
|
|
|
// with literal
|
|
|
|
(235, shadowed) => {
|
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
2014-06-13 19:09:12 -07:00
|
|
|
match (Struct { x: 237, y: 238 }) {
|
2013-08-05 11:12:40 +02:00
|
|
|
Struct { x: shadowed, y: local_to_arm } => {
|
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-13 19:09:12 -07:00
|
|
|
match (Struct { x: 239, y: 240 }) {
|
2013-08-05 11:12:40 +02:00
|
|
|
// ignored field
|
2013-11-28 12:22:53 -08:00
|
|
|
Struct { x: shadowed, .. } => {
|
2013-08-05 11:12:40 +02:00
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-13 19:09:12 -07:00
|
|
|
match (Struct { x: 241, y: 242 }) {
|
2013-08-05 11:12:40 +02:00
|
|
|
// with literal
|
|
|
|
Struct { x: shadowed, y: 242 } => {
|
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
2014-06-27 12:30:25 -07:00
|
|
|
match (243i, 244i) {
|
2013-08-05 11:12:40 +02:00
|
|
|
(shadowed, ref local_to_arm) => {
|
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
zzz();
|
|
|
|
sentinel();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|
|
|
|
fn sentinel() {()}
|