1 # This file was written by Yao Qi <qiyao@cn.ibm.com>.
4 set srcfile ${testfile}.c
5 set binfile ${testfile}
7 set libsrc $srcdir/$subdir/$libfile.c
8 set lib_sl $objdir/$subdir/lib$testfile.so
11 if [get_compiler_info $binfile] {
15 verbose "compiling source file now....."
16 if { [ltrace_compile_shlib $libsrc $lib_sl debug ] != ""
17 || [ltrace_compile $srcdir/$subdir/$srcfile $objdir/$subdir/$binfile executable [list debug shlib=$lib_sl] ] != ""} {
18 send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
21 # set options for ltrace.
22 ltrace_options "-l" "libmain.so"
25 set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
27 # Check the output of this program.
28 verbose "ltrace runtest output: $exec_output\n"
29 if [regexp {ELF from incompatible architecture} $exec_output] {
30 fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
32 } elseif [ regexp {Couldn't get .hash data} $exec_output ] {
33 fail "Couldn't get .hash data!"
37 # Verify the output by checking numbers of print in main.ltrace.
39 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 10