summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-08-14 00:40:04 +0400
committerIvan Maidanski <ivmai@mail.ru>2013-08-14 00:40:04 +0400
commitf7600375c503d6dd5fb8105937d96e5b1039c214 (patch)
treef59da48ffd0a2feb144b7b749c864ca0fe8dcee3 /tests
parenta9a05e8478d8971d02880bdcbf5bda4e0c2ce662 (diff)
downloadlibatomic_ops-f7600375c503d6dd5fb8105937d96e5b1039c214.tar.gz
tests: Add char/short/int/AO_double_t and dd_acquire cases to list_atomic
* tests/Makefile.am (list_atomic.c): Iterate over XSIZE/XCTYPE (in addition to XX); expand XX also as _dd_acquire_read. * tests/list_atomic.template (XSIZE_list_atomicXX): Define 'val' local variable only if used (needed for AO_double_t case).
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am39
-rw-r--r--tests/list_atomic.template9
2 files changed, 46 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f044c37..1c1e6c8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -45,7 +45,7 @@ test_atomic_include.h: test_atomic_include.template
sed -e s/XX/_acquire_read/ $? >> $@
list_atomic.c: list_atomic.template
- echo "#include \"atomic_ops.h\" " > $@
+ echo "#include \"atomic_ops.h\"" > $@
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX// $? >> $@
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX/_release/ $? >> $@
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX/_acquire/ $? >> $@
@@ -54,6 +54,43 @@ list_atomic.c: list_atomic.template
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX/_full/ $? >> $@
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX/_release_write/ $? >> $@
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX/_acquire_read/ $? >> $@
+ sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g -e s/XX/_dd_acquire_read/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX// $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_release/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_acquire/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_read/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_write/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_full/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_release_write/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_acquire_read/ $? >> $@
+ sed -e s:XSIZE:char:g -e s:XCTYPE:unsigned/**/char:g -e s/XX/_dd_acquire_read/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX// $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_release/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_acquire/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_read/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_write/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_full/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_release_write/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_acquire_read/ $? >> $@
+ sed -e s:XSIZE:short:g -e s:XCTYPE:unsigned/**/short:g -e s/XX/_dd_acquire_read/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX// $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_release/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_acquire/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_read/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_write/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_full/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_release_write/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_acquire_read/ $? >> $@
+ sed -e s:XSIZE:int:g -e s:XCTYPE:unsigned:g -e s/XX/_dd_acquire_read/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX// $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_release/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_acquire/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_read/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_write/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_full/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_release_write/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_acquire_read/ $? >> $@
+ sed -e s:XSIZE:double:g -e s:XCTYPE:AO_double_t:g -e s/XX/_dd_acquire_read/ $? >> $@
list_atomic.i: list_atomic.c
$(COMPILE) $? -E > $@
diff --git a/tests/list_atomic.template b/tests/list_atomic.template
index 5a07b2a..3705484 100644
--- a/tests/list_atomic.template
+++ b/tests/list_atomic.template
@@ -13,7 +13,14 @@
void XSIZE_list_atomicXX(void)
{
- volatile XCTYPE val;
+# if defined(AO_HAVE_XSIZE_loadXX) || defined(AO_HAVE_XSIZE_storeXX) \
+ || defined(AO_HAVE_XSIZE_fetch_and_addXX) \
+ || defined(AO_HAVE_XSIZE_fetch_and_add1XX) \
+ || defined(AO_HAVE_XSIZE_andXX) \
+ || defined(AO_HAVE_XSIZE_compare_and_swapXX) \
+ || defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
+ volatile XCTYPE val;
+# endif
# if defined(AO_HAVE_XSIZE_compare_and_swapXX) \
|| defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
static XCTYPE oldval /* = 0 */;