| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/* |
| 2 |
|
|
* Copyright © 2025, Niklas Haas |
| 3 |
|
|
* Copyright © 2018, VideoLAN and dav1d authors |
| 4 |
|
|
* Copyright © 2018, Two Orioles, LLC |
| 5 |
|
|
* All rights reserved. |
| 6 |
|
|
* |
| 7 |
|
|
* Redistribution and use in source and binary forms, with or without |
| 8 |
|
|
* modification, are permitted provided that the following conditions are met: |
| 9 |
|
|
* |
| 10 |
|
|
* 1. Redistributions of source code must retain the above copyright notice, this |
| 11 |
|
|
* list of conditions and the following disclaimer. |
| 12 |
|
|
* |
| 13 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice, |
| 14 |
|
|
* this list of conditions and the following disclaimer in the documentation |
| 15 |
|
|
* and/or other materials provided with the distribution. |
| 16 |
|
|
* |
| 17 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 18 |
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 |
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 |
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 21 |
|
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 |
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 |
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 |
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 26 |
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 |
|
|
*/ |
| 28 |
|
|
|
| 29 |
|
|
#include <assert.h> |
| 30 |
|
|
#include <inttypes.h> |
| 31 |
|
|
#include <limits.h> |
| 32 |
|
|
#include <math.h> |
| 33 |
|
|
#include <stdarg.h> |
| 34 |
|
|
#include <stdio.h> |
| 35 |
|
|
#include <stdlib.h> |
| 36 |
|
|
#include <string.h> |
| 37 |
|
|
#include <time.h> |
| 38 |
|
|
|
| 39 |
|
|
#include "checkasm_config.h" |
| 40 |
|
|
|
| 41 |
|
|
#ifdef _WIN32 |
| 42 |
|
|
#include <windows.h> |
| 43 |
|
|
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING |
| 44 |
|
|
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x04 |
| 45 |
|
|
#endif |
| 46 |
|
|
#else |
| 47 |
|
|
#if HAVE_ISATTY |
| 48 |
|
|
#include <unistd.h> |
| 49 |
|
|
#endif |
| 50 |
|
|
#if HAVE_IOCTL |
| 51 |
|
|
#include <sys/ioctl.h> |
| 52 |
|
|
#endif |
| 53 |
|
|
#endif |
| 54 |
|
|
|
| 55 |
|
|
#if defined(__APPLE__) && defined(__MACH__) |
| 56 |
|
|
#include <mach/mach_time.h> |
| 57 |
|
|
#endif |
| 58 |
|
|
|
| 59 |
|
|
#include "checkasm/test.h" |
| 60 |
|
|
#include "checkasm/utils.h" |
| 61 |
|
|
#include "internal.h" |
| 62 |
|
|
|
| 63 |
|
✗ |
NOINLINE void checkasm_noop(void *ptr) |
| 64 |
|
|
{ |
| 65 |
|
|
(void) ptr; |
| 66 |
|
✗ |
} |
| 67 |
|
|
|
| 68 |
|
|
static ALWAYS_INLINE uint64_t gettime_nsec(int is_seed) |
| 69 |
|
|
{ |
| 70 |
|
|
#ifdef _WIN32 |
| 71 |
|
|
static LARGE_INTEGER freq; |
| 72 |
|
|
LARGE_INTEGER ts; |
| 73 |
|
|
if (!freq.QuadPart) { |
| 74 |
|
|
if (!QueryPerformanceFrequency(&freq)) |
| 75 |
|
|
return -1; |
| 76 |
|
|
} |
| 77 |
|
|
if (!QueryPerformanceCounter(&ts)) |
| 78 |
|
|
return -1; |
| 79 |
|
|
return UINT64_C(1000000000) * ts.QuadPart / freq.QuadPart; |
| 80 |
|
|
#elif defined(__APPLE__) && defined(__MACH__) |
| 81 |
|
|
static mach_timebase_info_data_t tb_info; |
| 82 |
|
|
if (!tb_info.denom) { |
| 83 |
|
|
if (mach_timebase_info(&tb_info) != KERN_SUCCESS) |
| 84 |
|
|
return -1; |
| 85 |
|
|
} |
| 86 |
|
|
return mach_absolute_time() * tb_info.numer / tb_info.denom; |
| 87 |
|
|
#elif HAVE_CLOCK_GETTIME |
| 88 |
|
|
struct timespec ts; |
| 89 |
|
|
clockid_t id; |
| 90 |
|
103 |
if (!is_seed) { |
| 91 |
|
|
#ifdef CLOCK_MONOTONIC_RAW |
| 92 |
|
✗ |
id = CLOCK_MONOTONIC_RAW; |
| 93 |
|
|
#else |
| 94 |
|
|
id = CLOCK_MONOTONIC; |
| 95 |
|
|
#endif |
| 96 |
|
|
} else { |
| 97 |
|
103 |
id = CLOCK_REALTIME; |
| 98 |
|
|
} |
| 99 |
1/2
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 8 taken 103 times.
|
103 |
if (clock_gettime(id, &ts) < 0) |
| 100 |
|
✗ |
return -1; |
| 101 |
|
103 |
return UINT64_C(1000000000) * ts.tv_sec + ts.tv_nsec; |
| 102 |
|
|
#else |
| 103 |
|
|
return -1; |
| 104 |
|
|
#endif |
| 105 |
|
|
} |
| 106 |
|
|
|
| 107 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
uint64_t checkasm_gettime_nsec(void) |
| 108 |
|
|
{ |
| 109 |
|
✗ |
return gettime_nsec(0); |
| 110 |
|
|
} |
| 111 |
|
|
|
| 112 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
uint64_t checkasm_gettime_nsec_diff(uint64_t t) |
| 113 |
|
|
{ |
| 114 |
|
✗ |
return gettime_nsec(0) - t; |
| 115 |
|
|
} |
| 116 |
|
|
|
| 117 |
1/2
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 103 times.
|
103 |
unsigned checkasm_seed(void) |
| 118 |
|
|
{ |
| 119 |
|
103 |
return (unsigned) gettime_nsec(1); |
| 120 |
|
|
} |
| 121 |
|
|
|
| 122 |
|
|
// (parallel) xoshiro128++ from https://prng.di.unimi.it/ |
| 123 |
|
|
typedef struct CheckasmRand { |
| 124 |
|
|
#define CHECKASM_PRNG_NUM 4 |
| 125 |
|
|
uint32_t s0[CHECKASM_PRNG_NUM]; |
| 126 |
|
|
uint32_t s1[CHECKASM_PRNG_NUM]; |
| 127 |
|
|
uint32_t s2[CHECKASM_PRNG_NUM]; |
| 128 |
|
|
uint32_t s3[CHECKASM_PRNG_NUM]; |
| 129 |
|
|
} CheckasmRand; |
| 130 |
|
|
|
| 131 |
|
|
static CheckasmRand checkasm_prng; |
| 132 |
|
|
|
| 133 |
|
|
static ALWAYS_INLINE uint32_t rotl(const uint32_t x, int k) |
| 134 |
|
|
{ |
| 135 |
|
836163584 |
return (x << k) | (x >> (32 - k)); |
| 136 |
|
|
} |
| 137 |
|
|
|
| 138 |
|
|
/* Single round of a parallel xoshiro128++, generates a full block */ |
| 139 |
|
|
static ALWAYS_INLINE void xoshiro128pp(CheckasmRand *restrict xs, uint32_t *restrict buf) |
| 140 |
|
|
{ |
| 141 |
2/4
✓ Branch 9 → 4 taken 418081792 times.
✓ Branch 9 → 10 taken 104520448 times.
✗ Branch 20 → 15 not taken.
✗ Branch 20 → 21 not taken.
|
522602240 |
for (int i = 0; i < CHECKASM_PRNG_NUM; i++) { |
| 142 |
|
418081792 |
buf[i] = rotl(xs->s0[i] + xs->s3[i], 7) + xs->s0[i]; |
| 143 |
|
|
|
| 144 |
|
418081792 |
const uint32_t t = xs->s1[i] << 9; |
| 145 |
|
418081792 |
xs->s2[i] ^= xs->s0[i]; |
| 146 |
|
418081792 |
xs->s3[i] ^= xs->s1[i]; |
| 147 |
|
418081792 |
xs->s1[i] ^= xs->s2[i]; |
| 148 |
|
418081792 |
xs->s0[i] ^= xs->s3[i]; |
| 149 |
|
418081792 |
xs->s2[i] ^= t; |
| 150 |
|
836163584 |
xs->s3[i] = rotl(xs->s3[i], 11); |
| 151 |
|
|
} |
| 152 |
|
104520448 |
} |
| 153 |
|
|
|
| 154 |
|
26129833 |
static void prng(CheckasmRand *restrict xs, uint8_t *restrict buf, size_t size) |
| 155 |
|
|
{ |
| 156 |
|
|
uint32_t tmp[CHECKASM_PRNG_NUM]; |
| 157 |
|
26129833 |
const size_t block_size = sizeof(tmp); |
| 158 |
|
26129833 |
CheckasmRand xs_copy = *xs; |
| 159 |
|
|
|
| 160 |
2/2
✓ Branch 12 → 3 taken 104520448 times.
✓ Branch 12 → 13 taken 26129833 times.
|
130650281 |
while (size >= block_size) { |
| 161 |
|
|
xoshiro128pp(&xs_copy, tmp); |
| 162 |
|
104520448 |
memcpy(buf, tmp, block_size); |
| 163 |
|
104520448 |
buf += block_size; |
| 164 |
|
104520448 |
size -= block_size; |
| 165 |
|
|
} |
| 166 |
|
|
|
| 167 |
1/2
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 23 taken 26129833 times.
|
26129833 |
if (size) { |
| 168 |
|
|
xoshiro128pp(&xs_copy, tmp); |
| 169 |
|
✗ |
memcpy(buf, tmp, size); |
| 170 |
|
|
} |
| 171 |
|
|
|
| 172 |
|
26129833 |
*xs = xs_copy; |
| 173 |
|
26129833 |
} |
| 174 |
|
|
|
| 175 |
|
|
/* Efficient wrapper for generating individual random integers, by caching |
| 176 |
|
|
* the result of a single call to the underlying generator() */ |
| 177 |
|
|
static struct { |
| 178 |
|
|
#define PRNG_CACHE_SIZE 64 |
| 179 |
|
|
uint8_t buf8 [PRNG_CACHE_SIZE]; |
| 180 |
|
|
uint16_t buf16[PRNG_CACHE_SIZE >> 1]; |
| 181 |
|
|
uint32_t buf32[PRNG_CACHE_SIZE >> 2]; |
| 182 |
|
|
uint64_t buf64[PRNG_CACHE_SIZE >> 3]; |
| 183 |
|
|
int num8; |
| 184 |
|
|
int num16; |
| 185 |
|
|
int num32; |
| 186 |
|
|
int num64; |
| 187 |
|
|
} prng_cache; |
| 188 |
|
|
|
| 189 |
|
|
static_assert(PRNG_CACHE_SIZE % sizeof(uint32_t[CHECKASM_PRNG_NUM]) == 0, |
| 190 |
|
|
"PRNG_CACHE_SIZE should be a multiple of uint32_t[CHECKASM_PRNG_NUM]"); |
| 191 |
|
|
|
| 192 |
|
|
#define DEF_CHECKASM_RAND(BITS, TYPE, NAME) \ |
| 193 |
|
|
TYPE checkasm_rand_##NAME(void) \ |
| 194 |
|
|
{ \ |
| 195 |
|
|
if (!prng_cache.num##BITS) { \ |
| 196 |
|
|
prng(&checkasm_prng, (uint8_t *) prng_cache.buf##BITS, \ |
| 197 |
|
|
sizeof(prng_cache.buf##BITS)); \ |
| 198 |
|
|
prng_cache.num##BITS = ARRAY_SIZE(prng_cache.buf##BITS); \ |
| 199 |
|
|
} \ |
| 200 |
|
|
\ |
| 201 |
|
|
union { \ |
| 202 |
|
|
TYPE type; \ |
| 203 |
|
|
uint##BITS##_t raw; \ |
| 204 |
|
|
} val; \ |
| 205 |
|
|
val.raw = prng_cache.buf##BITS[--prng_cache.num##BITS]; \ |
| 206 |
|
|
return val.type; \ |
| 207 |
|
|
} |
| 208 |
|
|
|
| 209 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(8, int8_t, int8) |
| 210 |
2/2
✓ Branch 2 → 3 taken 5276575 times.
✓ Branch 2 → 5 taken 332424014 times.
|
337700589 |
DEF_CHECKASM_RAND(8, uint8_t, uint8) |
| 211 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(16, int16_t, int16) |
| 212 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(16, uint16_t, uint16) |
| 213 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(32, int32_t, int32) |
| 214 |
2/2
✓ Branch 2 → 3 taken 20853234 times.
✓ Branch 2 → 5 taken 312404551 times.
|
333257785 |
DEF_CHECKASM_RAND(32, uint32_t, uint32) |
| 215 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(32, float, float32) |
| 216 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(64, int64_t, int64) |
| 217 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(64, uint64_t, uint64) |
| 218 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
DEF_CHECKASM_RAND(64, double, float64) |
| 219 |
|
|
|
| 220 |
|
363680 |
static inline uint64_t splitmix64(uint64_t *state) |
| 221 |
|
|
{ |
| 222 |
|
363680 |
uint64_t z = (*state += 0x9e3779b97f4a7c15); |
| 223 |
|
|
|
| 224 |
|
363680 |
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9; |
| 225 |
|
363680 |
z = (z ^ (z >> 27)) * 0x94d049bb133111eb; |
| 226 |
|
363680 |
return z ^ (z >> 31); |
| 227 |
|
|
} |
| 228 |
|
|
|
| 229 |
|
45460 |
void checkasm_srand(unsigned seed) |
| 230 |
|
|
{ |
| 231 |
|
|
/* Seed using splitmix64() as recommended by xoroshiro128 authors */ |
| 232 |
|
45460 |
uint64_t s = seed; |
| 233 |
|
|
|
| 234 |
2/2
✓ Branch 6 → 3 taken 181840 times.
✓ Branch 6 → 7 taken 45460 times.
|
227300 |
for (int i = 0; i < CHECKASM_PRNG_NUM; i++) { |
| 235 |
|
181840 |
const uint64_t a = splitmix64(&s); |
| 236 |
|
181840 |
const uint64_t b = splitmix64(&s); |
| 237 |
|
|
|
| 238 |
|
181840 |
checkasm_prng.s0[i] = (uint32_t) a; |
| 239 |
|
181840 |
checkasm_prng.s1[i] = (uint32_t) b; |
| 240 |
|
181840 |
checkasm_prng.s2[i] = a >> 32; |
| 241 |
|
181840 |
checkasm_prng.s3[i] = b >> 32; |
| 242 |
|
|
} |
| 243 |
|
|
|
| 244 |
|
|
/* discard cached random bytes */ |
| 245 |
|
45460 |
prng_cache.num8 = prng_cache.num16 = prng_cache.num32 = prng_cache.num64 = 0; |
| 246 |
|
45460 |
} |
| 247 |
|
|
|
| 248 |
|
3540 |
int checkasm_rand(void) |
| 249 |
|
|
{ |
| 250 |
|
|
static_assert(sizeof(int) <= sizeof(uint32_t), "int larger than 32 bits"); |
| 251 |
|
3540 |
return checkasm_rand_uint32() & INT_MAX; |
| 252 |
|
|
} |
| 253 |
|
|
|
| 254 |
|
✗ |
double checkasm_randf(void) |
| 255 |
|
|
{ |
| 256 |
|
✗ |
return checkasm_rand_uint32() / (UINT32_MAX + 1.0); |
| 257 |
|
|
} |
| 258 |
|
|
|
| 259 |
|
|
/* Marsaglia polar method */ |
| 260 |
|
40504 |
static inline double marsaglia(double *z2) |
| 261 |
|
|
{ |
| 262 |
|
|
double u1, u2, w; |
| 263 |
|
|
do { |
| 264 |
|
52498 |
u1 = 2.0 / UINT32_MAX * checkasm_rand_uint32() - 1.0; |
| 265 |
|
52498 |
u2 = 2.0 / UINT32_MAX * checkasm_rand_uint32() - 1.0; |
| 266 |
|
52498 |
w = u1 * u1 + u2 * u2; |
| 267 |
2/2
✓ Branch 5 → 3 taken 11994 times.
✓ Branch 5 → 6 taken 40504 times.
|
52498 |
} while (w >= 1.0); |
| 268 |
|
|
|
| 269 |
|
40504 |
w = sqrt((-2.0 * log(w)) / w); |
| 270 |
|
40504 |
*z2 = u2 * w; |
| 271 |
|
40504 |
return u1 * w; |
| 272 |
|
|
} |
| 273 |
|
|
|
| 274 |
|
✗ |
double checkasm_rand_norm(void) |
| 275 |
|
|
{ |
| 276 |
|
|
static int cached; |
| 277 |
|
|
static double cache; |
| 278 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
|
✗ |
if ((cached = !cached)) { |
| 279 |
|
✗ |
return marsaglia(&cache); |
| 280 |
|
|
} else { |
| 281 |
|
✗ |
return cache; |
| 282 |
|
|
} |
| 283 |
|
|
} |
| 284 |
|
|
|
| 285 |
|
✗ |
double checkasm_rand_dist(CheckasmDist dist) |
| 286 |
|
|
{ |
| 287 |
|
✗ |
return dist.mean + dist.stddev * checkasm_rand_norm(); |
| 288 |
|
|
} |
| 289 |
|
|
|
| 290 |
|
22 |
void checkasm_randomize(void *buf, size_t bytes) |
| 291 |
|
|
{ |
| 292 |
|
22 |
prng(&checkasm_prng, buf, bytes); |
| 293 |
|
22 |
} |
| 294 |
|
|
|
| 295 |
|
✗ |
void checkasm_randomize_mask8(uint8_t *buf, int width, uint8_t mask) |
| 296 |
|
|
{ |
| 297 |
|
✗ |
prng(&checkasm_prng, (uint8_t *) buf, width * sizeof(*buf)); |
| 298 |
0/2
✗ Branch 5 → 4 not taken.
✗ Branch 5 → 6 not taken.
|
✗ |
for (int i = 0; i < width; i++) |
| 299 |
|
✗ |
buf[i] &= mask; |
| 300 |
|
✗ |
} |
| 301 |
|
|
|
| 302 |
|
2 |
void checkasm_randomize_mask16(uint16_t *buf, int width, uint16_t mask) |
| 303 |
|
|
{ |
| 304 |
|
2 |
prng(&checkasm_prng, (uint8_t *) buf, width * sizeof(*buf)); |
| 305 |
2/2
✓ Branch 5 → 4 taken 192 times.
✓ Branch 5 → 6 taken 2 times.
|
194 |
for (int i = 0; i < width; i++) |
| 306 |
|
192 |
buf[i] &= mask; |
| 307 |
|
2 |
} |
| 308 |
|
|
|
| 309 |
|
✗ |
void checkasm_randomize_range(double *buf, int width, double range) |
| 310 |
|
|
{ |
| 311 |
|
✗ |
const double scale = range / (UINT32_MAX + 1.0); |
| 312 |
0/2
✗ Branch 5 → 3 not taken.
✗ Branch 5 → 6 not taken.
|
✗ |
while (width--) |
| 313 |
|
✗ |
*buf++ = scale * checkasm_rand_uint32(); |
| 314 |
|
✗ |
} |
| 315 |
|
|
|
| 316 |
|
✗ |
void checkasm_randomize_rangef(float *buf, int width, float range) |
| 317 |
|
|
{ |
| 318 |
|
✗ |
const float scale = (float) (range / (UINT32_MAX + 1.0)); |
| 319 |
0/2
✗ Branch 5 → 3 not taken.
✗ Branch 5 → 6 not taken.
|
✗ |
while (width--) |
| 320 |
|
✗ |
*buf++ = scale * checkasm_rand_uint32(); |
| 321 |
|
✗ |
} |
| 322 |
|
|
|
| 323 |
|
✗ |
void checkasm_randomize_interval(double *buf, int width, double low, double high) |
| 324 |
|
|
{ |
| 325 |
|
✗ |
const double scale = (high - low) / (double) UINT32_MAX; |
| 326 |
0/2
✗ Branch 5 → 3 not taken.
✗ Branch 5 → 6 not taken.
|
✗ |
while (width--) |
| 327 |
|
✗ |
*buf++ = scale * checkasm_rand_uint32() + low; |
| 328 |
|
✗ |
} |
| 329 |
|
|
|
| 330 |
|
✗ |
void checkasm_randomize_intervalf(float *buf, int width, float low, float high) |
| 331 |
|
|
{ |
| 332 |
|
✗ |
const float scale = (high - low) / (float) UINT32_MAX; |
| 333 |
0/2
✗ Branch 5 → 3 not taken.
✗ Branch 5 → 6 not taken.
|
✗ |
while (width--) |
| 334 |
|
✗ |
*buf++ = scale * checkasm_rand_uint32() + low; |
| 335 |
|
✗ |
} |
| 336 |
|
|
|
| 337 |
|
|
#define RANDOMIZE_DIST(buf, ftype, width, mean, stddev) \ |
| 338 |
|
|
do { \ |
| 339 |
|
|
if ((width) & 1) { \ |
| 340 |
|
|
*(buf)++ = (ftype) ((mean) + (stddev) * checkasm_rand_norm()); \ |
| 341 |
|
|
(width) ^= 1; \ |
| 342 |
|
|
} \ |
| 343 |
|
|
\ |
| 344 |
|
|
for (; width; width -= 2) { \ |
| 345 |
|
|
double z1, z2; \ |
| 346 |
|
|
z1 = marsaglia(&z2); \ |
| 347 |
|
|
*(buf)++ = (ftype) ((mean) + (stddev) * z1); \ |
| 348 |
|
|
*(buf)++ = (ftype) ((mean) + (stddev) * z2); \ |
| 349 |
|
|
} \ |
| 350 |
|
|
} while (0) |
| 351 |
|
|
|
| 352 |
|
168 |
void checkasm_randomize_dist(double *buf, int width, CheckasmDist dist) |
| 353 |
|
|
{ |
| 354 |
3/4
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 5 taken 168 times.
✓ Branch 8 → 6 taken 17808 times.
✓ Branch 8 → 9 taken 168 times.
|
17976 |
RANDOMIZE_DIST(buf, double, width, dist.mean, dist.stddev); |
| 355 |
|
168 |
} |
| 356 |
|
|
|
| 357 |
|
130 |
void checkasm_randomize_distf(float *buf, int width, CheckasmDist dist) |
| 358 |
|
|
{ |
| 359 |
3/4
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 5 taken 130 times.
✓ Branch 8 → 6 taken 22696 times.
✓ Branch 8 → 9 taken 130 times.
|
22826 |
RANDOMIZE_DIST(buf, float, width, dist.mean, dist.stddev); |
| 360 |
|
130 |
} |
| 361 |
|
|
|
| 362 |
|
✗ |
void checkasm_randomize_norm(double *buf, int width) |
| 363 |
|
|
{ |
| 364 |
0/4
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
✗ Branch 8 → 6 not taken.
✗ Branch 8 → 9 not taken.
|
✗ |
RANDOMIZE_DIST(buf, double, width, 0.0, 1.0); |
| 365 |
|
✗ |
} |
| 366 |
|
|
|
| 367 |
|
✗ |
void checkasm_randomize_normf(float *buf, int width) |
| 368 |
|
|
{ |
| 369 |
0/4
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
✗ Branch 8 → 6 not taken.
✗ Branch 8 → 9 not taken.
|
✗ |
RANDOMIZE_DIST(buf, float, width, 0.0, 1.0); |
| 370 |
|
✗ |
} |
| 371 |
|
|
|
| 372 |
|
30914 |
void checkasm_clear(void *buf, size_t bytes) |
| 373 |
|
|
{ |
| 374 |
|
30914 |
memset(buf, 0xAA, bytes); |
| 375 |
|
30914 |
} |
| 376 |
|
|
|
| 377 |
|
✗ |
void checkasm_clear8(uint8_t *buf, int width, uint8_t val) |
| 378 |
|
|
{ |
| 379 |
|
✗ |
memset(buf, val, width); |
| 380 |
|
✗ |
} |
| 381 |
|
|
|
| 382 |
|
✗ |
void checkasm_clear16(uint16_t *buf, int width, uint16_t val) |
| 383 |
|
|
{ |
| 384 |
0/2
✗ Branch 4 → 3 not taken.
✗ Branch 4 → 5 not taken.
|
✗ |
while (width--) |
| 385 |
|
✗ |
*buf++ = val; |
| 386 |
|
✗ |
} |
| 387 |
|
|
|
| 388 |
|
|
#if HAVE_STDBIT_H |
| 389 |
|
|
#include <stdbit.h> |
| 390 |
|
|
|
| 391 |
|
|
static inline int clz(const unsigned int mask) |
| 392 |
|
|
{ |
| 393 |
|
|
return stdc_leading_zeros_ui(mask); |
| 394 |
|
|
} |
| 395 |
|
|
|
| 396 |
|
|
#elif defined(_MSC_VER) && !defined(__clang__) |
| 397 |
|
|
#include <intrin.h> |
| 398 |
|
|
|
| 399 |
|
|
static inline int clz(const unsigned int mask) |
| 400 |
|
|
{ |
| 401 |
|
|
unsigned long leading_zero = 0; |
| 402 |
|
|
_BitScanReverse(&leading_zero, mask); |
| 403 |
|
|
return (31 - leading_zero); |
| 404 |
|
|
} |
| 405 |
|
|
|
| 406 |
|
|
#else /* !_MSC_VER */ |
| 407 |
|
3456 |
static inline int clz(const unsigned int mask) |
| 408 |
|
|
{ |
| 409 |
|
3456 |
return __builtin_clz(mask); |
| 410 |
|
|
} |
| 411 |
|
|
#endif /* !_MSC_VER */ |
| 412 |
|
|
|
| 413 |
|
|
/* Randomly downshift an integer */ |
| 414 |
|
3456 |
static int shift_rand(int x) |
| 415 |
|
|
{ |
| 416 |
|
3456 |
const int bits = 8 * sizeof(x) - clz(x); |
| 417 |
1/2
✓ Branch 3 → 4 taken 3456 times.
✗ Branch 3 → 6 not taken.
|
3456 |
return x ? (x >> (checkasm_rand() % bits)) : 0; |
| 418 |
|
|
} |
| 419 |
|
|
|
| 420 |
|
|
enum { |
| 421 |
|
|
PAT_ZERO, // all zero |
| 422 |
|
|
PAT_ONE, // all one |
| 423 |
|
|
PAT_RAND, // random data |
| 424 |
|
|
PAT_LOW, // all low |
| 425 |
|
|
PAT_HIGH, // all high |
| 426 |
|
|
PAT_ALTLO, // alternating low and high |
| 427 |
|
|
PAT_ALTHI, // alternating high and low |
| 428 |
|
|
PAT_MIX, // random mix of low and high |
| 429 |
|
|
}; |
| 430 |
|
|
|
| 431 |
|
112 |
void checkasm_init(void *buf, size_t bytes) |
| 432 |
|
|
{ |
| 433 |
|
112 |
checkasm_init_mask8(buf, (int) bytes, 0xFF); |
| 434 |
|
112 |
} |
| 435 |
|
|
|
| 436 |
|
|
#define DEF_CHECKASM_INIT_MASK(BITS, PIXEL) \ |
| 437 |
|
|
void checkasm_init_mask##BITS(PIXEL *buf, const int width, const PIXEL mask_pixel) \ |
| 438 |
|
|
{ \ |
| 439 |
|
|
if (!width) \ |
| 440 |
|
|
return; \ |
| 441 |
|
|
\ |
| 442 |
|
|
int step = 0, mode = 0, mask = mask_pixel; \ |
| 443 |
|
|
for (int i = 0; i < width; i++, step--) { \ |
| 444 |
|
|
if (!step) { \ |
| 445 |
|
|
step = imax(shift_rand(width), 1); \ |
| 446 |
|
|
mode = checkasm_rand_uint8() & 7; \ |
| 447 |
|
|
mask = shift_rand(mask_pixel); \ |
| 448 |
|
|
} \ |
| 449 |
|
|
\ |
| 450 |
|
|
const PIXEL low = checkasm_rand_uint##BITS() & mask; \ |
| 451 |
|
|
const PIXEL high = mask_pixel - low; \ |
| 452 |
|
|
switch (mode) { \ |
| 453 |
|
|
case PAT_ZERO: buf[i] = 0; break; \ |
| 454 |
|
|
case PAT_ONE: buf[i] = mask_pixel; break; \ |
| 455 |
|
|
case PAT_RAND: buf[i] = checkasm_rand_uint##BITS() & mask_pixel; break; \ |
| 456 |
|
|
case PAT_LOW: buf[i] = low; break; \ |
| 457 |
|
|
case PAT_HIGH: buf[i] = high; break; \ |
| 458 |
|
|
case PAT_ALTLO: buf[i] = (i & 1) ? high : low; break; \ |
| 459 |
|
|
case PAT_ALTHI: buf[i] = (i & 1) ? low : high; break; \ |
| 460 |
|
|
case PAT_MIX: buf[i] = (checkasm_rand_uint8() & 1) ? low : high; break; \ |
| 461 |
|
|
} \ |
| 462 |
|
|
} \ |
| 463 |
|
|
} |
| 464 |
|
|
|
| 465 |
19/21
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 112 times.
✓ Branch 5 → 6 taken 1728 times.
✓ Branch 5 → 10 taken 274020888 times.
✓ Branch 11 → 12 taken 40025154 times.
✓ Branch 11 → 13 taken 56859914 times.
✓ Branch 11 → 14 taken 28413828 times.
✓ Branch 11 → 16 taken 45237648 times.
✓ Branch 11 → 17 taken 23764791 times.
✓ Branch 11 → 18 taken 20578441 times.
✓ Branch 11 → 22 taken 23880423 times.
✓ Branch 11 → 26 taken 35262417 times.
✗ Branch 11 → 31 not taken.
✓ Branch 18 → 19 taken 10289218 times.
✓ Branch 18 → 20 taken 10289223 times.
✓ Branch 22 → 23 taken 11940210 times.
✓ Branch 22 → 24 taken 11940213 times.
✓ Branch 27 → 28 taken 17632097 times.
✓ Branch 27 → 29 taken 17630320 times.
✓ Branch 32 → 5 taken 274022616 times.
✓ Branch 32 → 33 taken 112 times.
|
274022728 |
DEF_CHECKASM_INIT_MASK(8, uint8_t) |
| 466 |
0/21
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 10 not taken.
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ Branch 11 → 14 not taken.
✗ Branch 11 → 16 not taken.
✗ Branch 11 → 17 not taken.
✗ Branch 11 → 18 not taken.
✗ Branch 11 → 22 not taken.
✗ Branch 11 → 26 not taken.
✗ Branch 11 → 31 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ Branch 32 → 5 not taken.
✗ Branch 32 → 33 not taken.
|
✗ |
DEF_CHECKASM_INIT_MASK(16, uint16_t) |
| 467 |
|
|
|
| 468 |
|
|
static int use_printf_color[2]; |
| 469 |
|
|
static char statusline[256]; |
| 470 |
|
|
static int statusline_visible; |
| 471 |
|
|
static int get_terminal_width(void); |
| 472 |
|
|
|
| 473 |
|
✗ |
static void statusline_clear(void) |
| 474 |
|
|
{ |
| 475 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
if (!statusline_visible) |
| 476 |
|
✗ |
return; |
| 477 |
|
✗ |
fprintf(stderr, "\r\033[K"); /* clear line */ |
| 478 |
|
✗ |
statusline_visible = 0; |
| 479 |
|
|
} |
| 480 |
|
|
|
| 481 |
|
✗ |
static void statusline_show(void) |
| 482 |
|
|
{ |
| 483 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
if (!statusline[0]) |
| 484 |
|
✗ |
return; |
| 485 |
|
✗ |
const int term_w = get_terminal_width(); |
| 486 |
|
✗ |
int len = (int) strlen(statusline); |
| 487 |
0/4
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 8 not taken.
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
|
✗ |
if (term_w && len > term_w) |
| 488 |
|
✗ |
len = term_w; |
| 489 |
|
✗ |
fprintf(stderr, "%.*s", len, statusline); |
| 490 |
|
✗ |
statusline_visible = 1; |
| 491 |
|
|
} |
| 492 |
|
|
|
| 493 |
|
|
/* Print colored text to stderr if the terminal supports it */ |
| 494 |
|
2957 |
int checkasm_vfprintf(FILE *const f, const int color, const char *const fmt, va_list arg) |
| 495 |
|
|
{ |
| 496 |
|
2957 |
size_t fmt_len = strlen(fmt); |
| 497 |
|
2957 |
int use_color = use_printf_color[f == stderr]; |
| 498 |
1/4
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 2957 times.
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 6 not taken.
|
2957 |
if (!use_color || !fmt_len) |
| 499 |
|
2957 |
return vfprintf(f, fmt, arg); |
| 500 |
|
|
|
| 501 |
0/2
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
|
✗ |
if (f == stderr) |
| 502 |
|
✗ |
statusline_clear(); |
| 503 |
|
|
|
| 504 |
0/2
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
|
✗ |
if (color >= 0) |
| 505 |
|
✗ |
fprintf(f, "\x1b[0;%dm", color); |
| 506 |
|
|
|
| 507 |
|
✗ |
int ret = vfprintf(f, fmt, arg); |
| 508 |
|
|
|
| 509 |
0/2
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
|
✗ |
if (color >= 0) |
| 510 |
|
✗ |
fprintf(f, "\x1b[0m"); |
| 511 |
|
|
|
| 512 |
0/4
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 16 not taken.
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
|
✗ |
if (f == stderr && fmt[fmt_len - 1] == '\n') |
| 513 |
|
✗ |
statusline_show(); |
| 514 |
|
|
|
| 515 |
|
✗ |
return ret; |
| 516 |
|
|
} |
| 517 |
|
|
|
| 518 |
|
45563 |
void checkasm_statusline(const char *status) |
| 519 |
|
|
{ |
| 520 |
2/2
✓ Branch 2 → 3 taken 103 times.
✓ Branch 2 → 4 taken 45460 times.
|
45563 |
if (!status) |
| 521 |
|
103 |
status = ""; |
| 522 |
|
|
|
| 523 |
1/4
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 45563 times.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 7 not taken.
|
45563 |
if (!use_printf_color[1] || !strcmp(statusline, status)) |
| 524 |
|
45563 |
return; /* don't re-paint unchanged status */ |
| 525 |
|
|
|
| 526 |
|
✗ |
snprintf(statusline, sizeof(statusline), "%s", status); |
| 527 |
|
|
|
| 528 |
|
|
/* refresh statusline */ |
| 529 |
|
✗ |
statusline_clear(); |
| 530 |
|
✗ |
statusline_show(); |
| 531 |
|
|
} |
| 532 |
|
|
|
| 533 |
|
206 |
static COLD int should_use_color(FILE *const f) |
| 534 |
|
|
{ |
| 535 |
|
|
#ifdef _WIN32 |
| 536 |
|
|
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| 537 |
|
|
HANDLE con = GetStdHandle(f == stderr ? STD_ERROR_HANDLE : STD_OUTPUT_HANDLE); |
| 538 |
|
|
DWORD con_mode = 0; |
| 539 |
|
|
return con && con != INVALID_HANDLE_VALUE && GetConsoleMode(con, &con_mode) |
| 540 |
|
|
&& SetConsoleMode(con, con_mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); |
| 541 |
|
|
#else |
| 542 |
|
|
return 0; |
| 543 |
|
|
#endif |
| 544 |
|
|
#elif HAVE_ISATTY |
| 545 |
3/4
✓ Branch 2 → 3 taken 103 times.
✓ Branch 2 → 4 taken 103 times.
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 13 taken 206 times.
|
206 |
if (isatty(f == stderr ? 2 : 1)) { |
| 546 |
|
✗ |
const char *const term = getenv("TERM"); |
| 547 |
0/4
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 11 not taken.
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 11 not taken.
|
✗ |
return term && strcmp(term, "dumb"); |
| 548 |
|
|
} |
| 549 |
|
206 |
return 0; |
| 550 |
|
|
#else |
| 551 |
|
|
return 0; |
| 552 |
|
|
#endif |
| 553 |
|
|
} |
| 554 |
|
|
|
| 555 |
|
103 |
COLD void checkasm_setup_fprintf(void) |
| 556 |
|
|
{ |
| 557 |
|
103 |
use_printf_color[0] = should_use_color(stdout); |
| 558 |
|
103 |
use_printf_color[1] = should_use_color(stderr); |
| 559 |
|
103 |
} |
| 560 |
|
|
|
| 561 |
|
25553 |
static int get_terminal_width(void) |
| 562 |
|
|
{ |
| 563 |
|
|
#ifdef _WIN32 |
| 564 |
|
|
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| 565 |
|
|
CONSOLE_SCREEN_BUFFER_INFO csbi; |
| 566 |
|
|
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) |
| 567 |
|
|
return csbi.srWindow.Right - csbi.srWindow.Left + 1; |
| 568 |
|
|
#endif |
| 569 |
|
|
#elif defined(__OS2__) |
| 570 |
|
|
int dst[2]; |
| 571 |
|
|
_scrsize(dst); |
| 572 |
|
|
return dst[0]; |
| 573 |
|
|
#elif HAVE_IOCTL && defined(TIOCGWINSZ) |
| 574 |
|
|
struct winsize w; |
| 575 |
1/2
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 25553 times.
|
25553 |
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1) |
| 576 |
|
✗ |
return w.ws_col; |
| 577 |
|
|
#endif |
| 578 |
|
25553 |
return 0; |
| 579 |
|
|
} |
| 580 |
|
|
|
| 581 |
|
✗ |
void checkasm_json(CheckasmJson *json, const char *key, const char *const fmt, ...) |
| 582 |
|
|
{ |
| 583 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
assert(json->level > 0); |
| 584 |
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
|
✗ |
fputs(json->nonempty ? ",\n" : "\n", json->file); |
| 585 |
0/2
✗ Branch 11 → 9 not taken.
✗ Branch 11 → 12 not taken.
|
✗ |
for (int i = 0; i < json->level; i++) |
| 586 |
|
✗ |
fputc(' ', json->file); |
| 587 |
|
|
|
| 588 |
|
|
va_list ap; |
| 589 |
|
✗ |
va_start(ap, fmt); |
| 590 |
0/2
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
|
✗ |
if (key) |
| 591 |
|
✗ |
fprintf(json->file, "\"%s\": ", key); |
| 592 |
|
✗ |
vfprintf(json->file, fmt, ap); |
| 593 |
|
✗ |
va_end(ap); |
| 594 |
|
✗ |
json->nonempty = 1; |
| 595 |
|
✗ |
} |
| 596 |
|
|
|
| 597 |
|
✗ |
void checkasm_json_str(CheckasmJson *json, const char *key, const char *str) |
| 598 |
|
|
{ |
| 599 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
assert(json->level > 0); |
| 600 |
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
|
✗ |
fputs(json->nonempty ? ",\n" : "\n", json->file); |
| 601 |
0/2
✗ Branch 11 → 9 not taken.
✗ Branch 11 → 12 not taken.
|
✗ |
for (int i = 0; i < json->level; i++) |
| 602 |
|
✗ |
fputc(' ', json->file); |
| 603 |
|
|
|
| 604 |
0/2
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
|
✗ |
if (key) |
| 605 |
|
✗ |
fprintf(json->file, "\"%s\": \"", key); |
| 606 |
|
|
else |
| 607 |
|
✗ |
fputc('"', json->file); |
| 608 |
|
|
|
| 609 |
0/2
✗ Branch 22 → 16 not taken.
✗ Branch 22 → 23 not taken.
|
✗ |
while (*str) { |
| 610 |
0/4
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
✗ Branch 16 → 19 not taken.
✗ Branch 16 → 20 not taken.
|
✗ |
switch (*str) { |
| 611 |
|
✗ |
case '\\': fputs("\\\\", json->file); break; |
| 612 |
|
✗ |
case '"': fputs("\\\"", json->file); break; |
| 613 |
|
✗ |
case '\n': fputs("\\n", json->file); break; |
| 614 |
|
✗ |
default: fputc(*str, json->file); break; |
| 615 |
|
|
} |
| 616 |
|
✗ |
str++; |
| 617 |
|
|
} |
| 618 |
|
✗ |
fputc('"', json->file); |
| 619 |
|
✗ |
json->nonempty = 1; |
| 620 |
|
✗ |
} |
| 621 |
|
|
|
| 622 |
|
✗ |
void checkasm_json_push(CheckasmJson *json, const char *const key, const char type) |
| 623 |
|
|
{ |
| 624 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
fputs(json->nonempty ? ",\n" : "\n", json->file); |
| 625 |
0/2
✗ Branch 9 → 7 not taken.
✗ Branch 9 → 10 not taken.
|
✗ |
for (int i = 0; i < json->level; i++) |
| 626 |
|
✗ |
fputc(' ', json->file); |
| 627 |
|
|
|
| 628 |
0/2
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
|
✗ |
if (key) { |
| 629 |
|
✗ |
fprintf(json->file, "\"%s\": %c", key, type); |
| 630 |
|
|
} else { |
| 631 |
|
✗ |
fputc(type, json->file); |
| 632 |
|
|
} |
| 633 |
|
|
|
| 634 |
|
✗ |
json->level += 2; |
| 635 |
|
✗ |
json->nonempty = 0; |
| 636 |
|
✗ |
} |
| 637 |
|
|
|
| 638 |
|
✗ |
void checkasm_json_pop(CheckasmJson *json, char type) |
| 639 |
|
|
{ |
| 640 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
assert(json->level >= 2); |
| 641 |
|
✗ |
json->level -= 2; |
| 642 |
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 10 not taken.
|
✗ |
if (json->nonempty) { |
| 643 |
|
✗ |
fputc('\n', json->file); |
| 644 |
0/2
✗ Branch 9 → 7 not taken.
✗ Branch 9 → 10 not taken.
|
✗ |
for (int i = 0; i < json->level; i++) |
| 645 |
|
✗ |
fputc(' ', json->file); |
| 646 |
|
|
} |
| 647 |
|
✗ |
fputc(type, json->file); |
| 648 |
|
✗ |
json->nonempty = 1; |
| 649 |
|
✗ |
} |
| 650 |
|
|
|
| 651 |
|
|
/* float compare support code */ |
| 652 |
|
|
typedef union { |
| 653 |
|
|
float f; |
| 654 |
|
|
uint32_t i; |
| 655 |
|
|
} intfloat; |
| 656 |
|
|
|
| 657 |
|
17510408 |
static int is_negative(const intfloat u) |
| 658 |
|
|
{ |
| 659 |
|
17510408 |
return u.i >> 31; |
| 660 |
|
|
} |
| 661 |
|
|
|
| 662 |
|
8755204 |
int checkasm_float_near_ulp(const float a, const float b, const unsigned max_ulp) |
| 663 |
|
|
{ |
| 664 |
|
|
intfloat x, y; |
| 665 |
|
|
|
| 666 |
|
8755204 |
x.f = a; |
| 667 |
|
8755204 |
y.f = b; |
| 668 |
|
|
|
| 669 |
2/2
✓ Branch 4 → 5 taken 878 times.
✓ Branch 4 → 6 taken 8754326 times.
|
8755204 |
if (is_negative(x) != is_negative(y)) { |
| 670 |
|
|
// handle -0.0 == +0.0 |
| 671 |
|
878 |
return a == b; |
| 672 |
|
|
} |
| 673 |
|
|
|
| 674 |
2/2
✓ Branch 6 → 7 taken 8754322 times.
✓ Branch 6 → 8 taken 4 times.
|
8754326 |
if (llabs((int64_t) x.i - y.i) <= max_ulp) |
| 675 |
|
8754322 |
return 1; |
| 676 |
|
|
|
| 677 |
|
4 |
return 0; |
| 678 |
|
|
} |
| 679 |
|
|
|
| 680 |
|
103427 |
int checkasm_float_near_ulp_array(const float *const a, const float *const b, |
| 681 |
|
|
const unsigned max_ulp, const int len) |
| 682 |
|
|
{ |
| 683 |
2/2
✓ Branch 7 → 3 taken 8750084 times.
✓ Branch 7 → 8 taken 103427 times.
|
8853511 |
for (int i = 0; i < len; i++) |
| 684 |
1/2
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 8750084 times.
|
8750084 |
if (!float_near_ulp(a[i], b[i], max_ulp)) |
| 685 |
|
✗ |
return 0; |
| 686 |
|
|
|
| 687 |
|
103427 |
return 1; |
| 688 |
|
|
} |
| 689 |
|
|
|
| 690 |
|
876625 |
int checkasm_float_near_abs_eps(const float a, const float b, const float eps) |
| 691 |
|
|
{ |
| 692 |
|
876625 |
return fabsf(a - b) < eps; |
| 693 |
|
|
} |
| 694 |
|
|
|
| 695 |
|
197 |
int checkasm_float_near_abs_eps_array(const float *const a, const float *const b, |
| 696 |
|
|
const float eps, const int len) |
| 697 |
|
|
{ |
| 698 |
2/2
✓ Branch 7 → 3 taken 866626 times.
✓ Branch 7 → 8 taken 197 times.
|
866823 |
for (int i = 0; i < len; i++) |
| 699 |
1/2
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 866626 times.
|
866626 |
if (!float_near_abs_eps(a[i], b[i], eps)) |
| 700 |
|
✗ |
return 0; |
| 701 |
|
|
|
| 702 |
|
197 |
return 1; |
| 703 |
|
|
} |
| 704 |
|
|
|
| 705 |
|
5120 |
int checkasm_float_near_abs_eps_ulp(const float a, const float b, const float eps, |
| 706 |
|
|
const unsigned max_ulp) |
| 707 |
|
|
{ |
| 708 |
3/4
✓ Branch 3 → 4 taken 4 times.
✓ Branch 3 → 6 taken 5116 times.
✓ Branch 5 → 6 taken 4 times.
✗ Branch 5 → 7 not taken.
|
5120 |
return float_near_ulp(a, b, max_ulp) || float_near_abs_eps(a, b, eps); |
| 709 |
|
|
} |
| 710 |
|
|
|
| 711 |
|
✗ |
int checkasm_float_near_abs_eps_array_ulp(const float *const a, const float *const b, |
| 712 |
|
|
const float eps, const unsigned max_ulp, |
| 713 |
|
|
const int len) |
| 714 |
|
|
{ |
| 715 |
0/2
✗ Branch 7 → 3 not taken.
✗ Branch 7 → 8 not taken.
|
✗ |
for (int i = 0; i < len; i++) |
| 716 |
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
|
✗ |
if (!float_near_abs_eps_ulp(a[i], b[i], eps, max_ulp)) |
| 717 |
|
✗ |
return 0; |
| 718 |
|
|
|
| 719 |
|
✗ |
return 1; |
| 720 |
|
|
} |
| 721 |
|
|
|
| 722 |
|
64099 |
int checkasm_double_near_abs_eps(const double a, const double b, const double eps) |
| 723 |
|
|
{ |
| 724 |
|
64099 |
return fabs(a - b) < eps; |
| 725 |
|
|
} |
| 726 |
|
|
|
| 727 |
|
11 |
int checkasm_double_near_abs_eps_array(const double *const a, const double *const b, |
| 728 |
|
|
const double eps, const unsigned len) |
| 729 |
|
|
{ |
| 730 |
2/2
✓ Branch 7 → 3 taken 41068 times.
✓ Branch 7 → 8 taken 11 times.
|
41079 |
for (unsigned i = 0; i < len; i++) |
| 731 |
1/2
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 41068 times.
|
41068 |
if (!double_near_abs_eps(a[i], b[i], eps)) |
| 732 |
|
✗ |
return 0; |
| 733 |
|
|
|
| 734 |
|
11 |
return 1; |
| 735 |
|
|
} |
| 736 |
|
|
|
| 737 |
|
✗ |
static int check_err(const char *const file, const int line, const char *const name, |
| 738 |
|
|
const int w, const int h, int *const err) |
| 739 |
|
|
{ |
| 740 |
0/2
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 4 not taken.
|
✗ |
if (*err) |
| 741 |
|
✗ |
return 0; |
| 742 |
0/2
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 7 not taken.
|
✗ |
if (!checkasm_fail_func("%s:%d", file, line)) |
| 743 |
|
✗ |
return 1; |
| 744 |
|
✗ |
*err = 1; |
| 745 |
|
✗ |
fprintf(stderr, "%s (%dx%d):\n", name, w, h); |
| 746 |
|
✗ |
return 0; |
| 747 |
|
|
} |
| 748 |
|
|
|
| 749 |
|
|
#define PRINT_LINE(buf1, buf2, xstart, xend, xpad, fmt, fmtw) \ |
| 750 |
|
|
do { \ |
| 751 |
|
|
for (int x = xstart; x < xend; x++) { \ |
| 752 |
|
|
if (buf1[x] != buf2[x]) \ |
| 753 |
|
|
checkasm_fprintf(stderr, COLOR_RED, " " fmt, buf1[x]); \ |
| 754 |
|
|
else \ |
| 755 |
|
|
fprintf(stderr, " " fmt, buf1[x]); \ |
| 756 |
|
|
} \ |
| 757 |
|
|
for (int pad = xend; pad < xstart + xpad; pad++) \ |
| 758 |
|
|
fprintf(stderr, &" "[9 - fmtw]); \ |
| 759 |
|
|
} while (0) |
| 760 |
|
|
|
| 761 |
|
|
#define PRINT_RECT(type, buf1, buf2, ystart, yend, xstart, xend, fmt, fmtw) \ |
| 762 |
|
|
do { \ |
| 763 |
|
|
const type *ptr1 = (buf1) + ystart * stride1; \ |
| 764 |
|
|
const type *ptr2 = (buf2) + ystart * stride1; \ |
| 765 |
|
|
const int elem_size = 2 * (fmtw + 1) + 1; \ |
| 766 |
|
|
const int display_elems = imin(term_width / elem_size, xend - xstart); \ |
| 767 |
|
|
for (int y = ystart; y < yend; y++) { \ |
| 768 |
|
|
for (int xpos = xstart; xpos < xend; xpos += display_elems) { \ |
| 769 |
|
|
const int xstep = imin(xpos + display_elems, xend); \ |
| 770 |
|
|
if (xpos == xstart) /* line change */ \ |
| 771 |
|
|
checkasm_fprintf(stderr, COLOR_BLUE, "%3d: ", y); \ |
| 772 |
|
|
else \ |
| 773 |
|
|
fprintf(stderr, " "); \ |
| 774 |
|
|
PRINT_LINE(ptr1, ptr2, xpos, xstep, display_elems, fmt, fmtw); \ |
| 775 |
|
|
fprintf(stderr, " "); \ |
| 776 |
|
|
PRINT_LINE(ptr2, ptr1, xpos, xstep, display_elems, fmt, fmtw); \ |
| 777 |
|
|
fprintf(stderr, " "); \ |
| 778 |
|
|
for (int x = xpos; x < xstep; x++) { \ |
| 779 |
|
|
if (ptr1[x] != ptr2[x]) \ |
| 780 |
|
|
checkasm_fprintf(stderr, COLOR_RED, "x"); \ |
| 781 |
|
|
else \ |
| 782 |
|
|
fprintf(stderr, "."); \ |
| 783 |
|
|
} \ |
| 784 |
|
|
fprintf(stderr, "\n"); \ |
| 785 |
|
|
} \ |
| 786 |
|
|
ptr1 += stride1; \ |
| 787 |
|
|
ptr2 += stride2; \ |
| 788 |
|
|
} \ |
| 789 |
|
|
} while (0) |
| 790 |
|
|
|
| 791 |
|
|
#define CHECK_RECT(buf1, buf2, ystart, yend, xstart, xend, msg, compare, type, fmt, \ |
| 792 |
|
|
fmtw) \ |
| 793 |
|
|
do { \ |
| 794 |
|
|
const int xw = xend - xstart; \ |
| 795 |
|
|
for (int y = ystart; y < yend; y++) { \ |
| 796 |
|
|
if (compare(&buf1[y * stride1 + xstart], &buf2[y * stride2 + xstart], xw)) \ |
| 797 |
|
|
continue; \ |
| 798 |
|
|
if (check_err(file, line, name, w, h, &err)) \ |
| 799 |
|
|
return 1; \ |
| 800 |
|
|
/* Exclude unneeded lines on overwrite above */ \ |
| 801 |
|
|
int yprint = y < 0 ? y : ystart; \ |
| 802 |
|
|
if (msg[0]) \ |
| 803 |
|
|
fprintf(stderr, " %s (%dx%d, from idx [%d]):\n", msg, xend - xstart, \ |
| 804 |
|
|
yend - yprint, xstart); \ |
| 805 |
|
|
PRINT_RECT(type, buf1, buf2, yprint, yend, xstart, xend, fmt, fmtw); \ |
| 806 |
|
|
break; \ |
| 807 |
|
|
} \ |
| 808 |
|
|
} while (0) |
| 809 |
|
|
|
| 810 |
|
|
#define DEF_CHECKASM_CHECK_BODY(compare, type, fmt, fmtw) \ |
| 811 |
|
|
do { \ |
| 812 |
|
|
const int overhead = 5 + 3 + 3; \ |
| 813 |
|
|
const int term_w_raw = get_terminal_width(); \ |
| 814 |
|
|
const int term_width = (term_w_raw ? term_w_raw : 80) - overhead; \ |
| 815 |
|
|
const int aligned_w = (w + align_w - 1) & ~(align_w - 1); \ |
| 816 |
|
|
stride1 /= sizeof(type); \ |
| 817 |
|
|
stride2 /= sizeof(type); \ |
| 818 |
|
|
\ |
| 819 |
|
|
int err = 0; \ |
| 820 |
|
|
CHECK_RECT(buf1, buf2, 0, h, 0, w, "", compare, type, fmt, fmtw); \ |
| 821 |
|
|
if (align_h >= 1) { \ |
| 822 |
|
|
const int aligned_h = (h + align_h - 1) & ~(align_h - 1); \ |
| 823 |
|
|
CHECK_RECT(buf1, buf2, -padding, 0, -padding, w + padding, "overwrite top", \ |
| 824 |
|
|
compare, type, fmt, fmtw); \ |
| 825 |
|
|
CHECK_RECT(buf1, buf2, aligned_h, aligned_h + padding, -padding, \ |
| 826 |
|
|
w + padding, "overwrite bottom", compare, type, fmt, fmtw); \ |
| 827 |
|
|
} \ |
| 828 |
|
|
CHECK_RECT(buf1, buf2, 0, h, -padding, 0, "overwrite left", compare, type, fmt, \ |
| 829 |
|
|
fmtw); \ |
| 830 |
|
|
CHECK_RECT(buf1, buf2, 0, h, aligned_w, aligned_w + padding, "overwrite right", \ |
| 831 |
|
|
compare, type, fmt, fmtw); \ |
| 832 |
|
|
return err; \ |
| 833 |
|
|
} while (0) |
| 834 |
|
|
|
| 835 |
|
|
#define cmp_int(a, b, len) (!memcmp(a, b, (len) * sizeof(*(a)))) |
| 836 |
|
|
#define DEF_CHECKASM_CHECK_FUNC(type, fmt, fmtw) \ |
| 837 |
|
|
int checkasm_check_impl_##type(const char *file, int line, const type *buf1, \ |
| 838 |
|
|
ptrdiff_t stride1, const type *buf2, \ |
| 839 |
|
|
ptrdiff_t stride2, int w, int h, const char *name, \ |
| 840 |
|
|
int align_w, int align_h, int padding) \ |
| 841 |
|
|
{ \ |
| 842 |
|
|
DEF_CHECKASM_CHECK_BODY(cmp_int, type, fmt, fmtw); \ |
| 843 |
|
|
} |
| 844 |
|
|
|
| 845 |
0/158
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✗ Branch 56 → 7 not taken.
✗ Branch 56 → 57 not taken.
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 166 not taken.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 111 → 59 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 165 → 113 not taken.
✗ Branch 165 → 166 not taken.
✗ Branch 167 → 168 not taken.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✗ Branch 216 → 167 not taken.
✗ Branch 216 → 217 not taken.
✗ Branch 218 → 219 not taken.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✗ Branch 267 → 218 not taken.
✗ Branch 267 → 268 not taken.
|
✗ |
DEF_CHECKASM_CHECK_FUNC(int, "%9d", 9) |
| 846 |
0/158
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✗ Branch 56 → 7 not taken.
✗ Branch 56 → 57 not taken.
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 166 not taken.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 111 → 59 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 165 → 113 not taken.
✗ Branch 165 → 166 not taken.
✗ Branch 167 → 168 not taken.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✗ Branch 216 → 167 not taken.
✗ Branch 216 → 217 not taken.
✗ Branch 218 → 219 not taken.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✗ Branch 267 → 218 not taken.
✗ Branch 267 → 268 not taken.
|
✗ |
DEF_CHECKASM_CHECK_FUNC(int8_t, "%4" PRId8, 4) |
| 847 |
11/158
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 550 times.
✓ Branch 7 → 8 taken 14114 times.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✓ Branch 56 → 7 taken 14114 times.
✓ Branch 56 → 57 taken 550 times.
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 166 taken 550 times.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 111 → 59 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 165 → 113 not taken.
✗ Branch 165 → 166 not taken.
✓ Branch 167 → 168 taken 14114 times.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✓ Branch 216 → 167 taken 14114 times.
✓ Branch 216 → 217 taken 550 times.
✓ Branch 218 → 219 taken 14114 times.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✓ Branch 267 → 218 taken 14114 times.
✓ Branch 267 → 268 taken 550 times.
|
42892 |
DEF_CHECKASM_CHECK_FUNC(int16_t, "%6" PRId16, 6) |
| 848 |
11/158
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 4 times.
✓ Branch 7 → 8 taken 64 times.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✓ Branch 56 → 7 taken 64 times.
✓ Branch 56 → 57 taken 4 times.
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 166 taken 4 times.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 111 → 59 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 165 → 113 not taken.
✗ Branch 165 → 166 not taken.
✓ Branch 167 → 168 taken 64 times.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✓ Branch 216 → 167 taken 64 times.
✓ Branch 216 → 217 taken 4 times.
✓ Branch 218 → 219 taken 64 times.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✓ Branch 267 → 218 taken 64 times.
✓ Branch 267 → 268 taken 4 times.
|
196 |
DEF_CHECKASM_CHECK_FUNC(int32_t, "%9" PRId32, 9) |
| 849 |
|
|
|
| 850 |
0/158
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✗ Branch 56 → 7 not taken.
✗ Branch 56 → 57 not taken.
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 166 not taken.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 111 → 59 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 165 → 113 not taken.
✗ Branch 165 → 166 not taken.
✗ Branch 167 → 168 not taken.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✗ Branch 216 → 167 not taken.
✗ Branch 216 → 217 not taken.
✗ Branch 218 → 219 not taken.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✗ Branch 267 → 218 not taken.
✗ Branch 267 → 268 not taken.
|
✗ |
DEF_CHECKASM_CHECK_FUNC(unsigned, "%08x", 8) |
| 851 |
18/158
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 7182 times.
✓ Branch 7 → 8 taken 218412 times.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✓ Branch 56 → 7 taken 218412 times.
✓ Branch 56 → 57 taken 7182 times.
✓ Branch 57 → 58 taken 3704 times.
✓ Branch 57 → 166 taken 3478 times.
✓ Branch 59 → 60 taken 29632 times.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✓ Branch 111 → 59 taken 29632 times.
✓ Branch 111 → 112 taken 3704 times.
✓ Branch 113 → 114 taken 29632 times.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✓ Branch 165 → 113 taken 29632 times.
✓ Branch 165 → 166 taken 3704 times.
✓ Branch 167 → 168 taken 218412 times.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✓ Branch 216 → 167 taken 218412 times.
✓ Branch 216 → 217 taken 7182 times.
✓ Branch 218 → 219 taken 218412 times.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✓ Branch 267 → 218 taken 218412 times.
✓ Branch 267 → 268 taken 7182 times.
|
721682 |
DEF_CHECKASM_CHECK_FUNC(uint8_t, "%02" PRIx8, 2) |
| 852 |
18/158
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 15260 times.
✓ Branch 7 → 8 taken 479464 times.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✓ Branch 56 → 7 taken 479464 times.
✓ Branch 56 → 57 taken 15260 times.
✓ Branch 57 → 58 taken 10374 times.
✓ Branch 57 → 166 taken 4886 times.
✓ Branch 59 → 60 taken 82992 times.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✓ Branch 111 → 59 taken 82992 times.
✓ Branch 111 → 112 taken 10374 times.
✓ Branch 113 → 114 taken 82992 times.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✓ Branch 165 → 113 taken 82992 times.
✓ Branch 165 → 166 taken 10374 times.
✓ Branch 167 → 168 taken 479464 times.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✓ Branch 216 → 167 taken 479464 times.
✓ Branch 216 → 217 taken 15260 times.
✓ Branch 218 → 219 taken 479464 times.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✓ Branch 267 → 218 taken 479464 times.
✓ Branch 267 → 268 taken 15260 times.
|
1619636 |
DEF_CHECKASM_CHECK_FUNC(uint16_t, "%04" PRIx16, 4) |
| 853 |
11/158
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 475 times.
✓ Branch 7 → 8 taken 7600 times.
✗ Branch 7 → 9 not taken.
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ Branch 26 → 22 not taken.
✗ Branch 26 → 27 not taken.
✗ Branch 30 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 37 → 33 not taken.
✗ Branch 37 → 38 not taken.
✗ Branch 41 → 39 not taken.
✗ Branch 41 → 42 not taken.
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
✗ Branch 51 → 17 not taken.
✗ Branch 51 → 52 not taken.
✗ Branch 53 → 16 not taken.
✗ Branch 53 → 54 not taken.
✓ Branch 56 → 7 taken 7600 times.
✓ Branch 56 → 57 taken 475 times.
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 166 taken 475 times.
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 79 not taken.
✗ Branch 81 → 77 not taken.
✗ Branch 81 → 82 not taken.
✗ Branch 85 → 83 not taken.
✗ Branch 85 → 86 not taken.
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ Branch 92 → 88 not taken.
✗ Branch 92 → 93 not taken.
✗ Branch 96 → 94 not taken.
✗ Branch 96 → 97 not taken.
✗ Branch 99 → 100 not taken.
✗ Branch 99 → 101 not taken.
✗ Branch 103 → 99 not taken.
✗ Branch 103 → 104 not taken.
✗ Branch 106 → 72 not taken.
✗ Branch 106 → 107 not taken.
✗ Branch 108 → 71 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 111 → 59 not taken.
✗ Branch 111 → 112 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 118 → 119 not taken.
✗ Branch 118 → 120 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 129 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 133 not taken.
✗ Branch 135 → 131 not taken.
✗ Branch 135 → 136 not taken.
✗ Branch 139 → 137 not taken.
✗ Branch 139 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 142 → 144 not taken.
✗ Branch 146 → 142 not taken.
✗ Branch 146 → 147 not taken.
✗ Branch 150 → 148 not taken.
✗ Branch 150 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
✗ Branch 157 → 153 not taken.
✗ Branch 157 → 158 not taken.
✗ Branch 160 → 126 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 162 → 125 not taken.
✗ Branch 162 → 163 not taken.
✗ Branch 165 → 113 not taken.
✗ Branch 165 → 166 not taken.
✓ Branch 167 → 168 taken 7600 times.
✗ Branch 167 → 169 not taken.
✗ Branch 170 → 171 not taken.
✗ Branch 170 → 172 not taken.
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 182 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 190 → 188 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 193 → 194 not taken.
✗ Branch 193 → 195 not taken.
✗ Branch 197 → 193 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 201 → 199 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 204 → 205 not taken.
✗ Branch 204 → 206 not taken.
✗ Branch 208 → 204 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 211 → 177 not taken.
✗ Branch 211 → 212 not taken.
✗ Branch 213 → 176 not taken.
✗ Branch 213 → 214 not taken.
✓ Branch 216 → 167 taken 7600 times.
✓ Branch 216 → 217 taken 475 times.
✓ Branch 218 → 219 taken 7600 times.
✗ Branch 218 → 220 not taken.
✗ Branch 221 → 222 not taken.
✗ Branch 221 → 223 not taken.
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ Branch 233 → 234 not taken.
✗ Branch 233 → 235 not taken.
✗ Branch 237 → 233 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 241 → 239 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
✗ Branch 248 → 244 not taken.
✗ Branch 248 → 249 not taken.
✗ Branch 252 → 250 not taken.
✗ Branch 252 → 253 not taken.
✗ Branch 255 → 256 not taken.
✗ Branch 255 → 257 not taken.
✗ Branch 259 → 255 not taken.
✗ Branch 259 → 260 not taken.
✗ Branch 262 → 228 not taken.
✗ Branch 262 → 263 not taken.
✗ Branch 264 → 227 not taken.
✗ Branch 264 → 265 not taken.
✓ Branch 267 → 218 taken 7600 times.
✓ Branch 267 → 268 taken 475 times.
|
23275 |
DEF_CHECKASM_CHECK_FUNC(uint32_t, "%08" PRIx32, 8) |
| 854 |
|
|
|
| 855 |
|
2082 |
int checkasm_check_impl_float_ulp(const char *file, int line, const float *buf1, |
| 856 |
|
|
ptrdiff_t stride1, const float *buf2, ptrdiff_t stride2, |
| 857 |
|
|
int w, int h, const char *name, unsigned max_ulp, |
| 858 |
|
|
int align_w, int align_h, int padding) |
| 859 |
|
|
{ |
| 860 |
|
|
#define cmp_float(a, b, len) float_near_ulp_array(a, b, max_ulp, len) |
| 861 |
11/158
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 2082 times.
✓ Branch 8 → 9 taken 33312 times.
✗ Branch 8 → 10 not taken.
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
✗ Branch 27 → 23 not taken.
✗ Branch 27 → 28 not taken.
✗ Branch 31 → 29 not taken.
✗ Branch 31 → 32 not taken.
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 36 not taken.
✗ Branch 38 → 34 not taken.
✗ Branch 38 → 39 not taken.
✗ Branch 42 → 40 not taken.
✗ Branch 42 → 43 not taken.
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
✗ Branch 49 → 45 not taken.
✗ Branch 49 → 50 not taken.
✗ Branch 52 → 18 not taken.
✗ Branch 52 → 53 not taken.
✗ Branch 54 → 17 not taken.
✗ Branch 54 → 55 not taken.
✓ Branch 57 → 7 taken 33312 times.
✓ Branch 57 → 58 taken 2082 times.
✗ Branch 58 → 59 not taken.
✓ Branch 58 → 169 taken 2082 times.
✗ Branch 61 → 62 not taken.
✗ Branch 61 → 63 not taken.
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 66 → 67 not taken.
✗ Branch 66 → 68 not taken.
✗ Branch 69 → 70 not taken.
✗ Branch 69 → 71 not taken.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 77 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 81 not taken.
✗ Branch 83 → 79 not taken.
✗ Branch 83 → 84 not taken.
✗ Branch 87 → 85 not taken.
✗ Branch 87 → 88 not taken.
✗ Branch 90 → 91 not taken.
✗ Branch 90 → 92 not taken.
✗ Branch 94 → 90 not taken.
✗ Branch 94 → 95 not taken.
✗ Branch 98 → 96 not taken.
✗ Branch 98 → 99 not taken.
✗ Branch 101 → 102 not taken.
✗ Branch 101 → 103 not taken.
✗ Branch 105 → 101 not taken.
✗ Branch 105 → 106 not taken.
✗ Branch 108 → 74 not taken.
✗ Branch 108 → 109 not taken.
✗ Branch 110 → 73 not taken.
✗ Branch 110 → 111 not taken.
✗ Branch 113 → 60 not taken.
✗ Branch 113 → 114 not taken.
✗ Branch 116 → 117 not taken.
✗ Branch 116 → 118 not taken.
✗ Branch 119 → 120 not taken.
✗ Branch 119 → 121 not taken.
✗ Branch 121 → 122 not taken.
✗ Branch 121 → 123 not taken.
✗ Branch 124 → 125 not taken.
✗ Branch 124 → 126 not taken.
✗ Branch 130 → 131 not taken.
✗ Branch 130 → 132 not taken.
✗ Branch 134 → 135 not taken.
✗ Branch 134 → 136 not taken.
✗ Branch 138 → 134 not taken.
✗ Branch 138 → 139 not taken.
✗ Branch 142 → 140 not taken.
✗ Branch 142 → 143 not taken.
✗ Branch 145 → 146 not taken.
✗ Branch 145 → 147 not taken.
✗ Branch 149 → 145 not taken.
✗ Branch 149 → 150 not taken.
✗ Branch 153 → 151 not taken.
✗ Branch 153 → 154 not taken.
✗ Branch 156 → 157 not taken.
✗ Branch 156 → 158 not taken.
✗ Branch 160 → 156 not taken.
✗ Branch 160 → 161 not taken.
✗ Branch 163 → 129 not taken.
✗ Branch 163 → 164 not taken.
✗ Branch 165 → 128 not taken.
✗ Branch 165 → 166 not taken.
✗ Branch 168 → 115 not taken.
✗ Branch 168 → 169 not taken.
✓ Branch 171 → 172 taken 33312 times.
✗ Branch 171 → 173 not taken.
✗ Branch 174 → 175 not taken.
✗ Branch 174 → 176 not taken.
✗ Branch 176 → 177 not taken.
✗ Branch 176 → 178 not taken.
✗ Branch 182 → 183 not taken.
✗ Branch 182 → 184 not taken.
✗ Branch 186 → 187 not taken.
✗ Branch 186 → 188 not taken.
✗ Branch 190 → 186 not taken.
✗ Branch 190 → 191 not taken.
✗ Branch 194 → 192 not taken.
✗ Branch 194 → 195 not taken.
✗ Branch 197 → 198 not taken.
✗ Branch 197 → 199 not taken.
✗ Branch 201 → 197 not taken.
✗ Branch 201 → 202 not taken.
✗ Branch 205 → 203 not taken.
✗ Branch 205 → 206 not taken.
✗ Branch 208 → 209 not taken.
✗ Branch 208 → 210 not taken.
✗ Branch 212 → 208 not taken.
✗ Branch 212 → 213 not taken.
✗ Branch 215 → 181 not taken.
✗ Branch 215 → 216 not taken.
✗ Branch 217 → 180 not taken.
✗ Branch 217 → 218 not taken.
✓ Branch 220 → 170 taken 33312 times.
✓ Branch 220 → 221 taken 2082 times.
✓ Branch 223 → 224 taken 33312 times.
✗ Branch 223 → 225 not taken.
✗ Branch 226 → 227 not taken.
✗ Branch 226 → 228 not taken.
✗ Branch 228 → 229 not taken.
✗ Branch 228 → 230 not taken.
✗ Branch 234 → 235 not taken.
✗ Branch 234 → 236 not taken.
✗ Branch 238 → 239 not taken.
✗ Branch 238 → 240 not taken.
✗ Branch 242 → 238 not taken.
✗ Branch 242 → 243 not taken.
✗ Branch 246 → 244 not taken.
✗ Branch 246 → 247 not taken.
✗ Branch 249 → 250 not taken.
✗ Branch 249 → 251 not taken.
✗ Branch 253 → 249 not taken.
✗ Branch 253 → 254 not taken.
✗ Branch 257 → 255 not taken.
✗ Branch 257 → 258 not taken.
✗ Branch 260 → 261 not taken.
✗ Branch 260 → 262 not taken.
✗ Branch 264 → 260 not taken.
✗ Branch 264 → 265 not taken.
✗ Branch 267 → 233 not taken.
✗ Branch 267 → 268 not taken.
✗ Branch 269 → 232 not taken.
✗ Branch 269 → 270 not taken.
✓ Branch 272 → 222 taken 33312 times.
✓ Branch 272 → 273 taken 2082 times.
|
102018 |
DEF_CHECKASM_CHECK_BODY(cmp_float, float, "%7g", 7); |
| 862 |
|
|
#undef cmp_float |
| 863 |
|
|
} |
| 864 |
|
|
|
| 865 |
|
1227 |
char *checkasm_vasprintf(const char *fmt, va_list arg) |
| 866 |
|
|
{ |
| 867 |
|
|
va_list arg2; |
| 868 |
|
1227 |
va_copy(arg2, arg); |
| 869 |
|
1227 |
int len = vsnprintf(NULL, 0, fmt, arg2); |
| 870 |
|
1227 |
va_end(arg2); |
| 871 |
1/2
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 1227 times.
|
1227 |
if (len < 0) |
| 872 |
|
✗ |
return NULL; |
| 873 |
|
|
|
| 874 |
|
1227 |
char *buf = checkasm_mallocz(len + 1); |
| 875 |
|
1227 |
vsnprintf(buf, len + 1, fmt, arg); |
| 876 |
|
1227 |
return buf; |
| 877 |
|
|
} |
| 878 |
|
|
|