From: Ivan Maidanski Date: Tue, 13 Aug 2013 20:40:04 +0000 (+0400) Subject: tests: Add char/short/int/AO_double_t and dd_acquire cases to list_atomic X-Git-Tag: libatomic_ops-7_4_0~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7600375c503d6dd5fb8105937d96e5b1039c214;p=libatomic_ops 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). --- 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 */;