diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-09-08 06:09:02 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-09-08 06:09:02 +0000 |
commit | 7ba0e52c39ae2a57933a856ce363ab0361ad1ed9 (patch) | |
tree | aaabd4f3d63a9a27d7c8f4fb1105bcc3c5ef26a2 /csu/tst-atomic.c | |
parent | f510d815bec80c004b194aaf4847fa40069cfd18 (diff) | |
download | glibc-7ba0e52c39ae2a57933a856ce363ab0361ad1ed9.tar.gz glibc-7ba0e52c39ae2a57933a856ce363ab0361ad1ed9.tar.xz glibc-7ba0e52c39ae2a57933a856ce363ab0361ad1ed9.zip |
Update.
* sysdeps/powerpc/bits/atomic.h (atomic_increment): Define. (atomic_decrement): Define. * sysdeps/powerpc/bits/atomic.h: Implement atomic_increment_val and atomic_decrement_val. * sysdeps/powerpc/powerpc32/bits/atomic.h: Likewise. * sysdeps/powerpc/powerpc64/bits/atomic.h: Likewise. * csu/tst-atomic.c (do_test): Add tests of atomic_increment_val and atomic_decrement_val.
Diffstat (limited to 'csu/tst-atomic.c')
-rw-r--r-- | csu/tst-atomic.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/csu/tst-atomic.c b/csu/tst-atomic.c index 6104466739..cb6b6ba3d4 100644 --- a/csu/tst-atomic.c +++ b/csu/tst-atomic.c @@ -1,5 +1,5 @@ /* Tests for atomic.h macros. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -130,6 +130,12 @@ do_test (void) ret = 1; } + if (atomic_increment_val (&mem) != 1) + { + puts ("atomic_increment_val test failed"); + ret = 1; + } + mem = 0; if (atomic_increment_and_test (&mem) || mem != 1) @@ -162,6 +168,12 @@ do_test (void) ret = 1; } + if (atomic_decrement_val (&mem) != 15) + { + puts ("atomic_decrement_val test failed"); + ret = 1; + } + mem = 0; if (atomic_decrement_and_test (&mem) || mem != -1) |