1 # This file was written by Yao Qi <qiyao (at) cn.ibm.com>. 2 3 set testfile "hello-vfork" 4 set srcfile ${testfile}.c 5 set binfile ${testfile} 6 7 8 if [get_compiler_info $binfile] { 9 return -1 10 } 11 12 verbose "compiling source file now....." 13 if { [ltrace_compile $srcdir/$subdir/$srcfile $objdir/$subdir/$binfile executable debug ] != ""} { 14 send_user "Testcase compile failed, so all tests in this file will automatically fail.\n" 15 } 16 17 # set options for ltrace. 18 ltrace_options "-f" 19 20 # Run PUT for ltarce. 21 set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile] 22 23 # Check the output of this program. 24 verbose "ltrace runtest output: $exec_output\n" 25 if [regexp {ELF from incompatible architecture} $exec_output] { 26 fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!" 27 return 28 } elseif [ regexp {Couldn't get .hash data} $exec_output ] { 29 fail "Couldn't get .hash data!" 30 return 31 } 32 33 # Verify the output by checking numbers of print in main-vfork.ltrace. 34 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "_exit" 2 35 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace "vfork resumed" 2 36