/*
* Copyright (C) 2011, 2013, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <config.h>
#include <ctype.h>
#include <stdlib.h>
char *progname;
#if defined(ISC_PLATFORM_HAVEXADD) || defined(ISC_PLATFORM_HAVEXADDQ) || \
defined(ISC_PLATFORM_HAVEATOMICSTORE) || \
defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
static void
setup(void) {
}
static void
teardown(void) {
}
#endif
typedef struct {
} counter_t;
#if defined(ISC_PLATFORM_HAVEXADD)
static void
int i;
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
}
} else {
isc_event_free(&ev);
}
}
static void
test_atomic_xadd() {
int test_result;
int i;
"ensure that isc_atomic_xadd() works.");
setup();
counter_32 = 0;
/*
* Create our tasks, and allocate an event to get the counters going.
*/
for (i = 0 ; i < TASKS ; i++) {
}
teardown();
if (counter_32 != EXPECTED_COUNT_32)
counter_32 = 0;
}
#endif
#if defined(ISC_PLATFORM_HAVEXADDQ)
static void
int i;
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
}
} else {
isc_event_free(&ev);
}
}
static void
int test_result;
int i;
"ensure that isc_atomic_xaddq() works.");
setup();
counter_64 = 0;
/*
* Create our tasks, and allocate an event to get the counters going.
*/
for (i = 0 ; i < TASKS ; i++) {
}
teardown();
if (counter_64 != EXPECTED_COUNT_64)
counter_64 = 0;
}
#endif
#ifdef ISC_PLATFORM_HAVEATOMICSTORE
static void
int i;
isc_uint32_t r;
r = random() % 256;
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
}
} else {
isc_event_free(&ev);
}
}
static void
int test_result;
int i;
isc_uint32_t r;
"ensure that isc_atomic_store() works.");
setup();
store_32 = 0;
/*
* Create our tasks, and allocate an event to get the counters
* going.
*/
for (i = 0 ; i < TASKS ; i++) {
&counters[i],
sizeof(struct isc_event));
}
teardown();
r = store_32 & 0xff;
t_info("32-bit store 0x%x, expected 0x%x\n",
store_32 = 0;
}
#endif
#if defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
static void
int i;
isc_uint8_t r;
r = random() % 256;
((isc_uint64_t) r << 16) |
((isc_uint64_t) r << 8) |
(isc_uint64_t) r);
for (i = 0 ; i < COUNTS_PER_ITERATION ; i++) {
}
} else {
isc_event_free(&ev);
}
}
static void
int test_result;
int i;
isc_uint8_t r;
"ensure that isc_atomic_storeq() works.");
setup();
store_64 = 0;
/*
* Create our tasks, and allocate an event to get the counters going.
*/
for (i = 0 ; i < TASKS ; i++) {
}
teardown();
r = store_64 & 0xff;
((isc_uint64_t) r << 16) |
((isc_uint64_t) r << 8) |
(isc_uint64_t) r);
store_64 = 0;
}
#endif /* ISC_PLATFORM_HAVEATOMICSTOREQ */
#if defined(ISC_PLATFORM_HAVEXADD)
#endif
#if defined(ISC_PLATFORM_HAVEXADDQ)
#endif
#ifdef ISC_PLATFORM_HAVEATOMICSTORE
#endif
#if defined(ISC_PLATFORM_HAVEATOMICSTOREQ)
#endif
};
#ifdef WIN32
int
}
#endif