aboutsummaryrefslogtreecommitdiff
path: root/csu
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-22 23:38:18 +0000
committerRoland McGrath <roland@gnu.org>2003-03-22 23:38:18 +0000
commitfe4610b3014b1de2e60c681cbd813bb18ff2afc8 (patch)
tree46a2ebdd352177f45bd9f96913f53c30bafa6a54 /csu
parentd15851ec24d31ccf3ee9a4a388104974d1f494dc (diff)
downloadglibc-fe4610b3014b1de2e60c681cbd813bb18ff2afc8.zip
glibc-fe4610b3014b1de2e60c681cbd813bb18ff2afc8.tar.gz
glibc-fe4610b3014b1de2e60c681cbd813bb18ff2afc8.tar.bz2
* include/atomic.h: Put parens around all macro arguments.
(__atomic_val_bysize, __atomic_bool_bysize): New macros. (atomic_compare_and_exchange_val_acq): Use it. (atomic_compare_and_exchange_bool_acq): Likewise. (atomic_increment_and_test): Invert sense of test. (atomic_decrement_and_test): Likewise. * csu/tst-atomic.c: Update those tests to match.
Diffstat (limited to 'csu')
-rw-r--r--csu/tst-atomic.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/csu/tst-atomic.c b/csu/tst-atomic.c
index 727229e..292f6e7 100644
--- a/csu/tst-atomic.c
+++ b/csu/tst-atomic.c
@@ -99,7 +99,7 @@ do_test (void)
}
mem = 0;
- if (! atomic_increment_and_test (&mem)
+ if (atomic_increment_and_test (&mem)
|| mem != 1)
{
puts ("atomic_increment_and_test test 1 failed");
@@ -114,6 +114,14 @@ do_test (void)
ret = 1;
}
+ mem = -1;
+ if (! atomic_increment_and_test (&mem)
+ || mem != 0)
+ {
+ puts ("atomic_increment_and_test test 3 failed");
+ ret = 1;
+ }
+
mem = 17;
atomic_decrement (&mem);
if (mem != 16)
@@ -123,7 +131,7 @@ do_test (void)
}
mem = 0;
- if (! atomic_decrement_and_test (&mem)
+ if (atomic_decrement_and_test (&mem)
|| mem != -1)
{
puts ("atomic_decrement_and_test test 1 failed");
@@ -139,6 +147,14 @@ do_test (void)
}
mem = 1;
+ if (! atomic_decrement_and_test (&mem)
+ || mem != 0)
+ {
+ puts ("atomic_decrement_and_test test 1 failed");
+ ret = 1;
+ }
+
+ mem = 1;
if (atomic_decrement_if_positive (&mem) != 1
|| mem != 0)
{