]> granicus.if.org Git - strace/commitdiff
tests: enhance -k test
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 13 Jun 2014 15:07:24 +0000 (15:07 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 13 Jun 2014 15:58:01 +0000 (15:58 +0000)
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.

tests/stack-fcall.c
tests/strace-k.test

index 1c66fefa77b6c1e31abfdcee17de71051e6160e5..7329bdc6799ad237a73012301aed5fb0fafd6312 100644 (file)
@@ -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;
index 3845c8cefdb50c74b3b0a37d4cec976fb239c49f..f757fb91be573818c444f47c61e25eb57aed41ba 100755 (executable)
@@ -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' ' ')