[MSAN][MIPS] Fix test Linux/syscalls_sigaction.cc on mips64

Changed the kernel sigaction structure in test syscalls_sigaction.cc for MIPS according to the structure defined in kernel.

Reviewed by eugenis.
Differential: https://reviews.llvm.org/D25814

llvm-svn: 286583
This commit is contained in:
Sagar Thakur 2016-11-11 12:05:30 +00:00
parent 807f9cf243
commit cdfdff0b18
1 changed files with 8 additions and 0 deletions

View File

@ -11,7 +11,11 @@
#include <sanitizer/msan_interface.h>
struct my_kernel_sigaction {
#if defined(__mips__)
long flags, handler;
#else
long handler, flags, restorer;
#endif
uint64_t mask[20]; // larger than any known platform
};
@ -35,6 +39,10 @@ int main() {
memset(&act, 0, sizeof(act));
__msan_poison(&oldact, sizeof(oldact));
__sanitizer_syscall_post_rt_sigaction(0, SIGUSR1, &act, &oldact, 5);
#if defined(__mips__)
assert(__msan_test_shadow(&oldact, sizeof(oldact)) == sizeof(long)*2 + 5);
#else
assert(__msan_test_shadow(&oldact, sizeof(oldact)) == sizeof(long)*3 + 5);
#endif
#endif
}