Author: sewardj
Date: 2007-11-27 11:23:55 +0000 (Tue, 27 Nov 2007)
New Revision: 7240

Log:
Don't break the build on AIX5.3.

Modified:
   trunk/helgrind/tests/tc07_hbl1.c
   trunk/helgrind/tests/tc08_hbl2.c
   trunk/helgrind/tests/tc19_shadowmem.c
   trunk/helgrind/tests/tc20_verifywrap.c


Modified: trunk/helgrind/tests/tc07_hbl1.c
===================================================================
--- trunk/helgrind/tests/tc07_hbl1.c    2007-11-27 02:03:44 UTC (rev 7239)
+++ trunk/helgrind/tests/tc07_hbl1.c    2007-11-27 11:23:55 UTC (rev 7240)
@@ -27,19 +27,19 @@
 #  define PLAT_ppc32_aix5 1
 #endif
 
-
 #if defined(PLAT_amd64_linux) || defined(PLAT_x86_linux)
-#  define INC(_lval) \
+#  define INC(_lval,_lqual) \
       __asm__ __volatile__ ( \
       "lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" )
-#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux)
-#  define INC(_lval)                      \
+#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \
+      || defined(PLAT_ppc32_aix5) || defined(PLAT_ppc64_aix5)
+#  define INC(_lval,_lqual)               \
    __asm__ __volatile__(                  \
-      "1:\n"                              \
+      "L1xyzzy1" _lqual ":\n"             \
       "        lwarx 15,0,%0\n"           \
       "        addi 15,15,1\n"            \
       "        stwcx. 15,0,%0\n"          \
-      "        bne- 1b"                   \
+      "        bne- L1xyzzy1" _lqual      \
       : /*out*/ : /*in*/ "b"(&(_lval))    \
       : /*trash*/ "r15", "cr0", "memory"  \
    )
@@ -52,7 +52,7 @@
 
 void* child_fn ( void* arg )
 {
-   INC(x);
+   INC(x, "childfn");
    return NULL;
 }
 
@@ -65,7 +65,7 @@
       exit(1);
    }
 
-   INC(x);
+   INC(x, "main");
 
    if (pthread_join(child, NULL)) {
       perror("pthread join");

Modified: trunk/helgrind/tests/tc08_hbl2.c
===================================================================
--- trunk/helgrind/tests/tc08_hbl2.c    2007-11-27 02:03:44 UTC (rev 7239)
+++ trunk/helgrind/tests/tc08_hbl2.c    2007-11-27 11:23:55 UTC (rev 7240)
@@ -44,19 +44,19 @@
 #  define PLAT_ppc32_aix5 1
 #endif
 
-
 #if defined(PLAT_amd64_linux) || defined(PLAT_x86_linux)
-#  define INC(_lval) \
+#  define INC(_lval,_lqual)         \
       __asm__ __volatile__ ( \
       "lock ; incl (%0)" : /*out*/ : /*in*/"r"(&(_lval)) : "memory", "cc" )
-#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux)
-#  define INC(_lval)                      \
+#elif defined(PLAT_ppc32_linux) || defined(PLAT_ppc64_linux) \
+      || defined(PLAT_ppc32_aix5) || defined(PLAT_ppc64_aix5)
+#  define INC(_lval,_lqual)              \
    __asm__ __volatile__(                  \
-      "1:\n"                              \
+      "L1xyzzy1" _lqual ":\n"             \
       "        lwarx 15,0,%0\n"           \
       "        addi 15,15,1\n"            \
       "        stwcx. 15,0,%0\n"          \
-      "        bne- 1b"                   \
+      "        bne- L1xyzzy1" _lqual      \
       : /*out*/ : /*in*/ "b"(&(_lval))    \
       : /*trash*/ "r15", "cr0", "memory"  \
    )
@@ -102,7 +102,7 @@
    }
 
    for (i = 0; i < LIMIT; i++) {
-      INC(x);
+      INC(x, "main");
       if (i == 5) sleep(1); /* make sure child doesn't starve */
    }
 

Modified: trunk/helgrind/tests/tc19_shadowmem.c
===================================================================
--- trunk/helgrind/tests/tc19_shadowmem.c       2007-11-27 02:03:44 UTC (rev 
7239)
+++ trunk/helgrind/tests/tc19_shadowmem.c       2007-11-27 11:23:55 UTC (rev 
7240)
@@ -2286,6 +2286,6 @@
    __asm__ __volatile__("");
    if (wot == 999) return fn(info);
    __asm__ __volatile__("");
-
    assert(0);
+   return 0; /* keep gcc happy on AIX */
 }

Modified: trunk/helgrind/tests/tc20_verifywrap.c
===================================================================
--- trunk/helgrind/tests/tc20_verifywrap.c      2007-11-27 02:03:44 UTC (rev 
7239)
+++ trunk/helgrind/tests/tc20_verifywrap.c      2007-11-27 11:23:55 UTC (rev 
7240)
@@ -1,4 +1,3 @@
-
 /* This program attempts to verify that all functions that are
    supposed to be wrapped by tc_intercepts.c really are wrapped.  The
    main way it does this is to cause failures in those functions, so
@@ -12,7 +11,6 @@
    otherwise "know" about some more exotic pthread stuff, in this case
    PTHREAD_MUTEX_ERRORCHECK. */
 #define _GNU_SOURCE 1
-
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
@@ -20,6 +18,8 @@
 #include <pthread.h>
 #include <semaphore.h>
 
+#if !defined(_AIX)
+
 #if !defined(__GLIBC_PREREQ)
 # error "This program needs __GLIBC_PREREQ (in /usr/include/features.h)"
 #endif
@@ -260,3 +260,11 @@
 
    return 0;
 }
+
+#else /* defined(_AIX) */
+int main ( void )
+{
+   fprintf(stderr, "This program does not work on AIX.\n");
+   return 0;
+}
+#endif


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to