From 7ba0e52c39ae2a57933a856ce363ab0361ad1ed9 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 8 Sep 2004 06:09:02 +0000 Subject: 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. --- csu/tst-atomic.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'csu') diff --git a/csu/tst-atomic.c b/csu/tst-atomic.c index 6104466..cb6b6ba 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 , 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) -- cgit v1.1