main-internal.exp revision 4627fc493db8459e6ef0597a4155a06b7d120d20
1# This file was written by Yao Qi <qiyao@cn.ibm.com>.
2
3set testfile "main-internal"
4set srcfile ${testfile}.c
5set binfile ${testfile}
6
7verbose "compiling source file now....."
8# Build the shared libraries this test case needs.
9if  { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c ${srcdir}/${subdir}/${testfile}-1.c" "${objdir}/${subdir}/${binfile}" executable {debug} ] != "" } {
10     send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
11}
12
13# set options for ltrace.
14ltrace_options "-x" "display"
15
16# Run PUT for ltarce.
17set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
18
19# Check the output of this program.
20verbose "ltrace runtest output: $exec_output\n"
21if [regexp {ELF from incompatible architecture} $exec_output] {
22	fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
23	return
24} elseif [ regexp {Couldn't do static plt2addr} $exec_output ] {
25	fail "Couldn't do static plt2addr!"
26	return
27} elseif [regexp {Couldn't get .hash data from} $exec_output ] {
28	fail "Couldn't get .hash data!"
29	return
30}
31
32set pattern "display"
33ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 12
34