2015-01-01 11:43:48 -06:00
|
|
|
//@ min-lldb-version: 310
|
|
|
|
|
|
|
|
//@ compile-flags:-g
|
|
|
|
|
|
|
|
#![allow(unused_variables)]
|
2015-09-19 15:33:47 -05:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2015-01-01 11:43:48 -06:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
|
|
|
|
|
|
|
// No need to actually run the debugger, just make sure that the compiler can
|
|
|
|
// handle locals in unreachable code.
|
|
|
|
|
|
|
|
fn after_return() {
|
|
|
|
return;
|
|
|
|
let x = "0";
|
|
|
|
let (ref y,z) = (1i32, 2u32);
|
|
|
|
match (20i32, 'c') {
|
|
|
|
(a, ref b) => {}
|
|
|
|
}
|
2015-01-31 11:20:46 -06:00
|
|
|
for a in &[111i32] {}
|
2015-03-05 03:46:45 -06:00
|
|
|
let test = if some_predicate() { 1 } else { 2 };
|
|
|
|
while some_predicate() {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
}
|
|
|
|
loop {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// nested block
|
|
|
|
{
|
|
|
|
let abc = !some_predicate();
|
|
|
|
|
|
|
|
{
|
|
|
|
let def = !some_predicate();
|
|
|
|
}
|
|
|
|
}
|
2015-01-01 11:43:48 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn after_panic() {
|
|
|
|
panic!();
|
|
|
|
let x = "0";
|
|
|
|
let (ref y,z) = (1i32, 2u32);
|
|
|
|
match (20i32, 'c') {
|
|
|
|
(a, ref b) => {}
|
|
|
|
}
|
2015-01-31 11:20:46 -06:00
|
|
|
for a in &[111i32] {}
|
2015-03-05 03:46:45 -06:00
|
|
|
let test = if some_predicate() { 1 } else { 2 };
|
|
|
|
while some_predicate() {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
}
|
|
|
|
loop {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// nested block
|
|
|
|
{
|
|
|
|
let abc = !some_predicate();
|
|
|
|
|
|
|
|
{
|
|
|
|
let def = !some_predicate();
|
|
|
|
}
|
|
|
|
}
|
2015-01-01 11:43:48 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn after_diverging_function() {
|
|
|
|
diverge();
|
|
|
|
let x = "0";
|
|
|
|
let (ref y,z) = (1i32, 2u32);
|
|
|
|
match (20i32, 'c') {
|
|
|
|
(a, ref b) => {}
|
|
|
|
}
|
2015-01-31 11:20:46 -06:00
|
|
|
for a in &[111i32] {}
|
2015-03-05 03:46:45 -06:00
|
|
|
let test = if some_predicate() { 1 } else { 2 };
|
|
|
|
while some_predicate() {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
}
|
|
|
|
loop {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// nested block
|
|
|
|
{
|
|
|
|
let abc = !some_predicate();
|
|
|
|
|
|
|
|
{
|
|
|
|
let def = !some_predicate();
|
|
|
|
}
|
|
|
|
}
|
2015-01-01 11:43:48 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn after_break() {
|
|
|
|
loop {
|
|
|
|
break;
|
|
|
|
let x = "0";
|
|
|
|
let (ref y,z) = (1i32, 2u32);
|
|
|
|
match (20i32, 'c') {
|
|
|
|
(a, ref b) => {}
|
|
|
|
}
|
2015-01-31 11:20:46 -06:00
|
|
|
for a in &[111i32] {}
|
2015-03-05 03:46:45 -06:00
|
|
|
let test = if some_predicate() { 1 } else { 2 };
|
|
|
|
while some_predicate() {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
}
|
|
|
|
loop {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// nested block
|
|
|
|
{
|
|
|
|
let abc = !some_predicate();
|
|
|
|
|
|
|
|
{
|
|
|
|
let def = !some_predicate();
|
|
|
|
}
|
|
|
|
}
|
2015-01-01 11:43:48 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn after_continue() {
|
2015-01-26 14:46:12 -06:00
|
|
|
for _ in 0..10i32 {
|
2015-03-05 03:46:45 -06:00
|
|
|
continue;
|
2015-01-01 11:43:48 -06:00
|
|
|
let x = "0";
|
|
|
|
let (ref y,z) = (1i32, 2u32);
|
|
|
|
match (20i32, 'c') {
|
|
|
|
(a, ref b) => {}
|
|
|
|
}
|
2015-01-31 11:20:46 -06:00
|
|
|
for a in &[111i32] {}
|
2015-03-05 03:46:45 -06:00
|
|
|
let test = if some_predicate() { 1 } else { 2 };
|
|
|
|
while some_predicate() {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
}
|
|
|
|
loop {
|
|
|
|
let abc = !some_predicate();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// nested block
|
|
|
|
{
|
|
|
|
let abc = !some_predicate();
|
|
|
|
|
|
|
|
{
|
|
|
|
let def = !some_predicate();
|
|
|
|
}
|
|
|
|
}
|
2015-01-01 11:43:48 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
after_return();
|
|
|
|
after_panic();
|
|
|
|
after_diverging_function();
|
|
|
|
after_break();
|
|
|
|
after_continue();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn diverge() -> ! {
|
|
|
|
panic!();
|
|
|
|
}
|
2015-03-05 03:46:45 -06:00
|
|
|
|
|
|
|
fn some_predicate() -> bool { true || false }
|