3
* Copyright (c) 2007-2010 The University of Utah
6
* This file is part of `csmith', a random generator of C programs.
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions are met:
11
* * Redistributions of source code must retain the above copyright notice,
12
* this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above copyright
15
* notice, this list of conditions and the following disclaimer in the
16
* documentation and/or other materials provided with the distribution.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
* POSSIBILITY OF SUCH DAMAGE.
35
#if defined(STANDALONE)
38
#include "windows/stdint.h"
39
#elif defined (IA32_ARCH)
40
#include "stdint_ia32.h"
41
#elif defined (IA64_ARCH)
42
#include "stdint_ia64.h"
43
#elif defined (MSP430)
44
#include "stdint_msp430.h"
45
#elif defined (AVR_ARCH)
46
#include "stdint_avr.h"
48
#include "stdint_ia32.h"
53
#include "windows/stdint.h"
61
/*****************************************************************************/
69
/*****************************************************************************/
73
char __failed_checks[N_WRAP+1];
74
char __executed_checks[N_WRAP+1];
75
#define UNDEFINED(__val) (__failed_checks[index]=1,(__val))
76
#define LOG_INDEX , int index
77
#define LOG_EXEC __executed_checks[index]=1;
79
#define UNDEFINED(__val) (__val)
85
#include "platform_avr.h"
86
#elif defined (MSP430)
87
#include "platform_msp430.h"
89
#include "platform_generic.h"
94
#if defined (USE_MATH_MACROS_NOTMP)
95
#include "safe_math_macros_notmp.h"
96
#elif defined (USE_MATH_MACROS)
97
#include "safe_math_macros.h"
99
#define FUNC_NAME(x) (safe_##x)
100
#include "safe_math.h"
104
#define INT_BIT (sizeof(int)*CHAR_BIT)
105
#define _CSMITH_BITFIELD(x) (((x)>INT_BIT)?((x)%INT_BIT):(x))
109
void* memcpy(void* dest, const void* src, size_t count) {
110
char* dst8 = (char*)dest;
111
char* src8 = (char*)src;
119
void *memset(void *s, int c, size_t n)
123
*p++ = (unsigned char)c;
129
#endif // RANDOM_INC_H