drd/tests/swapcontext: Improve the portability of this test further
[valgrind.git] / none / tests / x86 / ssse3_misaligned.c
blobe01111abf469a3bac91a2389771161db162dfcf5
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 assert(signo == SIGSEGV);
22 fprintf(stderr, "three\n");
23 exit(0);
26 int main ( void )
28 signal(SIGSEGV, handler);
29 fprintf(stderr, "you should see: \"one\\ntwo\\nthree\\n\"\n");
30 fprintf(stderr, "one\n");
31 maybe_fault(0);
32 fprintf(stderr, "two\n");
33 maybe_fault(5);
34 fprintf(stderr, "test failed! you shouldn't see this\n");
35 return 0;