]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't break the build on AIX5.3.
authorJulian Seward <jseward@acm.org>
Tue, 27 Nov 2007 11:23:55 +0000 (11:23 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 27 Nov 2007 11:23:55 +0000 (11:23 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7240

helgrind/tests/tc07_hbl1.c
helgrind/tests/tc08_hbl2.c
helgrind/tests/tc19_shadowmem.c
helgrind/tests/tc20_verifywrap.c

index 58e6564cd7ae5d90f8a709294f563bb02d12f9c5..12253aa21a29fb68ad10a635e2bb7787aecd60df 100644 (file)
 #  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 @@ int x = 0;
 
 void* child_fn ( void* arg )
 {
-   INC(x);
+   INC(x, "childfn");
    return NULL;
 }
 
@@ -65,7 +65,7 @@ int main ( void )
       exit(1);
    }
 
-   INC(x);
+   INC(x, "main");
 
    if (pthread_join(child, NULL)) {
       perror("pthread join");
index 5362faae41195aa1271d2125625f5d23fe451ca1..d67435ab5f69c5e0b505630983f296c4af341069 100644 (file)
 #  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 @@ int main ( void )
    }
 
    for (i = 0; i < LIMIT; i++) {
-      INC(x);
+      INC(x, "main");
       if (i == 5) sleep(1); /* make sure child doesn't starve */
    }
 
index d652fa928e89f1c4e4ec038c9de85ea755d11bf5..a56cec3bbf2c40502c9dc930ae07922ab09205ba 100644 (file)
@@ -2286,6 +2286,6 @@ void* steer ( void* infoV )
    __asm__ __volatile__("");
    if (wot == 999) return fn(info);
    __asm__ __volatile__("");
-
    assert(0);
+   return 0; /* keep gcc happy on AIX */
 }
index 81ea512bcf8e465bb3b49f062f86b64b251570eb..0a1f7d612268d23d9935dd41ad7ac816ca76c802 100644 (file)
@@ -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 @@ int main ( void )
 
    return 0;
 }
+
+#else /* defined(_AIX) */
+int main ( void )
+{
+   fprintf(stderr, "This program does not work on AIX.\n");
+   return 0;
+}
+#endif