55//@ ignore-windows
66//@ run-pass
77//@ compile-flags: -Cdebuginfo=line-tables-only
8+ //@ needs-unwind
89#![ feature( backtrace_frames) ]
910
1011use std:: backtrace:: { self , Backtrace } ;
@@ -32,7 +33,6 @@ fn assert_contains(
3233 // FIXME(jieyouxu): fix this ugly fragile test when `BacktraceFrame` has accessors like...
3334 // `symbols()`.
3435 let backtrace = format ! ( "{:#?}" , backtrace) ;
35- eprintln ! ( "{}" , backtrace) ;
3636 assert ! ( backtrace. contains( expected_name) , "backtrace does not contain expected name {}" , expected_name) ;
3737 assert ! ( backtrace. contains( expected_file) , "backtrace does not contain expected file {}" , expected_file) ;
3838 assert ! ( backtrace. contains( & expected_line. to_string( ) ) , "backtrace does not contain expected line {}" , expected_line) ;
@@ -50,6 +50,7 @@ fn main() {
5050 let mut backtrace: Option < Backtrace > = None ;
5151 unsafe { line_tables_only_foo ( store_backtrace, addr_of_mut ! ( backtrace) . cast :: < c_void > ( ) ) } ;
5252 let backtrace = backtrace. expect ( "backtrace" ) ;
53+ eprintln ! ( "{:#?}" , backtrace) ;
5354 assert_contains ( & backtrace, "line_tables_only_foo" , "rust_test_helpers.c" , 435 ) ;
5455 assert_contains ( & backtrace, "line_tables_only_bar" , "rust_test_helpers.c" , 439 ) ;
5556 assert_contains ( & backtrace, "line_tables_only_baz" , "rust_test_helpers.c" , 443 ) ;
0 commit comments