]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge r9533..9536 (add tests/{asm.h,sys_mman.h,malloc.h} from the DARWIN
authorNicholas Nethercote <njn@valgrind.org>
Wed, 15 Apr 2009 03:12:43 +0000 (03:12 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 15 Apr 2009 03:12:43 +0000 (03:12 +0000)
branch.

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

56 files changed:
Makefile.tool-tests.am
exp-ptrcheck/tests/mm.c
massif/tests/custom_alloc.c
massif/tests/malloc_usable.c
memcheck/tests/addressable.c
memcheck/tests/amd64/sse_memory.c
memcheck/tests/badjump.c
memcheck/tests/custom_alloc.c
memcheck/tests/file_locking.c
memcheck/tests/linux/stack_switch.c
memcheck/tests/mallinfo.c
memcheck/tests/malloc_usable.c
memcheck/tests/memalign2.c
memcheck/tests/mempool.c
memcheck/tests/mmaptest.c
memcheck/tests/origin1-yes.c
memcheck/tests/pointer-trace.c
memcheck/tests/sh-mem-random.c
memcheck/tests/sigaltstack.c
memcheck/tests/signal2.c
memcheck/tests/stack_changes.c
memcheck/tests/str_tester.c
memcheck/tests/x86-linux/bug133694.c
memcheck/tests/x86/Makefile.am
memcheck/tests/x86/fxsave.c
none/tests/amd64/bug137714-amd64.c
none/tests/amd64/faultstatus.c
none/tests/amd64/nibz_bennee_mmap.c
none/tests/amd64/redundantRexW.c
none/tests/amd64/smc1.c
none/tests/amd64/ssse3_misaligned.c
none/tests/faultstatus.c
none/tests/linux/mremap.c
none/tests/linux/mremap2.c
none/tests/map_unaligned.c
none/tests/map_unmap.c
none/tests/munmap_exe.c
none/tests/ppc32/jm-insns.c
none/tests/ppc32/test_fx.c
none/tests/ppc32/test_gx.c
none/tests/x86/Makefile.am
none/tests/x86/bug126147-x86.c
none/tests/x86/cmpxchg8b.c
none/tests/x86/faultstatus.c
none/tests/x86/fcmovnu.c
none/tests/x86/fxtract.c
none/tests/x86/incdec_alt.c
none/tests/x86/jcxz.c
none/tests/x86/lahf.c
none/tests/x86/looper.c
none/tests/x86/sbbmisc.c
none/tests/x86/ssse3_misaligned.c
perf/Makefile.am
perf/bigcode.c
perf/bz2.c
tests/Makefile.am

index 1c1f89e0592d04cee2224ef136a311b2efe6d7ea..aaed77bb1e578051ac3057268ef3cd6a443abd92 100644 (file)
@@ -1,3 +1,5 @@
+# This file is used for tool tests, and also in perf/Makefile.am.
+
 include $(top_srcdir)/Makefile.flags.am     # For AM_FLAG_M3264_PRI
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include \
index 00d1407320c5ca92149628692b0631d3507f3e15..0f1a9bd241a1eac88190bb8aefc82e84916d44ff 100644 (file)
@@ -1,4 +1,4 @@
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <unistd.h>
 #include "arith_include1.c"
 
index 1b27342569d881e80a58ff338e304e585f07e27f..102a6b852e1c8f79e81e0917ac955700ab4748de 100644 (file)
@@ -1,5 +1,5 @@
 #include <unistd.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <assert.h>
 #include <stdlib.h>
 
@@ -14,7 +14,7 @@
 void* get_superblock(void)
 {
    void* p = mmap( 0, SUPERBLOCK_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
-                   MAP_PRIVATE|MAP_ANON, -1, 0 );
+                   MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 );
 
    assert(p != ((void*)(-1)));
 
index e2524160db76b5f4b436e57c765f3c6f009001e5..4a0e470d8102f214d2f30ae2d63f852b63406e76 100644 (file)
@@ -1,11 +1,11 @@
 #include <assert.h>
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <stdlib.h>
 #include <stdio.h>
 
 int main(void)
 {
-#  if !defined(_AIX)
+#  if !defined(VGO_aix5)
    // Because our allocations are in multiples of 8 or 16, 99 will round up
    // to 104 or 112.
    int* x = malloc(99);
index 87227d71a36db2480efb669dcf374ca82239998d..f845ef3d099d7984454f4be37139667b808ebfd2 100644 (file)
@@ -1,6 +1,6 @@
 /* Test different kinds of addressability and definedness */
 #include "../memcheck.h"
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <stdio.h>
 #include <sys/resource.h>
 #include <unistd.h>
index 4ce9a6b23f1e28ccd6b25de0bf9037944b8ca765..d0c3b849af7ceda48215417f87a3286ecded99f6 100644 (file)
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <string.h>
 
 typedef  unsigned char  V128[16];
@@ -148,7 +148,7 @@ void do_##insn ( void )                    \
    }                                       \
    for (i = 0; i < 5; i++) {               \
       randRMArgs(&margs);                  \
-      buf = memalign(16,mem_size);         \
+      buf = memalign16(mem_size);          \
       randomise(buf,mem_size);             \
       r_m_##insn(&margs,buf);              \
       showRM(#insn, &margs, buf, mem_size, res_mask);\
index cd9642b8f60626efd6f445ca6b8d64ff1e194052..7e50b211cb9333db526fd4f455cdcca1d850cdea 100644 (file)
@@ -1,3 +1,4 @@
+#include "tests/sys_mman.h"
 
 int main ( void )
 {
@@ -7,12 +8,13 @@ int main ( void )
       uniform behaviour on all supported targets - a jump to 0xE000000
       - the following is needed. */
    unsigned long long int fake_fndescr[3];
-   fake_fndescr[0] = 0xE000000;
+   fake_fndescr[0] = (unsigned long long int)get_unmapped_page();
    fake_fndescr[1] = 0;
    fake_fndescr[2] = 0;
    return ((int(*)(void)) fake_fndescr) ();
 #else
-   char* p = (char*)0xE000000;
+   char* p = get_unmapped_page();
    return ((int(*)(void)) p) ();
 #endif
 }
+
index 38004cd28424a3a09eeb7ba74ff8eacf49ddf9af..5ad965c6f03144ce7d596801065a3b754a9daf88 100644 (file)
@@ -1,5 +1,5 @@
 #include <unistd.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <assert.h>
 #include <stdlib.h>
 
@@ -14,7 +14,7 @@
 void* get_superblock(void)
 {
    void* p = mmap( 0, SUPERBLOCK_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
-                   MAP_PRIVATE|MAP_ANON, -1, 0 );
+                   MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 );
 
    assert(p != ((void*)(-1)));
 
index 4e60bea9e8a503bccbc2c7c7098ee2611beace67..d99f6b5a2d3ec31051765493a6bd91d6e805d263 100644 (file)
@@ -9,7 +9,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
index a0cfbad857e2c5a470b8fdfd0ea23f571e81f4fd..1d179351dcafcc9a5a845691edb5c28436629ac6 100644 (file)
@@ -6,7 +6,7 @@
 #include <sched.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <sys/syscall.h>
 #include <sys/wait.h>
 #include <unistd.h>
index 5ff258e8e67206a3a62c547564efb1316bc2b554..d8e853be79c30e2dfea1bd0f07249b027d6a3e1b 100644 (file)
@@ -1,4 +1,4 @@
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h> // getopt()
index 7e912dd7bf23072dfc1670b8f3eb81a95d88e3ad..4e2d2a048dccf7fb6239c475c2437998ca22dc6b 100644 (file)
@@ -1,11 +1,11 @@
 #include <assert.h>
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <stdlib.h>
 #include <stdio.h>
 
 int main(void)
 {
-#  if !defined(_AIX)
+#  if !defined(VGO_aix5)
    // Because Memcheck marks any slop as inaccessible, it doesn't round up
    // sizes for malloc_usable_size().
    int* x = malloc(99);
index ccda426449424fc8c75bfc8d722a7e8d3216225f..a8d14dbfcd268492fd59e4d2f8c6cdfbab6f1462 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <assert.h>
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <errno.h>
 
 int main ( void )
 {
-#  if defined(_AIX)
+#  if defined(VGO_aix5)
    // AIX 5.2 has neither memalign() nor posix_memalign();  do nothing.
 
 #  else
    // Nb: assuming VG_MIN_MALLOC_SZB is 8!
+   // DDD: (this is no longer true)
    // Should work with both 32-bit and 64-bit pointers, though.
 
    int* p;
index f79484c463d122fde142395554363cb64877c542..f40c66363f4f4cabbaee1676b509e7dd860164a4 100644 (file)
@@ -1,5 +1,5 @@
 #include <unistd.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <assert.h>
 #include <stdlib.h>
 
index 74a21ed2601349d24f58481341a459fdc749ae21..fac1f655caa342ab48a203f5efca6ac6494ae645 100644 (file)
@@ -2,7 +2,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 int main()
 {
index b46fa175a6a0eac8f6d4e147a4802d8d583a3375..acfd8aba78e536f6c1c9e02b0b7cb19cd2e0a6b6 100644 (file)
@@ -13,7 +13,7 @@
 #include <stdio.h>
 #include <assert.h>
 #include <stdlib.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <unistd.h>
 #include "../memcheck.h"
 
index 3380aef575c0c4410929410488134b053d4320ec..243ea1ffb5f33193dd30842c5e0c8ac4076a7ad5 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <stdio.h>
 #include "memcheck/memcheck.h"
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <stdlib.h>
 #include <fcntl.h>
 #include <unistd.h>
index 504830661786ba35c8c8df3d625a11fa43958c38..bcf1fb1984a838709d59db865b7e39a7b4c754b7 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include "memcheck/memcheck.h"
 
 // All the sizes here are in *bytes*, not bits.
index fd80fce33c9b7c4e9a84edcc4932a48ec05f1df5..526a99aa5b6dbefc0494162cf567e05b0b6e49f7 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 void sig_handler(int sig){
   int var;
@@ -19,7 +19,7 @@ int main(int argv, char** argc) {
   // ask for an alt stack with EXEC permissions,
   // since signal returning requires execution of code on the stack.      
   char *stk = (char *)mmap(0, size, PROT_READ|PROT_WRITE|PROT_EXEC, 
-                                    MAP_ANON|MAP_PRIVATE, -1, 0);
+                                    MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
   sigstk.ss_sp = stk;
 
   sigstk.ss_size = size;
index a1df7056e72d3cfcaea0849e7c9ad26e5f23dfd5..913d7e085070773dfe44c1b6558ab856508f2136 100644 (file)
@@ -2,19 +2,20 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
+#include "tests/sys_mman.h"
 
-void sig_hdlr ( int signo )
-{
-   printf ( "caught sig segv\n" );
-   exit(1);
+void sig_hdlr ( int signo ) {
+   printf ( "caught sig segv\n" ); exit(1);
 }
 
-int main ( void )
-{
+int main ( void ) {
+   char* badplace;
    printf ( "installing sig handler\n" );
    signal(SIGSEGV, sig_hdlr);
    printf ( "doing bad thing\n" );
-   * (int*) 65536 = 0;
+   badplace = get_unmapped_page();
+   *(int*)badplace = 0;
    printf ( "exited normally ?!\n" );
    return 0;
 }
+
index 71b754ae26f3afe2ebd189a5896c2b8cfd962e30..e9d57d0192b22099a28b40916d216db8d0aa7110 100644 (file)
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <ucontext.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 #include "valgrind.h"
 
@@ -39,7 +39,7 @@ int init_context(mycontext *uc)
     }
 
     stack = (void *)mmap(0, STACK_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
-                                        MAP_ANON|MAP_PRIVATE, -1, 0);
+                                        MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
 
     if (stack == (void*)-1) {
         perror("mmap");
index c552f4142f01de2f3eb3d2da0ad0f7880cb449be..3c15ea7cab1b5961918ba985a727ce7c9c9d4c1e 100644 (file)
@@ -463,6 +463,7 @@ test_strchr (void)
    }
 }
 
+// DDD: better done by testing for the function.
 #if !defined(_AIX)
 static void
 test_strchrnul (void)
@@ -499,6 +500,7 @@ test_strchrnul (void)
 }
 #endif /* !defined(_AIX) */
 
+// DDD: better done by testing for the function.
 #if !defined(_AIX)
 static void
 test_rawmemchr (void)
@@ -574,6 +576,7 @@ test_strrchr (void)
    }
 }
 
+// DDD: better done by testing for the function.
 #if !defined(_AIX)
 static void
 test_memrchr (void)
index 1bc9b14ac82b4ccd85d1a180f7af13a0881d6413..a12813bddfce0a0cc0ce8111a836bf7dfa92b826 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 int main(int argc, char **argv)
 {
index 87a8dd0dcebbea9a9b0f1300fe1637cf9a820b25..bba38b5737042a2a2ff4cb37a01b5fa67b62f0b2 100644 (file)
@@ -28,12 +28,17 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
 check_PROGRAMS = \
        bug152022 \
        espindola2 \
-       fxsave \
        int3-x86 \
-       fpeflags pushfpopf \
+       fpeflags \
+        fprem \
+        fxsave \
+       more_x86_fp \
+        pushfpopf \
        pushfw_x86 \
-       pushpopmem sse_memory tronical \
-       more_x86_fp fprem xor-undef-x86
+       pushpopmem \
+        sse_memory \
+        tronical \
+        xor-undef-x86
 
 AM_CFLAGS   += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
 AM_CXXFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)
index 655790757dc5a84ff57c551fe6fc68f99ee3ebc7..92c0930308b252bf4fc347fbcfe968cbffc48c96 100644 (file)
@@ -1,7 +1,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <malloc.h>
+#include "tests/asm.h"
+#include "tests/malloc.h"
 #include <string.h>
 
 const unsigned int vec0[4]
@@ -34,14 +35,14 @@ void do_zeroise ( void )
     "fldz\n\t"
     "fldz\n\t"
     "finit\n");
-   asm __volatile__("movups vecZ, %xmm0");
-   asm __volatile__("movups vecZ, %xmm1");
-   asm __volatile__("movups vecZ, %xmm2");
-   asm __volatile__("movups vecZ, %xmm3");
-   asm __volatile__("movups vecZ, %xmm4");
-   asm __volatile__("movups vecZ, %xmm5");
-   asm __volatile__("movups vecZ, %xmm6");
-   asm __volatile__("movups vecZ, %xmm7");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm0");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm1");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm2");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm3");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm4");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm5");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm6");
+   asm __volatile__("movups " VG_SYM(vecZ) ", %xmm7");
    asm __volatile__(
       "pushl $0\n\t"
       "ldmxcsr 0(%esp)\n\t"
@@ -58,8 +59,8 @@ void do_setup_then_fxsave ( void* p )
    asm __volatile__("fldlg2");
    asm __volatile__("fld %st(3)");
    asm __volatile__("fld %st(3)");
-   asm __volatile__("movups vec0, %xmm0");
-   asm __volatile__("movups vec1, %xmm1");
+   asm __volatile__("movups " VG_SYM(vec0) ", %xmm0");
+   asm __volatile__("movups " VG_SYM(vec1) ", %xmm1");
    asm __volatile__("xorps %xmm2, %xmm2");
    asm __volatile__("movaps %xmm2, %xmm3");
    asm __volatile__("movaps %xmm2, %xmm4");
@@ -102,9 +103,9 @@ void show ( unsigned char* buf, int xx )
 
 int main ( int argc, char** argv )
 {
-   unsigned char* buf1 = memalign(16,512);
-   unsigned char* buf2 = memalign(16,512);
-   unsigned char* buf3 = memalign(16,512);
+   unsigned char* buf1 = memalign16(512);
+   unsigned char* buf2 = memalign16(512);
+   unsigned char* buf3 = memalign16(512);
    int xx = argc > 1;
    printf("Re-run with any arg to suppress least-significant\n"
           "   16 bits of FP numbers\n");
index efa91b58bea8246e3caebc49715ac82b4a864dc4..8c785634369b669f35b70c3dee6afa968c3be103 100644 (file)
@@ -1,6 +1,6 @@
 
 #include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <assert.h>
 
 typedef  unsigned char  UChar;
index c96c67dc7e6d0102d32f78cda9505e432949951a..0a8ad8ff848d77aaba7c9d8d3f5011ad9fa5c330 100644 (file)
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <setjmp.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <unistd.h>
 
 struct test {
index 84a8a613203e4ba93e266d28a0dd2cb74a37f682..aa0376889e3a9a014ec2b630b03e293b67edc247 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 int main(int argc, char **argv)
 {
index 833b5c226cffa06dee0afa4b1a60d4035a2124a8..773322b04705859058d36d75f0fc81907866a4c3 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <malloc.h>  /* for memalign */
 #include <assert.h>
+#include "tests/malloc.h"
 
 typedef  unsigned char  UChar;
 
@@ -168,12 +169,8 @@ int main ( void )
 {
    XMMRegs* regs;
    Mem*     mem;
-   regs = memalign(16, sizeof(XMMRegs)); assert(regs);
-   mem  = memalign(16, sizeof(Mem)); assert(mem);
-
-   /* Both have to be 16-aligned so we can do movapd et al */
-   assert( 0 == (0xFL & (unsigned long int)regs) );
-   assert( 0 == (0xFL & (unsigned long int)mem) );
+   regs = memalign16(sizeof(XMMRegs) + 16);
+   mem  = memalign16(sizeof(Mem) + 16);
 
    /* addpd mem, reg   66 49 0f 58 48 00  rex.WB addpd  0x0(%r8),%xmm1 */
    {
index 8619c1efda8f6fe4f7a28d98c962b5a87f9eb708..2998856a3b333715e864ed507000a460561955d6 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <stdio.h>
 #include <assert.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 typedef unsigned long long int Addr;
 typedef unsigned char UChar;
index 5b06f2d3db4829baac6ae449b77d91d0ac4adb34..e01111abf469a3bac91a2389771161db162dfcf5 100644 (file)
@@ -1,5 +1,5 @@
 
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -8,9 +8,7 @@
 
 void maybe_fault ( int delta )
 {
-   char* x = memalign(16/*alignment*/,32/*size*/);
-   assert(x);
-   assert(0 == ((16-1) & (unsigned long)x));
+   char* x = memalign16(32);
    memset(x, 0, 32);
    __asm__ __volatile__(
       "pabsb (%0),%%xmm7"
index ebf7147ded797bd8e9b48b0f5b84d1da8b43f153..fefefe5a2e865af0db367541b6d0e384baa63d5c 100644 (file)
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <setjmp.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <unistd.h>
 
 /*
index a768836ac1042d88c53dbd8ba398cdf64ad49052..4adfb8617aac6d4acd33541135dd9b1b9573034b 100644 (file)
@@ -1,5 +1,5 @@
 #define _GNU_SOURCE
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <stdio.h>
 #include <stdlib.h>
 
index 0d932dd44deed6e1915ea9e5d1b2fe1929ff3ead..b8a241f909e01a0f2d5d20533a54cc0334aadceb 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <stdio.h>
 
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <assert.h>
 #include <stdlib.h>
 #include <sys/types.h>
index f3d47346e96a86d6a7158bc0b1b25f08076549e5..e09fea6f719576d1f8fb83163a8fe698b434cc59 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 int main(int argc, char **argv)
 {
index 7bf97904f9473b08934bd41c5862f87c384e0b4e..c5dc490a7779ec6dfbfaf3ed4fcc8d66fb671c25 100644 (file)
@@ -1,5 +1,5 @@
 #include <stdio.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <stdlib.h>
 #include <unistd.h>
 
@@ -10,7 +10,7 @@ static unsigned int pagesize;
 
 static void *domap(void)
 {
-       void *ret = mmap(0, LEN, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
+       void *ret = mmap(0, LEN, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
 
        if (ret == (void *)-1) {
                perror("mmap");
index 3a8acb0c9428e296e34e3cd1071642790f001733..16152010a6664ced92caa27b4e01baf890ec8c2e 100644 (file)
@@ -1,5 +1,5 @@
 #include <unistd.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -11,7 +11,7 @@ int main()
 {
     void* m;
     
-    m = mmap(NULL, 100, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0);
+    m = mmap(NULL, 100, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
 
     if (m == (void*)-1) {
        fprintf(stderr, "error mmapping\n");
index d55c8751a424f7d2e2c542e2347e22ec5a659aca..16adc731b4f475cc0d8d90d5c7cfd730dd90afc3 100644 (file)
@@ -166,7 +166,7 @@ case I chased).
 
 
 #include <stdint.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 /* Something of the same size as void*, so can be safely be coerced
    to/from a pointer type. Also same size as the host's gp registers. */
@@ -229,8 +229,6 @@ register HWord_t r17 __asm__ ("r17");
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>    // getopt
-#include <malloc.h>
-
 
 
 #ifndef __powerpc64__
@@ -4403,7 +4401,7 @@ static void build_viargs_table (void)
 {
 #if !defined (ALTIVEC_ARGS_LARGE)
    unsigned int i=2;
-   viargs = memalign(16, i * sizeof(vector unsigned int));
+   viargs = memalign16(i * sizeof(vector unsigned int));
    viargs[0] = (vector unsigned int) { 0x01020304,0x05060708,0x090A0B0C,0x0E0D0E0F };
    AB_DPRINTF_VEC32x4( viargs[0] );
    viargs[1] = (vector unsigned int) { 0xF1F2F3F4,0xF5F6F7F8,0xF9FAFBFC,0xFEFDFEFF };
@@ -4459,7 +4457,7 @@ static void build_vfargs_table (void)
 
 #if !defined (ALTIVEC_ARGS_LARGE)
    nb_vfargs = 12;
-   vfargs = memalign(16, nb_vfargs * sizeof(vector float));
+   vfargs = memalign16(nb_vfargs * sizeof(vector float));
 
    // 4 values:
    for (s=0; s<2; s++) {
@@ -4474,7 +4472,7 @@ static void build_vfargs_table (void)
    }
 #else
    nb_vfargs = 50;
-   vfargs = memalign(16, nb_vfargs * sizeof(vector float));
+   vfargs = memalign16(nb_vfargs * sizeof(vector float));
 
    for (s=0; s<2; s++) {
       for (_exp=0x0; ; _exp += 0x3F ) {
@@ -6763,7 +6761,7 @@ static void test_av_int_st_three_regs (const char *name,
    vector unsigned int* viargs_priv;
 
    // private viargs table to store to
-   viargs_priv = memalign(16,(nb_viargs * sizeof(vector unsigned int)));
+   viargs_priv = memalign16(nb_viargs * sizeof(vector unsigned int));
    for (i=0; i<nb_viargs; i++)
       viargs_priv[i] = (vector unsigned int) { 0,0,0,0 };
 
index eda1b9200af2c7cd3beb3eff2d33f761d3876c5a..31c4492a621285bc937de7e6a564417fe90297a7 100644 (file)
@@ -1,6 +1,6 @@
 
 #include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
 
 double do_fsqrt ( double x )
 {
index 1953fdf864e23e74d3260c639d4931a725959a8d..6aa37c2451cd1c742916e38b73afb172da0d3fdd 100644 (file)
@@ -1,6 +1,6 @@
 
 #include <stdio.h>
-#include <malloc.h>
+#include "tests/malloc.h"
 
 /* This is a Marie Celeste instruction.  Some IBM documents think it
    exists, others don't.  The same appears to be true for
index dd427c8af7cf23c47cb21bcb3a213d3a92b8e0cd..90a6a8adfe252020982b00bab96a90e08fdddcfe 100644 (file)
@@ -59,19 +59,36 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        yield.stderr.exp yield.stdout.exp yield.disabled
 
 check_PROGRAMS = \
-       badseg bt_everything bt_literal \
+       badseg \
+       bt_everything \
+       bt_literal \
        bug125959-x86 \
        bug126147-x86 \
        bug132813-x86 \
        bug135421-x86 \
        bug137714-x86 \
        bug152818-x86 \
-       cmpxchg8b cpuid cse_fail \
-       faultstatus fcmovnu fpu_lazy_eflags fxtract \
-       getseg incdec_alt $(INSN_TESTS) \
+       cmpxchg8b \
+        cpuid \
+        cse_fail \
+       faultstatus \
+        fcmovnu \
+        fpu_lazy_eflags \
+        fxtract \
+       getseg \
+        incdec_alt \
+        $(INSN_TESTS) \
+        int \
        jcxz \
-       lahf looper movx int pushpopseg sbbmisc \
-       seg_override sigcontext smc1 yield
+       lahf \
+        looper \
+        movx \
+        pushpopseg \
+        sbbmisc \
+       seg_override \
+        sigcontext \
+        smc1 \
+        yield
 if BUILD_SSSE3_TESTS
  check_PROGRAMS += ssse3_misaligned
 endif
index 5477348e2d62a4919202ce2359b00723b3c503eb..36f62bd85ebc77477834780b48bee57190131fd5 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 extern char *mystrncpy(char *dest, const char *src, size_t n);
 asm(
 ".text\n"
-".globl mystrncpy\n"
-".type mystrncpy,@function\n"
 "\n"
-"mystrncpy:\n"
+VG_SYM(mystrncpy) ":\n"
 "      pushl %esi\n"
 "      pushl %edi\n"
 "      movl %esp, %ecx\n"
@@ -32,20 +30,19 @@ asm(
 "\n"
 "      movl %edi, %edx\n"
 "      cld\n"
-".Lzzloop:\n"
+"0:\n"
 "      dec %ecx\n"
-"      js .Lzzout\n"
+"      js 1f\n"
 "      lodsb\n"
 "      stosb\n"
 "      or %al, %al\n"
-"      jnz .Lzzloop\n"
+"      jnz 0b\n"
 "      repnz stosb\n"
-".Lzzout:\n"
+"1:\n"
 "      movl %edx, %eax\n"
 "      popl %edi\n"
 "      popl %esi\n"
 "      ret\n"
-".previous\n"
 "\n"
 );
 
@@ -66,8 +63,7 @@ extern int __ltostr(char *s, unsigned int size, unsigned long i,
                              unsigned int base, int UpCase);
 asm(
 ".text\n"
-".globl __ltostr\n"
-"__ltostr:\n"
+VG_SYM(__ltostr) ":\n"
 "        pushl %esi\n"
 "        pushl %edi              # destination\n"
 "        pushl %ebp\n"
@@ -79,27 +75,27 @@ asm(
 "        movl 0x1c(%eax), %eax   # dividend\n"
 "        decl %ecx\n"
 "        movl %ecx, %esi\n"
-"        movl $('A'-0xa), %ebp\n"
+"        movl $55, %ebp          # 55 == char(A)-10\n"
 "        xorl %edx, %edx         # must be 0 -- used by idiv\n"
 "        cmpl $0x0, 36(%esp)     # check for uppercase\n"
-"        jnz .Lyynext\n"
+"        jnz 0f\n"
 "        addl $0x20, %ebp        # set lowercase\n"
-".Lyynext:\n"
+"0:\n"
 "        idiv %ebx, %eax\n"
 "        cmpb $0x9, %dl\n"
-"        jg .Lyynext2\n"
-"        addb $'0', %dl\n"
-"        jmp .Lyystos\n"
-".Lyynext2:\n"
+"        jg 1f\n"
+"        addb $48, %dl           # 48 == '0'\n"
+"        jmp 2f\n"
+"1:\n"
 "        addl %ebp, %edx\n"
-".Lyystos:\n"
+"2:\n"
 "        movb %dl, (%edi, %ecx)\n"
 "        xorl %edx, %edx\n"
 "        decl %ecx\n"
-"        jz .Lyyout\n"
+"        jz 3f\n"
 "        orl %eax, %eax\n"
-"        jnz .Lyynext\n"
-".Lyyout:\n"
+"        jnz 0b\n"
+"3:\n"
 "        cld\n"
 "        movl %esi, %ebx\n"
 "        leal 1(%edi, %ecx), %esi\n"
@@ -113,7 +109,6 @@ asm(
 "        popl %edi\n"
 "        popl %esi\n"
 "        ret\n"
-".previous\n"
 );
 
 #define STREQ(a, b)     (strcmp((a), (b)) == 0)
index 6f5b6eb8722fb1169e4a5c45aa939d9b0380b98f..3588840a86c5eb6e6f965bba0190c541ab945b8f 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 
 typedef unsigned long long int ULong;
@@ -14,7 +14,7 @@ UInt zout;
 
 extern void foo ( void );
 asm("\n"
-    "foo:\n"
+    VG_SYM(foo) ":\n"
     "\tpushl %eax\n"
     "\tpushl %ebx\n"
     "\tpushl %ecx\n"
@@ -22,18 +22,18 @@ asm("\n"
 
     "\txorl %eax, %eax\n" // get eflags in a known state
 
-    "\tmovl eax,%eax\n"
-    "\tmovl ebx,%ebx\n"
-    "\tmovl ecx,%ecx\n"
-    "\tmovl edx,%edx\n"
-    "\tcmpxchg8b m64\n"
-    "\tmovl %eax,eax\n"
-    "\tmovl %ebx,ebx\n"
-    "\tmovl %ecx,ecx\n"
-    "\tmovl %edx,edx\n"
+    "\tmovl " VG_SYM(eax) ",%eax\n"
+    "\tmovl " VG_SYM(ebx) ",%ebx\n"
+    "\tmovl " VG_SYM(ecx) ",%ecx\n"
+    "\tmovl " VG_SYM(edx) ",%edx\n"
+    "\tcmpxchg8b " VG_SYM(m64) "\n"
+    "\tmovl %eax," VG_SYM(eax) "\n"
+    "\tmovl %ebx," VG_SYM(ebx) "\n"
+    "\tmovl %ecx," VG_SYM(ecx) "\n"
+    "\tmovl %edx," VG_SYM(edx) "\n"
     "\tpushfl\n"
     "\tpopl %eax\n"
-    "\tmovl %eax,zout\n"
+    "\tmovl %eax," VG_SYM(zout) "\n"
 
     "\tpopl %edx\n"
     "\tpopl %ecx\n"
index a39289ba7579ed9115e483e7314fc437f6936a4a..ebdcd57fc310f6b944d1f260d2a88c720fd321b4 100644 (file)
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <setjmp.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 #include <unistd.h>
 
 struct test {
index 6c91e097517724afdeec24c4c5925bcba7175187..3a4e9550b8b7edd894ca45b4d2a1fa3c109b7d65 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 
 double zzz;
@@ -15,7 +15,7 @@ int main ( void )
     "movl $0,%esi\n\t"
     "add %esi,%esi\n\t"
     "fcmovnu %st(1), %st(0)\n\t"
-    "fstl zzz\n\t"
+    "fstl " VG_SYM(zzz) "\n\t"
     "finit\n\t"
     "popl %esi\n\t"
     );
index 4dff2a1f93c152301209c446d67c4ad74dc020c0..235cda72c4b6150821b642cbcd97dff46fede8f8 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 #include <math.h>
 
@@ -6,13 +6,12 @@ double arg, res1, res2;
 
 extern void do_fxtract ( void );
 asm("\n"
-".global do_fxtract\n"
-"do_fxtract:\n"
+VG_SYM(do_fxtract) ":\n"
 "\tfinit\n"
-"\tfldl arg\n"
+"\tfldl " VG_SYM(arg) "\n"
 "\tfxtract\n"
-"\tfstpl res1\n"
-"\tfstpl res2\n"
+"\tfstpl " VG_SYM(res1) "\n"
+"\tfstpl " VG_SYM(res2) "\n"
 "\tret"
 );
 
index 157bb169721659e3ef1fdf22f0ee99ec41774bae..2db324275ed7a821b72d1c2d40d9bb616ad64fd3 100644 (file)
@@ -1,51 +1,52 @@
 
 /* A test of the alternative (redundant) encodings for {inc,dec}{w,l}. */
 
+#include "tests/asm.h"
 #include <stdio.h>
 
 int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2;
 
 extern void foo ( void );
 asm("\n"
-"foo:\n"
+VG_SYM(foo) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
-"\tmovl a1,%eax\n"
-"\tmovl a2,%edx\n"
+"\tmovl " VG_SYM(a1) ",%eax\n"
+"\tmovl " VG_SYM(a2) ",%edx\n"
 
 /* inc %eax */
 "\t.byte 0xFF\n"
 "\t.byte 0xC0\n"
 
-"\tmovl %eax,r1\n"
+"\tmovl %eax," VG_SYM(r1) "\n"
 "\tpushfl\n"
-"\tpopl r2\n"
+"\tpopl " VG_SYM(r2) "\n"
 
 /* inc %dx */
 "\t.byte 0x66\n"
 "\t.byte 0xFF\n"
 "\t.byte 0xC2\n"
 
-"\tmovl %edx,r3\n"
+"\tmovl %edx," VG_SYM(r3) "\n"
 "\tpushfl\n"
-"\tpopl r4\n"
+"\tpopl " VG_SYM(r4) "\n"
 
 /* dec %edx */
 "\t.byte 0xFF\n"
 "\t.byte 0xCA\n"
 
-"\tmovl %edx,r5\n"
+"\tmovl %edx," VG_SYM(r5) "\n"
 "\tpushfl\n"
-"\tpopl r6\n"
+"\tpopl " VG_SYM(r6) "\n"
 
 /* dec %ax */
 "\t.byte 0x66\n"
 "\t.byte 0xFF\n"
 "\t.byte 0xC8\n"
 
-"\tmovl %eax,r7\n"
+"\tmovl %eax," VG_SYM(r7) "\n"
 "\tpushfl\n"
-"\tpopl r8\n"
+"\tpopl " VG_SYM(r8) "\n"
 
 "\tret\n"
 );
index 945dbdf7b7b14e6ddfb7905758efe5a2ee65f1d4..9490dc935ea9b603f6a210933f52af1a41f1ce9c 100644 (file)
@@ -11,12 +11,12 @@ UInt test_jcxz ( UInt arg )
    __asm__ __volatile__(
       "movl %0,%%ecx\n\t"
       "movl $0,%%eax\n"
-      ".Lxyzzy1:\n\t"
-      "jcxz .Lfoobar1\n\t"
+      "0:\n\t"
+      "jcxz 1f\n\t"
       "addl $1, %%eax\n\t"
       "subl $1, %%ecx\n\t"
-      "jmp .Lxyzzy1\n"
-      ".Lfoobar1:\n\t"
+      "jmp 0b\n"
+      "1:\n\t"
       "movl %%eax, %1"
       : /*out*/ : /*in*/ "m"(block[0]),
                          "m"(block[1]) : /*trash*/ "eax","ecx","cc","memory"
@@ -32,12 +32,12 @@ UInt test_jecxz ( UInt arg )
    __asm__ __volatile__(
       "movl %0,%%ecx\n\t"
       "movl $0,%%eax\n"
-      ".Lxyzzy2:\n\t"
-      "jecxz .Lfoobar2\n\t"
+      "0:\n\t"
+      "jecxz 1f\n\t"
       "addl $1, %%eax\n\t"
       "subl $1, %%ecx\n\t"
-      "jmp .Lxyzzy2\n"
-      ".Lfoobar2:\n\t"
+      "jmp 0b\n"
+      "1:\n\t"
       "movl %%eax, %1"
       : /*out*/ : /*in*/ "m"(block[0]),
                          "m"(block[1]) : /*trash*/ "eax","ecx","cc","memory"
index cb6e572d05b57d09bdced68288da646fbe68a95b..fc09352ac97bc39bb61e09548bd9e3a4db38a24e 100644 (file)
@@ -1,9 +1,9 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 
 extern int foo_1 ( void );
 asm("\n"
-"foo_1:\n"
+VG_SYM(foo_1) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
 "\tmovl $0xFFFFFFFF, %eax\n"
@@ -15,7 +15,7 @@ asm("\n"
 
 extern int foo_0 ( void );
 asm("\n"
-"foo_0:\n"
+VG_SYM(foo_0) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
 "\tmovl $0x0, %eax\n"
index 6691ea1b86465442ef0df7459aa7619eabf02aee..60554ec7637d68e405406ce11cb53e5f31696b90 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 
 int arg = 0;
@@ -7,19 +7,18 @@ int res = 0;
 extern void loop_plain ( void );
 asm("\n"
 ".text\n"
-".globl loop_plain\n"
-"loop_plain:\n"
+VG_SYM(loop_plain) ":\n"
 "\tpushl %ecx\n"
 "\tmovl $999, %eax\n"
-"\tmovl arg, %ecx\n"
+"\tmovl " VG_SYM(arg) ", %ecx\n"
 
-".Lmn123plain:\n"
+"0:\n"
 "\tdecl %eax\n"
 "\tdecl %eax\n"
 "\tdecl %eax\n"
-"\tloop .Lmn123plain\n"
+"\tloop 0b\n"
 
-"\tmovl %eax, res\n"
+"\tmovl %eax, " VG_SYM(res) "\n"
 "\tpopl %ecx\n"
 "\tret\n"
 );
@@ -27,19 +26,18 @@ asm("\n"
 extern void loop_ne ( void );
 asm("\n"
 ".text\n"
-".globl loop_ne\n"
-"loop_ne:\n"
+VG_SYM(loop_ne) ":\n"
 "\tpushl %ecx\n"
 "\tmovl $999, %eax\n"
-"\tmovl arg, %ecx\n"
+"\tmovl " VG_SYM(arg) ", %ecx\n"
 
-".Lmn123ne:\n"
+"0:\n"
 "\tdecl %eax\n"
 "\tdecl %eax\n"
 "\tdecl %eax\n"
-"\tloopne .Lmn123ne\n"
+"\tloopne 0b\n"
 
-"\tmovl %eax, res\n"
+"\tmovl %eax, " VG_SYM(res) "\n"
 "\tpopl %ecx\n"
 "\tret\n"
 );
@@ -47,13 +45,12 @@ asm("\n"
 extern void loop_e ( void );
 asm("\n"
 ".text\n"
-".globl loop_e\n"
-"loop_e:\n"
+VG_SYM(loop_e) ":\n"
 "\tpushl %ecx\n"
 "\tmovl $999, %eax\n"
-"\tmovl arg, %ecx\n"
+"\tmovl " VG_SYM(arg) ", %ecx\n"
 
-".Lmn123e:\n"
+"0:\n"
 "\tdecl %eax\n"
 "\tdecl %eax\n"
 "\tdecl %eax\n"
@@ -61,9 +58,9 @@ asm("\n"
 "\tpushfl\n"
 "\txorl $64, 0(%esp)\n"
 "\tpopfl\n"
-"\tloope .Lmn123e\n"
+"\tloope 0b\n"
 
-"\tmovl %eax, res\n"
+"\tmovl %eax, " VG_SYM(res) "\n"
 "\tpopl %ecx\n"
 "\tret\n"
 );
index 48c20526da7ff94187d923f53c18159695afd57b..20340f9f4bd0caee1cf195b0f9cb073afe531d12 100644 (file)
@@ -1,4 +1,4 @@
-
+#include "tests/asm.h"
 #include <stdio.h>
 
 char in_b, out_b1, out_b2, in_b2;
@@ -9,17 +9,17 @@ int in_l, out_l1, out_l2;
 
 extern void sbb_ib_al ( void );
 asm("\n"
-"sbb_ib_al:\n"
+VG_SYM(sbb_ib_al) ":\n"
 
-"\tmovb in_b, %al\n"
+"\tmovb " VG_SYM(in_b) ", %al\n"
 "\tclc\n"
 "\tsbbb $5, %al\n"
-"\tmovb %al, out_b1\n"
+"\tmovb %al, " VG_SYM(out_b1) "\n"
 
-"\tmovb in_b, %al\n"
+"\tmovb " VG_SYM(in_b) ", %al\n"
 "\tstc\n"
 "\tsbbb $5, %al\n"
-"\tmovb %al, out_b2\n"
+"\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
 );
@@ -27,17 +27,17 @@ asm("\n"
 
 extern void sbb_iw_ax ( void );
 asm("\n"
-"sbb_iw_ax:\n"
+VG_SYM(sbb_iw_ax) ":\n"
 
-"\tmovw in_w, %ax\n"
+"\tmovw " VG_SYM(in_w) ", %ax\n"
 "\tclc\n"
 "\tsbbw $555, %ax\n"
-"\tmovw %ax, out_w1\n"
+"\tmovw %ax, " VG_SYM(out_w1) "\n"
 
-"\tmovw in_w, %ax\n"
+"\tmovw " VG_SYM(in_w) ", %ax\n"
 "\tstc\n"
 "\tsbbw $555, %ax\n"
-"\tmovw %ax, out_w2\n"
+"\tmovw %ax, " VG_SYM(out_w2) "\n"
 
 "\tret\n"
 );
@@ -45,17 +45,17 @@ asm("\n"
 
 extern void sbb_il_eax ( void );
 asm("\n"
-"sbb_il_eax:\n"
+VG_SYM(sbb_il_eax) ":\n"
 
-"\tmovl in_l, %eax\n"
+"\tmovl " VG_SYM(in_l) ", %eax\n"
 "\tclc\n"
 "\tsbbl $555666, %eax\n"
-"\tmovl %eax, out_l1\n"
+"\tmovl %eax, " VG_SYM(out_l1) "\n"
 
-"\tmovl in_l, %eax\n"
+"\tmovl " VG_SYM(in_l) ", %eax\n"
 "\tstc\n"
 "\tsbbl $555666, %eax\n"
-"\tmovl %eax, out_l2\n"
+"\tmovl %eax, " VG_SYM(out_l2) "\n"
 
 "\tret\n"
 );
@@ -63,17 +63,17 @@ asm("\n"
 
 extern void sbb_eb_gb ( void );
 asm("\n"
-"sbb_eb_gb:\n"
+VG_SYM(sbb_eb_gb) ":\n"
 
-"\tmovb in_b, %al\n"
+"\tmovb " VG_SYM(in_b) ", %al\n"
 "\tclc\n"
-"\tsbbb in_b2, %al\n"
-"\tmovb %al, out_b1\n"
+"\tsbbb " VG_SYM(in_b2) ", %al\n"
+"\tmovb %al, " VG_SYM(out_b1) "\n"
 
-"\tmovb in_b, %al\n"
+"\tmovb " VG_SYM(in_b) ", %al\n"
 "\tstc\n"
-"\tsbbb in_b2, %al\n"
-"\tmovb %al, out_b2\n"
+"\tsbbb " VG_SYM(in_b2) ", %al\n"
+"\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
 );
@@ -81,20 +81,20 @@ asm("\n"
 
 extern void sbb_eb_gb_2 ( void );
 asm("\n"
-"sbb_eb_gb_2:\n"
+VG_SYM(sbb_eb_gb_2) ":\n"
 "\tpushl %ecx\n"
 
-"\tmovb in_b, %cl\n"
-"\tmovb in_b2, %dh\n"
+"\tmovb " VG_SYM(in_b) ", %cl\n"
+"\tmovb " VG_SYM(in_b2) ", %dh\n"
 "\tclc\n"
 "\tsbbb %dh,%cl\n"
-"\tmovb %cl, out_b1\n"
+"\tmovb %cl, " VG_SYM(out_b1) "\n"
 
-"\tmovb in_b, %cl\n"
-"\tmovb in_b2, %dh\n"
+"\tmovb " VG_SYM(in_b) ", %cl\n"
+"\tmovb " VG_SYM(in_b2) ", %dh\n"
 "\tstc\n"
 "\tsbbb %dh,%cl\n"
-"\tmovb %cl, out_b2\n"
+"\tmovb %cl, " VG_SYM(out_b2) "\n"
 
 "\tpopl %ecx\n"
 "\tret\n"
@@ -103,17 +103,17 @@ asm("\n"
 
 extern void adc_eb_gb ( void );
 asm("\n"
-"adc_eb_gb:\n"
+VG_SYM(adc_eb_gb) ":\n"
 
-"\tmovb in_b, %al\n"
+"\tmovb " VG_SYM(in_b) ", %al\n"
 "\tclc\n"
-"\tadcb in_b2, %al\n"
-"\tmovb %al, out_b1\n"
+"\tadcb " VG_SYM(in_b2) ", %al\n"
+"\tmovb %al, " VG_SYM(out_b1) "\n"
 
-"\tmovb in_b, %al\n"
+"\tmovb " VG_SYM(in_b) ", %al\n"
 "\tstc\n"
-"\tadcb in_b2, %al\n"
-"\tmovb %al, out_b2\n"
+"\tadcb " VG_SYM(in_b2) ", %al\n"
+"\tmovb %al, " VG_SYM(out_b2) "\n"
 
 "\tret\n"
 );
@@ -121,20 +121,20 @@ asm("\n"
 
 extern void adc_eb_gb_2 ( void );
 asm("\n"
-"adc_eb_gb_2:\n"
+VG_SYM(adc_eb_gb_2) ":\n"
 "\tpushl %ecx\n"
 
-"\tmovb in_b, %cl\n"
-"\tmovb in_b2, %dh\n"
+"\tmovb " VG_SYM(in_b) ", %cl\n"
+"\tmovb " VG_SYM(in_b2) ", %dh\n"
 "\tclc\n"
 "\tadcb %dh,%cl\n"
-"\tmovb %cl, out_b1\n"
+"\tmovb %cl, " VG_SYM(out_b1) "\n"
 
-"\tmovb in_b, %cl\n"
-"\tmovb in_b2, %dh\n"
+"\tmovb " VG_SYM(in_b) ", %cl\n"
+"\tmovb " VG_SYM(in_b2) ", %dh\n"
 "\tstc\n"
 "\tadcb %dh,%cl\n"
-"\tmovb %cl, out_b2\n"
+"\tmovb %cl, " VG_SYM(out_b2) "\n"
 
 "\tpopl %ecx\n"
 "\tret\n"
index 5b06f2d3db4829baac6ae449b77d91d0ac4adb34..e01111abf469a3bac91a2389771161db162dfcf5 100644 (file)
@@ -1,5 +1,5 @@
 
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -8,9 +8,7 @@
 
 void maybe_fault ( int delta )
 {
-   char* x = memalign(16/*alignment*/,32/*size*/);
-   assert(x);
-   assert(0 == ((16-1) & (unsigned long)x));
+   char* x = memalign16(32);
    memset(x, 0, 32);
    __asm__ __volatile__(
       "pabsb (%0),%%xmm7"
index 20e7e8f748db7ed65e32d2908ae51ebf8ee078a9..1101ac95cfeec2b779cfb24baac80284c6474f97 100644 (file)
@@ -1,6 +1,5 @@
 
-# For AM_FLAG_M3264_PRI
-include $(top_srcdir)/Makefile.flags.am
+include $(top_srcdir)/Makefile.tool-tests.am
 
 noinst_SCRIPTS = vg_perf
 
@@ -18,9 +17,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
 check_PROGRAMS = \
        bigcode bz2 fbench ffbench heap sarp tinycc
 
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/include
-AM_CFLAGS   = -Winline -Wall -Wshadow -g -O $(AM_FLAG_M3264_PRI)
-AM_CXXFLAGS = $(AM_CFLAGS)
+AM_CFLAGS   += -O $(AM_FLAG_M3264_PRI)
+AM_CXXFLAGS += -O $(AM_FLAG_M3264_PRI)
+
 
 # Extra stuff
 bz2_CFLAGS     = $(AM_CFLAGS) -Wno-inline
index 15b346538bbf0c27e9e1c234a27cac07528bd97d..c36879858be196590ef8333e02eb71574d142757 100644 (file)
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
-#include <sys/mman.h>
+#include "tests/sys_mman.h"
 
 #define FN_SIZE   996      // Must be big enough to hold the compiled f()
 #define N_LOOPS   20000    // Should be divisible by four
index 59b9f33ee570073cc64f026116dff87126d69ac9..739e68f93dacab034231200764f3b2f403ee9d5d 100644 (file)
@@ -6412,7 +6412,7 @@ void set_inbuf ( void )
 }
 
 #include <stdio.h>
-#include <malloc.h>
+#include "tests/malloc.h"
 #include <assert.h>
 
 /* For providing services. */
index f292f77d72ec056a283ab55ce56dc082f6b9a767..0350f0db19f4ecbb75e831a648cb077c8107dd89 100644 (file)
@@ -11,6 +11,11 @@ noinst_SCRIPTS = \
        platform_test \
        vg_regtest
 
+noinst_HEADERS = \
+       asm.h \
+       malloc.h \
+       sys_mman.h
+
 EXTRA_DIST = $(noinst_SCRIPTS)
 
 check_PROGRAMS = \