]> granicus.if.org Git - libatomic_ops/commitdiff
tests: Add char/short/int/AO_double_t and dd_acquire cases to list_atomic
authorIvan Maidanski <ivmai@mail.ru>
Tue, 13 Aug 2013 20:40:04 +0000 (00:40 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 13 Aug 2013 20:40:04 +0000 (00:40 +0400)
* 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).

tests/Makefile.am
tests/list_atomic.template

index f044c373e9162a6d5fd6fa89fd5d1de88e9f75da..1c1e6c82cc4ffde8d40308f8547fcf4790cea0cc 100644 (file)
@@ -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 > $@
index 5a07b2a48b5624726165dc5657175abbeb4c0c42..370548408cdbdca0e4bc2d00cb163f11a5fe03a5 100644 (file)
 
 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 */;