diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-04-07 22:43:46 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-04-11 20:51:45 +0300 |
| commit | 373b6ec935fb64767d03da9a79d4614ccbb3f084 (patch) | |
| tree | ea81a53af75b514e9676f3b83ec00440a2f41003 /src/test/debuginfo | |
| parent | ce8d4a21348c6185e7df2817a80910f86e9db205 (diff) | |
| download | rust-373b6ec935fb64767d03da9a79d4614ccbb3f084.tar.gz rust-373b6ec935fb64767d03da9a79d4614ccbb3f084.zip | |
tests: update for MIR debuginfo.
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/associated-types.rs | 3 | ||||
| -rw-r--r-- | src/test/debuginfo/c-style-enum.rs | 3 | ||||
| -rw-r--r-- | src/test/debuginfo/function-prologue-stepping-no-stack-check.rs | 13 | ||||
| -rw-r--r-- | src/test/debuginfo/no-debug-attribute.rs | 3 | ||||
| -rw-r--r-- | src/test/debuginfo/var-captured-in-nested-closure.rs | 11 | ||||
| -rw-r--r-- | src/test/debuginfo/var-captured-in-sendable-closure.rs | 11 | ||||
| -rw-r--r-- | src/test/debuginfo/var-captured-in-stack-closure.rs | 11 |
7 files changed, 42 insertions, 13 deletions
diff --git a/src/test/debuginfo/associated-types.rs b/src/test/debuginfo/associated-types.rs index ebaad663bb4..8615c8a7ef6 100644 --- a/src/test/debuginfo/associated-types.rs +++ b/src/test/debuginfo/associated-types.rs @@ -80,7 +80,7 @@ #![allow(unused_variables)] #![allow(dead_code)] -#![feature(omit_gdb_pretty_printer_section)] +#![feature(omit_gdb_pretty_printer_section, rustc_attrs)] #![omit_gdb_pretty_printer_section] trait TraitWithAssocType { @@ -127,6 +127,7 @@ fn assoc_tuple<T: TraitWithAssocType>(arg: (T, T::Type)) { zzz(); // #break } +#[rustc_no_mir] // FIXME(#32790) MIR reuses scopes for match arms. fn assoc_enum<T: TraitWithAssocType>(arg: Enum<T>) { match arg { diff --git a/src/test/debuginfo/c-style-enum.rs b/src/test/debuginfo/c-style-enum.rs index 4eec26d335c..dbd336d2dc6 100644 --- a/src/test/debuginfo/c-style-enum.rs +++ b/src/test/debuginfo/c-style-enum.rs @@ -157,7 +157,8 @@ fn main() { zzz(); // #break - let a = SINGLE_VARIANT; + // Borrow to avoid an eager load of the constant value in the static. + let a = &SINGLE_VARIANT; let a = unsafe { AUTO_ONE }; let a = unsafe { MANUAL_ONE }; } diff --git a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs index b5b6ca75727..e90f7d649f5 100644 --- a/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs +++ b/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs @@ -247,10 +247,11 @@ // lldb-command:continue #![allow(dead_code, unused_assignments, unused_variables)] -#![feature(omit_gdb_pretty_printer_section)] +#![feature(omit_gdb_pretty_printer_section, rustc_attrs)] #![omit_gdb_pretty_printer_section] #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn immediate_args(a: isize, b: bool, c: f64) { println!(""); } @@ -267,43 +268,51 @@ struct BigStruct { } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn non_immediate_args(a: BigStruct, b: BigStruct) { println!(""); } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn binding(a: i64, b: u64, c: f64) { let x = 0; println!(""); } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn assignment(mut a: u64, b: u64, c: f64) { a = b; println!(""); } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn function_call(x: u64, y: u64, z: f64) { println!("Hi!") } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn identifier(x: u64, y: u64, z: f64) -> u64 { x } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn return_expr(x: u64, y: u64, z: f64) -> u64 { return x; } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 { x + y } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn if_expr(x: u64, y: u64, z: f64) -> u64 { if x + y < 1000 { x @@ -313,6 +322,7 @@ fn if_expr(x: u64, y: u64, z: f64) -> u64 { } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn while_expr(mut x: u64, y: u64, z: u64) -> u64 { while x + y < 1000 { x += z @@ -321,6 +331,7 @@ fn while_expr(mut x: u64, y: u64, z: u64) -> u64 { } #[no_stack_check] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names. fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 { loop { x += z; diff --git a/src/test/debuginfo/no-debug-attribute.rs b/src/test/debuginfo/no-debug-attribute.rs index 6bdd68d5e26..ea237e5970c 100644 --- a/src/test/debuginfo/no-debug-attribute.rs +++ b/src/test/debuginfo/no-debug-attribute.rs @@ -23,10 +23,11 @@ // gdb-command:continue #![allow(unused_variables)] -#![feature(no_debug)] +#![feature(no_debug, rustc_attrs)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is inaccurate for returns. fn function_with_debuginfo() { let abc = 10_usize; return (); // #break diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index 7090377e5db..d2af828a890 100644 --- a/src/test/debuginfo/var-captured-in-nested-closure.rs +++ b/src/test/debuginfo/var-captured-in-nested-closure.rs @@ -78,7 +78,7 @@ // lldb-command:continue #![allow(unused_variables)] -#![feature(box_syntax)] +#![feature(box_syntax, rustc_attrs, stmt_expr_attributes)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -88,6 +88,7 @@ struct Struct { c: usize } +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. fn main() { let mut variable = 1; let constant = 2; @@ -101,10 +102,14 @@ fn main() { let struct_ref = &a_struct; let owned: Box<_> = box 6; - let mut closure = || { + let mut closure = + #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. + || { let closure_local = 8; - let mut nested_closure = || { + let mut nested_closure = + #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. + || { zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned + closure_local; }; diff --git a/src/test/debuginfo/var-captured-in-sendable-closure.rs b/src/test/debuginfo/var-captured-in-sendable-closure.rs index aa269edadd8..26d46040c20 100644 --- a/src/test/debuginfo/var-captured-in-sendable-closure.rs +++ b/src/test/debuginfo/var-captured-in-sendable-closure.rs @@ -40,7 +40,7 @@ // lldb-check:[...]$2 = 5 #![allow(unused_variables)] -#![feature(unboxed_closures, box_syntax)] +#![feature(unboxed_closures, box_syntax, rustc_attrs, stmt_expr_attributes)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -50,6 +50,7 @@ struct Struct { c: usize } +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. fn main() { let constant = 1; @@ -61,7 +62,9 @@ fn main() { let owned: Box<_> = box 5; - let closure = move || { + let closure = + #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. + move || { zzz(); // #break do_something(&constant, &a_struct.a, &*owned); }; @@ -73,7 +76,9 @@ fn main() { // The `self` argument of the following closure should be passed by value // to FnOnce::call_once(self, args), which gets translated a bit differently // than the regular case. Let's make sure this is supported too. - let immedate_env = move || { + let immedate_env = + #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. + move || { zzz(); // #break return constant2; }; diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs index 6def5cf2859..a22fbebfd1a 100644 --- a/src/test/debuginfo/var-captured-in-stack-closure.rs +++ b/src/test/debuginfo/var-captured-in-stack-closure.rs @@ -69,7 +69,7 @@ // lldb-command:print *owned // lldb-check:[...]$9 = 6 -#![feature(unboxed_closures, box_syntax)] +#![feature(unboxed_closures, box_syntax, rustc_attrs, stmt_expr_attributes)] #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] @@ -80,6 +80,7 @@ struct Struct { c: usize } +#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. fn main() { let mut variable = 1; let constant = 2; @@ -94,7 +95,9 @@ fn main() { let owned: Box<_> = box 6; { - let mut first_closure = || { + let mut first_closure = + #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. + || { zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned; }; @@ -103,7 +106,9 @@ fn main() { } { - let mut second_closure = || { + let mut second_closure = + #[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures. + || { zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned; }; |
