1 set testfile "libdl-simple"
2 set srcfile ${testfile}.c
3 set binfile ${testfile}
4 set libfile "libdl-simple-lib"
5 set libsrc $srcdir/$subdir/$libfile.c
6 set lib_sl $objdir/$subdir/lib$testfile.so
8 verbose "compiling source file now....."
9 if [get_compiler_info $binfile ""] {
13 # Build the shared libraries this test case needs.
14 if { [ltrace_compile_shlib $libsrc $lib_sl [debug]] != ""
15 || [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c" "${objdir}/${subdir}/${binfile}" executable {debug shlib=-ldl} ] != "" } {
16 send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
19 # set options for ltrace.
20 ltrace_options "-x" "test_libdl"
23 set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
24 verbose "ltrace runtest output: $exec_output\n"
26 # Check the output of this program.
27 if [regexp {ELF from incompatible architecture} $exec_output] {
28 fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
30 } elseif [ regexp {Couldn't get .hash data} $exec_output ] {
31 fail "Couldn't get .hash data!"
35 set pattern "test_libdl@liblibdl-simple.so"
36 ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1