1# This file was written by Yao Qi <qiyao@cn.ibm.com>.
2
3set testfile "trace-clone"
4set srcfile ${testfile}.c
5set binfile ${testfile}
6
7
8verbose "compiling source file now....."
9# Build the shared libraries this test case needs.
10if  { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c" "${objdir}/${subdir}/${binfile}" executable {debug} ] != "" } {
11     send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
12}
13
14ltrace_options "-f"
15set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
16
17#check the output of this program.
18verbose "ltrace runtest output: $exec_output\n"
19if [regexp {ELF from incompatible architecture} $exec_output] {
20	fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
21	return
22} elseif [ regexp {Operation not permitted} $exec_output ] {
23        fail "Operation not permitted, see testrun.log for details!"
24        return
25} elseif [ regexp {killed by SIGKILL} $exec_output ] {
26        fail "killed by SIGKILL!"
27        return
28}
29
30
31
32set pattern "clone"
33ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
34
35