tests: enhance -k test
Add two more function calls to the stack. Suggested by Masatake YAMATO. * tests/stack-fcall.c (f1): Rename to f3. (f1, f2): New functions. * tests/strace-k.test: Update.
This commit is contained in:
parent
73741d2e2e
commit
c588b205be
@ -3,12 +3,24 @@
|
||||
|
||||
/* Use "volatile" to avoid compiler optimization. */
|
||||
|
||||
int f1(int i)
|
||||
int f3(int i)
|
||||
{
|
||||
static pid_t (* volatile g)(void) = getpid;
|
||||
return g() + i;
|
||||
}
|
||||
|
||||
int f2(volatile int i)
|
||||
{
|
||||
static int (* volatile g)(int) = f3;
|
||||
return g(i) - i;
|
||||
}
|
||||
|
||||
int f1(volatile int i)
|
||||
{
|
||||
static int (* volatile g)(int) = f2;
|
||||
return g(i) + i;
|
||||
}
|
||||
|
||||
int f0(volatile int i)
|
||||
{
|
||||
static int (* volatile g)(int) = f1;
|
||||
|
@ -23,7 +23,7 @@ $STRACE $args > $LOG 2>&1 || {
|
||||
fail_ "$STRACE $args failed"
|
||||
}
|
||||
|
||||
expected='getpid f1 f0 main '
|
||||
expected='getpid f3 f2 f1 f0 main '
|
||||
result=$(sed -n '1,/(main+0x[a-f0-9]\+) .*/ s/^.*(\([^+]\+\)+0x[a-f0-9]\+) .*/\1/p' $LOG |
|
||||
tr '\n' ' ')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user