regtest: broaden none/tests/linux/bug498317 suppression for PPC
[valgrind.git] / none / tests / amd64 / ssse3_misaligned.c
blob23f85ca908fb564dd079cb03c809862d457ca35f
2 #include "tests/malloc.h"
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <string.h>
6 #include <assert.h>
7 #include <signal.h>
9 void maybe_fault ( int delta )
11 char* x = memalign16(32);
12 memset(x, 0, 32);
13 __asm__ __volatile__(
14 "pabsb (%0),%%xmm7"
15 : /*out*/ : /*in*/ "r"(x+delta) : /*trash*/"xmm7" );
16 free(x);
19 void handler ( int signo )
21 #if defined(__FreeBSD__)
22 assert(signo == SIGBUS);
23 #else
24 assert(signo == SIGSEGV);
25 #endif
26 fprintf(stderr, "three\n");
27 exit(0);
30 int main ( void )
32 #if defined(__FreeBSD__)
33 signal(SIGBUS, handler);
34 #else
35 signal(SIGSEGV, handler);
36 #endif
37 fprintf(stderr, "you should see: \"one\\ntwo\\nthree\\n\"\n");
38 fprintf(stderr, "one\n");
39 maybe_fault(0);
40 fprintf(stderr, "two\n");
41 maybe_fault(5);
42 fprintf(stderr, "test failed! you shouldn't see this\n");
43 return 0;