]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips64: Add a test case for mips64.
authorDejan Jevtic <dejan.jevtic@valgrind.org>
Wed, 17 Jul 2013 09:34:51 +0000 (09:34 +0000)
committerDejan Jevtic <dejan.jevtic@valgrind.org>
Wed, 17 Jul 2013 09:34:51 +0000 (09:34 +0000)
Add a function in the memcheck/tests/leak-segv-jmp.c for MIPS64
that execute the syscall. Because we added the mips64 case we
need to change the line number in *.exp file.
Fixes memcheck/tests/leak-segv-jmp for MIPS64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13456

memcheck/tests/leak-segv-jmp.c
memcheck/tests/leak-segv-jmp.stderr.exp

index 8856419429dd2073701191333174dcf2f3647020..7c965903a553a982fbc5ac3452334549ad9d93d6 100644 (file)
@@ -135,6 +135,31 @@ UWord do_syscall_WRK (
    return (UWord) (__svcres);
 }
 
+#elif defined(VGP_mips64_linux)
+extern UWord do_syscall_WRK (
+          UWord syscall_no,
+          UWord a1, UWord a2, UWord a3,
+          UWord a4, UWord a5, UWord a6
+       )
+{
+   UWord out;
+   __asm__ __volatile__ (
+                 "move $v0, %1\n\t"
+                 "move $a0, %2\n\t"
+                 "move $a1, %3\n\t"
+                 "move $a2, %4\n\t"
+                 "move $a3, %5\n\t"
+                 "move $8,  %6\n\t"  /* We use numbers because some compilers */
+                 "move $9,  %7\n\t"  /* don't recognize $a4 and $a5 */
+                 "syscall\n"
+                 "move %0, $v0\n\t"
+                 : /*out*/ "=r" (out)
+                 : "r"(syscall_no), "r"(a1), "r"(a2), "r"(a3),
+                   "r"(a4), "r"(a5), "r"(a6)
+                 : "v0", "v1", "a0", "a1", "a2", "a3", "$8", "$9");
+   return out;
+}
+
 #else
 // Ensure the file compiles even if the syscall nr is not defined.
 #ifndef __NR_mprotect
index 474120423888e28126b003124b0b886d7dce5b28..ee0bdc9c78cf613f3967d352dab182812be2de6c 100644 (file)
@@ -14,8 +14,8 @@ To see them, rerun with: --leak-check=full --show-leak-kinds=all
 expecting a leak
 1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:171)
-   by 0x........: main (leak-segv-jmp.c:218)
+   by 0x........: f (leak-segv-jmp.c:196)
+   by 0x........: main (leak-segv-jmp.c:243)
 
 LEAK SUMMARY:
    definitely lost: 1,000 bytes in 1 blocks
@@ -30,8 +30,8 @@ mprotect result 0
 expecting a leak again
 1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: f (leak-segv-jmp.c:171)
-   by 0x........: main (leak-segv-jmp.c:218)
+   by 0x........: f (leak-segv-jmp.c:196)
+   by 0x........: main (leak-segv-jmp.c:243)
 
 LEAK SUMMARY:
    definitely lost: 1,000 bytes in 1 blocks