/*
 * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
 *
 * This file is covered by the GNU general public license, version 2.
 * see COPYING for details.
 */

/* This generates a compilable program.  But it is really meant to be   */
/* be used only with cc -E, to inspect the expensions generated by      */
/* primitives.                                                          */

/* The result will not link or run.                                     */

#include <stdlib.h> /* for exit() */

void XSIZE_list_atomicXX(void)
{
# 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)
    static volatile XCTYPE val /* = 0 */;
# endif
# if defined(AO_HAVE_XSIZE_compare_and_swapXX) \
     || defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
    static XCTYPE oldval /* = 0 */;
# endif
# if defined(AO_HAVE_XSIZE_storeXX) \
     || defined(AO_HAVE_XSIZE_compare_and_swapXX) \
     || defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
    static XCTYPE newval /* = 0 */;
# endif
# if defined(AO_HAVE_test_and_setXX)
    AO_TS_t ts;
# endif
# if defined(AO_HAVE_XSIZE_fetch_and_addXX) || defined(AO_HAVE_XSIZE_andXX) \
     || defined(AO_HAVE_XSIZE_orXX) || defined(AO_HAVE_XSIZE_xorXX)
    static XCTYPE incr /* = 0 */;
# endif

# if defined(AO_HAVE_nopXX)
    (void)"AO_nopXX(): ";
    AO_nopXX();
# else
    (void)"No AO_nopXX";
# endif

# ifdef AO_HAVE_XSIZE_loadXX
    (void)"AO_XSIZE_loadXX(&val):";
    (void)AO_XSIZE_loadXX(&val);
# else
    (void)"No AO_XSIZE_loadXX";
# endif
# ifdef AO_HAVE_XSIZE_storeXX
    (void)"AO_XSIZE_storeXX(&val, newval):";
    AO_XSIZE_storeXX(&val, newval);
# else
    (void)"No AO_XSIZE_storeXX";
# endif
# ifdef AO_HAVE_XSIZE_fetch_and_addXX
    (void)"AO_XSIZE_fetch_and_addXX(&val, incr):";
    (void)AO_XSIZE_fetch_and_addXX(&val, incr);
# else
    (void)"No AO_XSIZE_fetch_and_addXX";
# endif
# ifdef AO_HAVE_XSIZE_fetch_and_add1XX
    (void)"AO_XSIZE_fetch_and_add1XX(&val):";
    (void)AO_XSIZE_fetch_and_add1XX(&val);
# else
    (void)"No AO_XSIZE_fetch_and_add1XX";
# endif
# ifdef AO_HAVE_XSIZE_fetch_and_sub1XX
    (void)"AO_XSIZE_fetch_and_sub1XX(&val):";
    (void)AO_XSIZE_fetch_and_sub1XX(&val);
# else
    (void)"No AO_XSIZE_fetch_and_sub1XX";
# endif
# ifdef AO_HAVE_XSIZE_andXX
    (void)"AO_XSIZE_andXX(&val, incr):";
    AO_XSIZE_andXX(&val, incr);
# else
    (void)"No AO_XSIZE_andXX";
# endif
# ifdef AO_HAVE_XSIZE_orXX
    (void)"AO_XSIZE_orXX(&val, incr):";
    AO_XSIZE_orXX(&val, incr);
# else
    (void)"No AO_XSIZE_orXX";
# endif
# ifdef AO_HAVE_XSIZE_xorXX
    (void)"AO_XSIZE_xorXX(&val, incr):";
    AO_XSIZE_xorXX(&val, incr);
# else
    (void)"No AO_XSIZE_xorXX";
# endif
# ifdef AO_HAVE_XSIZE_compare_and_swapXX
    (void)"AO_XSIZE_compare_and_swapXX(&val, oldval, newval):";
    if (!AO_XSIZE_compare_and_swapXX(&val, oldval, newval))
      exit(1);
# else
    (void)"No AO_XSIZE_compare_and_swapXX";
# endif
  /* TODO: Add AO_compare_double_and_swap_doubleXX */
  /* TODO: Add AO_compare_and_swap_doubleXX */
# ifdef AO_HAVE_XSIZE_fetch_compare_and_swapXX
    (void)"AO_XSIZE_fetch_compare_and_swapXX(&val, oldval, newval):";
    if (AO_XSIZE_fetch_compare_and_swapXX(&val, oldval, newval) != oldval)
      exit(1);
# else
    (void)"No AO_XSIZE_fetch_compare_and_swapXX";
# endif

# if defined(AO_HAVE_test_and_setXX)
    (void)"AO_test_and_setXX(&ts):";
    (void)AO_test_and_setXX(&ts);
# else
    (void)"No AO_test_and_setXX";
# endif
}
