| 1 |
/* { dg-options "-fcondition-coverage -ftest-coverage" } */ |
| 2 |
/* { dg-do run { target native } } */ |
| 3 |
|
| 4 |
/* Some side effect to stop branches from being pruned. */ |
| 5 |
int x = 0; |
| 6 |
|
| 7 |
int id (int x) { return x; } |
| 8 |
int inv (int x) { return !x; } |
| 9 |
|
| 10 |
/* || works. */ |
| 11 |
void |
| 12 |
mcdc001a (int a, int b) |
| 13 |
{ |
| 14 |
if (a || b) /* conditions(1/4) true(0) false(0 1) */ |
| 15 |
/* conditions(end) */ |
| 16 |
x = 1; |
| 17 |
else |
| 18 |
x = 2; |
| 19 |
} |
| 20 |
|
| 21 |
void |
| 22 |
mcdc001b (int a, int b) |
| 23 |
{ |
| 24 |
if (a || b) /* conditions(3/4) true(0) */ |
| 25 |
/* conditions(end) */ |
| 26 |
x = 1; |
| 27 |
else |
| 28 |
x = 2; |
| 29 |
} |
| 30 |
|
| 31 |
void |
| 32 |
mcdc001c (int a, int b) |
| 33 |
{ |
| 34 |
if (a || b) /* conditions(4/4) */ |
| 35 |
x = 1; |
| 36 |
else |
| 37 |
x = 2; |
| 38 |
} |
| 39 |
|
| 40 |
void |
| 41 |
mcdc001d (int a, int b, int c) |
| 42 |
{ |
| 43 |
if (a || b || c) /* conditions(2/6) false(0 1 2) true(2) */ |
| 44 |
/* conditions(end) */ |
| 45 |
x = 1; |
| 46 |
} |
| 47 |
|
| 48 |
/* && works */ |
| 49 |
void |
| 50 |
mcdc002a (int a, int b) |
| 51 |
{ |
| 52 |
if (a && b) /* conditions(1/4) true(0 1) false(0) */ |
| 53 |
/* conditions(end) */ |
| 54 |
x = 1; |
| 55 |
else |
| 56 |
x = 2; |
| 57 |
} |
| 58 |
|
| 59 |
void |
| 60 |
mcdc002b (int a, int b) |
| 61 |
{ |
| 62 |
if (a && b) /* conditions(3/4) false(0) */ |
| 63 |
/* conditions(end) */ |
| 64 |
x = 1; |
| 65 |
else |
| 66 |
x = 2; |
| 67 |
} |
| 68 |
|
| 69 |
void |
| 70 |
mcdc002c (int a, int b) |
| 71 |
{ |
| 72 |
if (a && b) /* conditions(4/4) */ |
| 73 |
x = 1; |
| 74 |
else |
| 75 |
x = 2; |
| 76 |
} |
| 77 |
|
| 78 |
void |
| 79 |
mcdc002d (int a, int b, int c) |
| 80 |
{ |
| 81 |
if (a && b && c) /* conditions(4/6) false(0 2) */ |
| 82 |
/* conditions(end) */ |
| 83 |
x = 1; |
| 84 |
} |
| 85 |
|
| 86 |
/* Negation works. */ |
| 87 |
void |
| 88 |
mcdc003a (int a, int b) |
| 89 |
{ |
| 90 |
if (!a || !b) /* conditions(2/4) false(0 1) */ |
| 91 |
/* conditions(end) */ |
| 92 |
x = 1; |
| 93 |
else |
| 94 |
x = 2; |
| 95 |
} |
| 96 |
|
| 97 |
/* Single conditionals with and without else. */ |
| 98 |
void |
| 99 |
mcdc004a (int a) |
| 100 |
{ |
| 101 |
if (a) /* conditions(1/2) true(0) */ |
| 102 |
/* conditions(end) */ |
| 103 |
x = 1; |
| 104 |
else |
| 105 |
x = 2; |
| 106 |
} |
| 107 |
|
| 108 |
void |
| 109 |
mcdc004b (int a) |
| 110 |
{ |
| 111 |
if (a) /* conditions(2/2) */ |
| 112 |
x = 1; |
| 113 |
else |
| 114 |
x = 2; |
| 115 |
} |
| 116 |
|
| 117 |
void |
| 118 |
mcdc004c (int a) |
| 119 |
{ |
| 120 |
if (a) /* conditions(1/2) false(0) */ |
| 121 |
/* conditions(end) */ |
| 122 |
x = 1; |
| 123 |
} |
| 124 |
|
| 125 |
void |
| 126 |
mcdc004d (int a, int b, int c) |
| 127 |
{ |
| 128 |
if (a) /* conditions(2/2) */ |
| 129 |
{ |
| 130 |
if (b || c) /* conditions(1/4) true(1) false(0 1) */ |
| 131 |
x = a + b + c; |
| 132 |
} |
| 133 |
} |
| 134 |
|
| 135 |
void |
| 136 |
mcdc004e (int a, int b, int c) |
| 137 |
{ |
| 138 |
if (a) /* conditions(2/2) */ |
| 139 |
{ |
| 140 |
if (b || c) /* conditions(1/4) true(1) false(0 1) */ |
| 141 |
/* conditions(end) */ |
| 142 |
x = a + b + c; |
| 143 |
} |
| 144 |
else |
| 145 |
{ |
| 146 |
x = c; |
| 147 |
} |
| 148 |
} |
| 149 |
|
| 150 |
void |
| 151 |
mcdc004f (int a, int b, int c) |
| 152 |
{ |
| 153 |
if (a) /* conditions(1/2) false(0) */ |
| 154 |
/* conditions(end) */ |
| 155 |
{ |
| 156 |
x = 1; |
| 157 |
} |
| 158 |
else if (b) /* conditions(0/2) true(0) false(0) */ |
| 159 |
/* conditions(end) */ |
| 160 |
{ |
| 161 |
x = 2; |
| 162 |
if (c) /* conditions(0/2) true(0) false(0) */ |
| 163 |
/* conditions(end) */ |
| 164 |
x = 3; |
| 165 |
} |
| 166 |
} |
| 167 |
|
| 168 |
/* mixing && and || works */ |
| 169 |
void |
| 170 |
mcdc005a (int a, int b, int c) |
| 171 |
{ |
| 172 |
if ((a && b) || c) /* conditions(1/6) true(0 1) false(0 1 2) */ |
| 173 |
/* conditions(end) */ |
| 174 |
x = 1; |
| 175 |
else |
| 176 |
x = 2; |
| 177 |
} |
| 178 |
|
| 179 |
void |
| 180 |
mcdc005b (int a, int b, int c, int d) |
| 181 |
{ |
| 182 |
/* This is where masking MC/DC gets unintuitive: |
| 183 |
|
| 184 |
1 1 0 0 => covers 1 (d = 0) as && 0 masks everything to the left |
| 185 |
1 0 0 0 => covers 2 (b = 0, c = 0) as (a && 0) masks a and d is never |
| 186 |
evaluated. */ |
| 187 |
if ((a && (b || c)) && d) /* conditions(3/8) true(0 1 2 3) false(0) */ |
| 188 |
/* conditions(end) */ |
| 189 |
x = 1; |
| 190 |
else |
| 191 |
x = 2; |
| 192 |
} |
| 193 |
|
| 194 |
void |
| 195 |
mcdc005c (int a, int b, int c, int d) |
| 196 |
{ |
| 197 |
if (a || (b && c) || d) /* conditions(2/8) true(0 3) false(0 1 2 3) */ |
| 198 |
/* conditions(end) */ |
| 199 |
x = a + b + c + d; |
| 200 |
} |
| 201 |
|
| 202 |
void |
| 203 |
mcdc005d (int a, int b, int c, int d) |
| 204 |
{ |
| 205 |
/* This test is quite significant - it has a single input |
| 206 |
(1, 0, 0, 0) and tests specifically for when a multi-term left operand |
| 207 |
is masked. d = 0 should mask a || b and for the input there are no other |
| 208 |
sources for masking a (since b = 0). */ |
| 209 |
if ((a || b) && (c || d)) /* conditions(2/8) true(0 1 2 3) false(0 1) */ |
| 210 |
/* conditions(end) */ |
| 211 |
x = a + b; |
| 212 |
else |
| 213 |
x = c + d; |
| 214 |
} |
| 215 |
|
| 216 |
/* Mixing in constants kills the decision removes the term outright. */ |
| 217 |
void |
| 218 |
mcdc005e (int a, int b) |
| 219 |
{ |
| 220 |
x += 0 && a; |
| 221 |
x += a && 1; |
| 222 |
x += 0 && a && b; |
| 223 |
x += a && 1 && b; /* conditions(4/4) */ |
| 224 |
x += a && b && 0; |
| 225 |
x += 0 && 1; |
| 226 |
x += 1 && a; |
| 227 |
x += a && 0; |
| 228 |
x += 1 || a; |
| 229 |
x += a || 0; |
| 230 |
x += 1 || a || b; |
| 231 |
x += a || 0 || b; /* conditions(4/4) */ |
| 232 |
x += a || b || 1; |
| 233 |
x += 1 || 0; |
| 234 |
x += 0 || a; |
| 235 |
x += a || 1; |
| 236 |
} |
| 237 |
|
| 238 |
/* Nested conditionals. */ |
| 239 |
void |
| 240 |
mcdc006a (int a, int b, int c, int d, int e) |
| 241 |
{ |
| 242 |
if (a) /* conditions(2/2) */ |
| 243 |
{ |
| 244 |
if (b && c) /* conditions(3/4) false(1) */ |
| 245 |
/* conditions(end) */ |
| 246 |
x = 1; |
| 247 |
else |
| 248 |
x = 2; |
| 249 |
} |
| 250 |
else |
| 251 |
{ |
| 252 |
if (c || d) /* conditions(2/4) true(0 1) */ |
| 253 |
/* conditions(end) */ |
| 254 |
x = 3; |
| 255 |
else |
| 256 |
x = 4; |
| 257 |
} |
| 258 |
} |
| 259 |
|
| 260 |
void |
| 261 |
mcdc006b (int a, int b, int c) |
| 262 |
{ |
| 263 |
if (a) /* conditions(2/2) */ |
| 264 |
if (b) /* conditions(2/2) */ |
| 265 |
if (c) /* conditions(2/2) */ |
| 266 |
x = a + b + c; |
| 267 |
} |
| 268 |
|
| 269 |
void |
| 270 |
mcdc006c (int a, int b, int c) |
| 271 |
{ |
| 272 |
if (a) /* conditions(2/2) */ |
| 273 |
{ |
| 274 |
if (b) /*conditions(2/2) */ |
| 275 |
{ |
| 276 |
if (c) /* conditions(2/2) */ |
| 277 |
{ |
| 278 |
x = a + b + c; |
| 279 |
} |
| 280 |
} |
| 281 |
else |
| 282 |
{ |
| 283 |
x = b; |
| 284 |
} |
| 285 |
} |
| 286 |
else |
| 287 |
{ |
| 288 |
x = a; |
| 289 |
} |
| 290 |
} |
| 291 |
|
| 292 |
void |
| 293 |
mcdc006d (int a, int b, int c) |
| 294 |
{ |
| 295 |
if (a) /* conditions(1/2) false(0) */ |
| 296 |
/* conditions(end) */ |
| 297 |
{ |
| 298 |
if (b) /* conditions(1/2) true(0) */ |
| 299 |
/* conditions(end) */ |
| 300 |
x = a + b; |
| 301 |
if (c) /* conditions(2/2) */ |
| 302 |
/* conditions(end) */ |
| 303 |
x = a + b; |
| 304 |
} |
| 305 |
} |
| 306 |
|
| 307 |
void |
| 308 |
mcdc006e (int a, int b, int c, int d) |
| 309 |
{ |
| 310 |
if ((a || b || c) && id (d)) /* conditions(4/8) true(0 1 2 3) false() */ |
| 311 |
/* conditions(end) */ |
| 312 |
x = 1; |
| 313 |
} |
| 314 |
|
| 315 |
/* else/if. */ |
| 316 |
void |
| 317 |
mcdc007a (int a, int b, int c, int d) |
| 318 |
{ |
| 319 |
if (a) /* conditions(2/2) */ |
| 320 |
{ |
| 321 |
if (b) /* conditions(1/2) true(0) */ |
| 322 |
/* conditions(end) */ |
| 323 |
x = 1; |
| 324 |
else |
| 325 |
x = 2; |
| 326 |
} |
| 327 |
else if (c) /* conditions(2/2) */ |
| 328 |
{ |
| 329 |
if (d) /* conditions(1/2) true(0) */ |
| 330 |
/* conditions(end) */ |
| 331 |
x = 3; |
| 332 |
else |
| 333 |
x = 4; |
| 334 |
} |
| 335 |
} |
| 336 |
|
| 337 |
void |
| 338 |
mcdc007b (int a, int b, int c) |
| 339 |
{ |
| 340 |
goto begin; |
| 341 |
then: |
| 342 |
x = 1; |
| 343 |
return; |
| 344 |
begin: |
| 345 |
if (a) /* conditions(2/2) */ |
| 346 |
goto then; |
| 347 |
else if (b) /* conditions(2/2) */ |
| 348 |
goto then; |
| 349 |
else if (c) /* conditions(1/2) true(0) */ |
| 350 |
goto then; |
| 351 |
} |
| 352 |
|
| 353 |
void |
| 354 |
mcdc007c (int a, int b, int c) |
| 355 |
{ |
| 356 |
goto begin; |
| 357 |
then1: |
| 358 |
x = 1; |
| 359 |
return; |
| 360 |
then2: |
| 361 |
x = 1; |
| 362 |
return; |
| 363 |
then3: |
| 364 |
x = 1; |
| 365 |
return; |
| 366 |
begin: |
| 367 |
if (a) /* conditions(2/2) */ |
| 368 |
goto then1; |
| 369 |
else if (b) /* conditions(2/2) */ |
| 370 |
goto then2; |
| 371 |
else if (c) /* conditions(1/2) true(0) */ |
| 372 |
/* conditions(end) */ |
| 373 |
goto then3; |
| 374 |
} |
| 375 |
|
| 376 |
void |
| 377 |
noop () {} |
| 378 |
|
| 379 |
int |
| 380 |
mcdc007d (int a, int b, int c, int d, int e) |
| 381 |
{ |
| 382 |
noop (); |
| 383 |
if (a) /* conditions(1/2) true(0) */ |
| 384 |
/* conditions(end) */ |
| 385 |
{ |
| 386 |
if (b || c) /* conditions(0/4) true(0 1) false(0 1) */ |
| 387 |
/* conditions(end) */ |
| 388 |
x = 2; |
| 389 |
if (d) /* conditions(0/2) true(0) false(0) */ |
| 390 |
/* conditions(end) */ |
| 391 |
return 1; |
| 392 |
} |
| 393 |
if (e) /* conditions(1/2) false(0) */ |
| 394 |
/* conditions(end) */ |
| 395 |
return 0; |
| 396 |
|
| 397 |
return 2; |
| 398 |
} |
| 399 |
|
| 400 |
/* while loop. */ |
| 401 |
void |
| 402 |
mcdc008a (int a) |
| 403 |
{ |
| 404 |
while (a < 10) /* conditions(2/2) */ |
| 405 |
x = a++; |
| 406 |
} |
| 407 |
|
| 408 |
void |
| 409 |
mcdc008b (int a) |
| 410 |
{ |
| 411 |
while (a > 10) /* conditions(1/2) true(0) */ |
| 412 |
/* conditions(end) */ |
| 413 |
x = a--; |
| 414 |
} |
| 415 |
|
| 416 |
void |
| 417 |
mcdc008c (int a) |
| 418 |
{ |
| 419 |
// should work, even with no body |
| 420 |
while (a) /* conditions(2/2) */ |
| 421 |
break; |
| 422 |
} |
| 423 |
|
| 424 |
/* Multi-term loop conditional. */ |
| 425 |
void |
| 426 |
mcdc008d (int a, int b, int c, int d) |
| 427 |
{ |
| 428 |
while ((a && (b || c)) && d) /* conditions(8/8) */ |
| 429 |
a = b = c = d = 0; |
| 430 |
} |
| 431 |
|
| 432 |
void |
| 433 |
mcdc009a (int a, int b) |
| 434 |
{ |
| 435 |
while (a > 0 && b > 0) /* conditions(3/4) false(1) */ |
| 436 |
/* conditions(end) */ |
| 437 |
x = a--; |
| 438 |
} |
| 439 |
|
| 440 |
void |
| 441 |
mcdc009b (int a, int b) |
| 442 |
{ |
| 443 |
while (a-- > 0 && b) {} /* conditions(2/4) true(0 1) */ |
| 444 |
/* conditions(end) */ |
| 445 |
} |
| 446 |
|
| 447 |
/* for loop. */ |
| 448 |
void |
| 449 |
mcdc010a (int a, int b) |
| 450 |
{ |
| 451 |
for (int i = 0; i < b; i++) /* conditions(2/2) */ |
| 452 |
{ |
| 453 |
if (a < b) /* conditions(2/2) */ |
| 454 |
x = 1; |
| 455 |
else |
| 456 |
x = a += 2; |
| 457 |
} |
| 458 |
} |
| 459 |
|
| 460 |
void |
| 461 |
mcdc010b () |
| 462 |
{ |
| 463 |
for (int a = 0; a <= 1; ++a) /* conditions(2/2) */ |
| 464 |
{ |
| 465 |
x = a; |
| 466 |
} |
| 467 |
} |
| 468 |
|
| 469 |
int |
| 470 |
mcdc010c (int a, int b, int c) |
| 471 |
{ |
| 472 |
for (;a || b || c;) /* conditions(4/6) true(0 2) */ |
| 473 |
/* conditions(end) */ |
| 474 |
return 1; |
| 475 |
return 0; |
| 476 |
} |
| 477 |
|
| 478 |
|
| 479 |
int always (int x) { (void) x; return 1; } |
| 480 |
|
| 481 |
/* No-condition infinite loops. */ |
| 482 |
void |
| 483 |
mcdc010d (int a) |
| 484 |
{ |
| 485 |
for (;;) |
| 486 |
{ |
| 487 |
if (always(a)) /* conditions(1/2) false(0) */ |
| 488 |
/* conditions(end) */ |
| 489 |
{ |
| 490 |
x = a; |
| 491 |
break; |
| 492 |
} |
| 493 |
x += a + 1; |
| 494 |
} |
| 495 |
} |
| 496 |
|
| 497 |
/* Conditionals without control flow constructs work. */ |
| 498 |
void |
| 499 |
mcdc011a (int a, int b, int c) |
| 500 |
{ |
| 501 |
x = (a && b) || c; /* conditions(5/6) false(1) */ |
| 502 |
/* conditions(end) */ |
| 503 |
} |
| 504 |
|
| 505 |
/* Sequential expressions are handled independently. */ |
| 506 |
void |
| 507 |
mcdc012a (int a, int b, int c) |
| 508 |
{ |
| 509 |
if (a || b) /* conditions(3/4) true(0) */ |
| 510 |
/* conditions(end) */ |
| 511 |
x = 1; |
| 512 |
else |
| 513 |
x = 2; |
| 514 |
|
| 515 |
if (c) /* conditions(2/2) */ |
| 516 |
x = 1; |
| 517 |
} |
| 518 |
|
| 519 |
/* Cannot ever satisfy (masking) MC/DC, even with all input combinations, |
| 520 |
because not all variables independently affect the decision. */ |
| 521 |
void |
| 522 |
mcdc013a (int a, int b, int c) |
| 523 |
{ |
| 524 |
(void)b; |
| 525 |
/* Specification: (a && b) || c |
| 526 |
The implementation does not match the specification. This has branch |
| 527 |
coverage, but not MC/DC. */ |
| 528 |
if ((a && !c) || c) /* conditions(5/6) false(1) */ |
| 529 |
/* conditions(end) */ |
| 530 |
x = 1; |
| 531 |
else |
| 532 |
x = 2; |
| 533 |
} |
| 534 |
|
| 535 |
void |
| 536 |
mcdc014a () |
| 537 |
{ |
| 538 |
int conds[64] = { 0 }; |
| 539 |
/* conditions(64/128) true(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63) */ |
| 540 |
x = conds[ 0] || conds[ 1] || conds[ 2] || conds[ 3] || conds[ 4] || |
| 541 |
conds[ 5] || conds[ 6] || conds[ 7] || conds[ 8] || conds[ 9] || |
| 542 |
conds[10] || conds[11] || conds[12] || conds[13] || conds[14] || |
| 543 |
conds[15] || conds[16] || conds[17] || conds[18] || conds[19] || |
| 544 |
conds[20] || conds[21] || conds[22] || conds[23] || conds[24] || |
| 545 |
conds[25] || conds[26] || conds[27] || conds[28] || conds[29] || |
| 546 |
conds[30] || conds[31] || conds[32] || conds[33] || conds[34] || |
| 547 |
conds[35] || conds[36] || conds[37] || conds[38] || conds[39] || |
| 548 |
conds[40] || conds[41] || conds[42] || conds[43] || conds[44] || |
| 549 |
conds[45] || conds[46] || conds[47] || conds[48] || conds[49] || |
| 550 |
conds[50] || conds[51] || conds[52] || conds[53] || conds[54] || |
| 551 |
conds[55] || conds[56] || conds[57] || conds[58] || conds[59] || |
| 552 |
conds[60] || conds[61] || conds[62] || conds[63] |
| 553 |
; /* conditions(end) */ |
| 554 |
} |
| 555 |
|
| 556 |
/* Early returns. */ |
| 557 |
void |
| 558 |
mcdc015a (int a, int b) |
| 559 |
{ |
| 560 |
if (a) /* conditions(2/2) */ |
| 561 |
return; |
| 562 |
|
| 563 |
if (b) /* conditions(1/2) true(0) */ |
| 564 |
/* conditions(end) */ |
| 565 |
x = 1; |
| 566 |
} |
| 567 |
|
| 568 |
void |
| 569 |
mcdc015b (int a, int b) |
| 570 |
{ |
| 571 |
for (int i = 5; i > a; i--) /* conditions(2/2) */ |
| 572 |
{ |
| 573 |
if (i == b) /* conditions(2/2) */ |
| 574 |
return; |
| 575 |
x = i; |
| 576 |
} |
| 577 |
} |
| 578 |
|
| 579 |
void |
| 580 |
mcdc015c (int a, int b) |
| 581 |
{ |
| 582 |
for (int i = 5; i > a; i--) /* conditions(2/2) */ |
| 583 |
{ |
| 584 |
if (i == b) /* conditions(2/2) */ |
| 585 |
{ |
| 586 |
x = 0; |
| 587 |
return; |
| 588 |
} |
| 589 |
else |
| 590 |
{ |
| 591 |
x = 1; |
| 592 |
return; |
| 593 |
} |
| 594 |
|
| 595 |
x = i; |
| 596 |
} |
| 597 |
} |
| 598 |
|
| 599 |
/* Early returns, gotos. */ |
| 600 |
void |
| 601 |
mcdc015d (int a, int b, int c) |
| 602 |
{ |
| 603 |
if (a) return; /* conditions(1/2) false(0) */ |
| 604 |
/* conditions(end) */ |
| 605 |
if (id (b)) return; /* conditions(0/2) true(0) false(0) */ |
| 606 |
/* conditions(end) */ |
| 607 |
if (id (c)) return; /* conditions(0/2) true(0) false(0) */ |
| 608 |
/* conditions(end) */ |
| 609 |
} |
| 610 |
|
| 611 |
|
| 612 |
/* Nested loops. */ |
| 613 |
void |
| 614 |
mcdc016a (int a, int b) |
| 615 |
{ |
| 616 |
for (int i = 0; i < a; i++) /* conditions(2/2) */ |
| 617 |
for (int k = 0; k < b; k++) /* conditions(2/2) */ |
| 618 |
x = i + k; |
| 619 |
} |
| 620 |
|
| 621 |
void |
| 622 |
mcdc016b (int a, int b) |
| 623 |
{ |
| 624 |
for (int i = 0; i < a; i++) /* conditions(2/2) */ |
| 625 |
{ |
| 626 |
if (a > 5) /* conditions(2/2) */ |
| 627 |
break; |
| 628 |
|
| 629 |
for (int k = 0; k < b; k++) /* conditions(2/2) */ |
| 630 |
x = i + k; |
| 631 |
} |
| 632 |
} |
| 633 |
|
| 634 |
void |
| 635 |
mcdc016c (int a, int b) |
| 636 |
{ |
| 637 |
for (int i = 0; i < a; i++) /* conditions(2/2) */ |
| 638 |
{ |
| 639 |
if (a > 5) /* conditions(1/2) true(0) */ |
| 640 |
/* conditions(end) */ |
| 641 |
return; |
| 642 |
|
| 643 |
for (int k = 0; k < b; k++) /* conditions(2/2) */ |
| 644 |
x = i + k; |
| 645 |
} |
| 646 |
} |
| 647 |
|
| 648 |
void |
| 649 |
mcdc016d (int a, int b) |
| 650 |
{ |
| 651 |
for (int i = 0; i < a; i++) /* conditions(2/2) */ |
| 652 |
{ |
| 653 |
for (int k = 0; k < 5; k++) /* conditions(2/2) */ |
| 654 |
{ |
| 655 |
if (b > 5) /* conditions(1/2) true(0) */ |
| 656 |
/* conditions(end) */ |
| 657 |
return; |
| 658 |
x = i + k; |
| 659 |
} |
| 660 |
|
| 661 |
} |
| 662 |
} |
| 663 |
|
| 664 |
/* do-while loops */ |
| 665 |
void |
| 666 |
mcdc017a (int a) |
| 667 |
{ |
| 668 |
do |
| 669 |
{ |
| 670 |
a--; |
| 671 |
} while (a > 0); /* conditions(2/2) */ |
| 672 |
} |
| 673 |
|
| 674 |
void |
| 675 |
mcdc017b (int a, int b) |
| 676 |
{ |
| 677 |
do |
| 678 |
{ |
| 679 |
/* This call is important; it can add more nodes to the body in the |
| 680 |
CFG, which changes how close exits and breaks are to the loop |
| 681 |
conditional. */ |
| 682 |
noop (); |
| 683 |
a--; |
| 684 |
if (b) /* conditions(2/2) */ |
| 685 |
break; |
| 686 |
|
| 687 |
} while (a > 0); /* conditions(2/2) */ |
| 688 |
} |
| 689 |
|
| 690 |
void |
| 691 |
mcdc017c (int a, int b) |
| 692 |
{ |
| 693 |
int left = 0; |
| 694 |
int right = 0; |
| 695 |
int n = a + b; |
| 696 |
do |
| 697 |
{ |
| 698 |
if (a) /* conditions(1/2) false(0) */ |
| 699 |
/* conditions(end) */ |
| 700 |
{ |
| 701 |
left = a > left ? b : left; /* conditions(2/2) */ |
| 702 |
} |
| 703 |
if (b) /* conditions(1/2) false(0) */ |
| 704 |
/* conditions(end) */ |
| 705 |
{ |
| 706 |
right = b > right ? a : right; /* conditions(2/2) */ |
| 707 |
} |
| 708 |
} while (n-- > 0); /* conditions(2/2) */ |
| 709 |
} |
| 710 |
|
| 711 |
void |
| 712 |
mcdc017d (int a, int b, int c) |
| 713 |
{ |
| 714 |
do |
| 715 |
{ |
| 716 |
a--; |
| 717 |
} while (a > 0 && b && c); /* conditions(0/6) true(0 1 2) false(0 1 2) */ |
| 718 |
/* conditions(end) */ |
| 719 |
} |
| 720 |
|
| 721 |
/* Collection of odd cases lifted-and-adapted from real-world code. */ |
| 722 |
int |
| 723 |
mcdc018a (int a, int b, int c, int d, int e, int f, int g, int len) |
| 724 |
{ |
| 725 |
int n; |
| 726 |
/* adapted from zlib/gz_read */ |
| 727 |
do |
| 728 |
{ |
| 729 |
n = -1; |
| 730 |
if (n > len) /* conditions(2/2) */ |
| 731 |
n = len; |
| 732 |
|
| 733 |
if (b) /* conditions(2/2) */ |
| 734 |
{ |
| 735 |
if (b < 5) /* conditions(2/2) */ |
| 736 |
x = 1; |
| 737 |
noop(); |
| 738 |
} |
| 739 |
else if (c && d) /* conditions(3/4) false(1) */ |
| 740 |
/* conditions(end) */ |
| 741 |
{ |
| 742 |
x = 2; |
| 743 |
break; |
| 744 |
} |
| 745 |
else if (e || f) /* conditions(2/4) false(0 1) */ |
| 746 |
/* conditions(end) */ |
| 747 |
{ |
| 748 |
if (id(g)) /* conditions(2/2) */ |
| 749 |
return 0; |
| 750 |
continue; |
| 751 |
} |
| 752 |
} while (a-- > 0); /* conditions(2/2) */ |
| 753 |
|
| 754 |
return 1; |
| 755 |
} |
| 756 |
|
| 757 |
void |
| 758 |
mcdc018b (int a, int b, int c) |
| 759 |
{ |
| 760 |
int n; |
| 761 |
while (a) /* conditions(2/2) */ |
| 762 |
{ |
| 763 |
/* else block does not make a difference for the problem, but ensures |
| 764 |
loop termination. */ |
| 765 |
if (b) /* conditions(2/2) */ |
| 766 |
n = c ? 0 : 0; // does not show up in CFG (embedded in the block) |
| 767 |
else |
| 768 |
n = 0; |
| 769 |
a = n; |
| 770 |
} |
| 771 |
} |
| 772 |
|
| 773 |
/* Adapted from zlib/compress2. */ |
| 774 |
void |
| 775 |
mcdc018c (int a, int b) |
| 776 |
{ |
| 777 |
int err; |
| 778 |
do |
| 779 |
{ |
| 780 |
a = inv (a); |
| 781 |
err = a; |
| 782 |
} while (err); /* conditions(1/2) true(0) */ |
| 783 |
/* conditions(end) */ |
| 784 |
|
| 785 |
a = id (a); |
| 786 |
if (a) /* conditions(1/2) true(0) */ |
| 787 |
/* conditions(end) */ |
| 788 |
x *= a + 1; |
| 789 |
} |
| 790 |
|
| 791 |
/* Too many conditions, coverage gives up. */ |
| 792 |
void |
| 793 |
mcdc019a () |
| 794 |
{ |
| 795 |
int conds[65] = { 0 }; |
| 796 |
#pragma GCC diagnostic push |
| 797 |
#pragma GCC diagnostic ignored "-Wcoverage-too-many-conditions" |
| 798 |
x = conds[ 0] || conds[ 1] || conds[ 2] || conds[ 3] || conds[ 4] || |
| 799 |
conds[ 5] || conds[ 6] || conds[ 7] || conds[ 8] || conds[ 9] || |
| 800 |
conds[10] || conds[11] || conds[12] || conds[13] || conds[14] || |
| 801 |
conds[15] || conds[16] || conds[17] || conds[18] || conds[19] || |
| 802 |
conds[20] || conds[21] || conds[22] || conds[23] || conds[24] || |
| 803 |
conds[25] || conds[26] || conds[27] || conds[28] || conds[29] || |
| 804 |
conds[30] || conds[31] || conds[32] || conds[33] || conds[34] || |
| 805 |
conds[35] || conds[36] || conds[37] || conds[38] || conds[39] || |
| 806 |
conds[40] || conds[41] || conds[42] || conds[43] || conds[44] || |
| 807 |
conds[45] || conds[46] || conds[47] || conds[48] || conds[49] || |
| 808 |
conds[50] || conds[51] || conds[52] || conds[53] || conds[54] || |
| 809 |
conds[55] || conds[56] || conds[57] || conds[58] || conds[59] || |
| 810 |
conds[60] || conds[61] || conds[62] || conds[63] || conds[64] |
| 811 |
; |
| 812 |
#pragma GCC diagnostic pop |
| 813 |
} |
| 814 |
|
| 815 |
/* Ternary. */ |
| 816 |
void |
| 817 |
mcdc020a (int a) |
| 818 |
{ |
| 819 |
// special case, this can be reduced to: |
| 820 |
// _1 = argc != 0; |
| 821 |
// e = (int) _1; |
| 822 |
x = a ? 1 : 0; |
| 823 |
|
| 824 |
// changing to different int makes branch |
| 825 |
x = a ? 2 : 1; /* conditions(2/2) */ |
| 826 |
} |
| 827 |
|
| 828 |
void |
| 829 |
mcdc020b (int a, int b) |
| 830 |
{ |
| 831 |
x = (a || b) ? 1 : 0; /* conditions(3/4) true(1) */ |
| 832 |
/* conditions(end) */ |
| 833 |
} |
| 834 |
|
| 835 |
void |
| 836 |
mcdc020c (int a, int b) |
| 837 |
{ |
| 838 |
x = a ? 0 |
| 839 |
: b ? 1 /* conditions(2/2) */ |
| 840 |
: 2; /* conditions(1/2) false(0) */ |
| 841 |
/* conditions(end) */ |
| 842 |
} |
| 843 |
|
| 844 |
int |
| 845 |
mcdc020d (int b, int c, int d, int e, int f) |
| 846 |
{ |
| 847 |
return ((b ? c : d) && e && f); /* conditions(7/10) true(2) false(3 4) */ |
| 848 |
/* conditions(end) */ |
| 849 |
} |
| 850 |
|
| 851 |
/* Infinite loop (no exit-edge), this should not be called, but it should |
| 852 |
compile fine. */ |
| 853 |
void |
| 854 |
mcdc021a () |
| 855 |
{ |
| 856 |
while (1) |
| 857 |
; |
| 858 |
} |
| 859 |
|
| 860 |
/* Computed goto can give all sorts of problems, including difficult path |
| 861 |
contractions. */ |
| 862 |
void |
| 863 |
mcdc021b () |
| 864 |
{ |
| 865 |
void *op = &&dest; |
| 866 |
dest: |
| 867 |
if (op) /* conditions(0/2) true(0) false(0) */ |
| 868 |
/* conditions(end) */ |
| 869 |
goto * 0; |
| 870 |
} |
| 871 |
|
| 872 |
/* If edges are not properly contracted the a && id (b) will be interpreted as |
| 873 |
two independent expressions. */ |
| 874 |
void |
| 875 |
mcdc021d (int a, int b, int c, int d) |
| 876 |
{ |
| 877 |
if (a && id (b)) /* conditions(1/4) true(0 1) false(0) */ |
| 878 |
/* conditions(end) */ |
| 879 |
x = 1; |
| 880 |
else if (c && id (d)) /* conditions(1/4) true(0 1) false(0) */ |
| 881 |
/* conditions(end) */ |
| 882 |
x = 2; |
| 883 |
else |
| 884 |
x = 3; |
| 885 |
} |
| 886 |
|
| 887 |
/* Adapted from linux arch/x86/tools/relocs.c |
| 888 |
With poor edge contracting this became an infinite loop. */ |
| 889 |
void |
| 890 |
mcdc022a (int a, int b) |
| 891 |
{ |
| 892 |
for (int i = 0; i < 5; i++) /* conditions(2/2) */ |
| 893 |
{ |
| 894 |
x = i; |
| 895 |
for (int j = i; j < 5; j++) /* conditions(2/2) */ |
| 896 |
{ |
| 897 |
if (id (id (a)) || id (b)) /* conditions(3/4) true(0) */ |
| 898 |
/* conditions(end) */ |
| 899 |
continue; |
| 900 |
b = inv(b); |
| 901 |
} |
| 902 |
} |
| 903 |
} |
| 904 |
|
| 905 |
int |
| 906 |
mcdc022b (int a) |
| 907 |
{ |
| 908 |
int devt; |
| 909 |
if (a) /* conditions(2/2) */ |
| 910 |
{ |
| 911 |
x = a * 2; |
| 912 |
if (x != a / 10 || x != a % 10) /* conditions(1/4) true(1) false(0 1) */ |
| 913 |
/* conditions(end) */ |
| 914 |
return 0; |
| 915 |
} else { |
| 916 |
devt = id (a); |
| 917 |
if (devt) /* conditions(1/2) true(0) */ |
| 918 |
/* conditions(end) */ |
| 919 |
return 0; |
| 920 |
} |
| 921 |
|
| 922 |
return devt; |
| 923 |
} |
| 924 |
|
| 925 |
/* Adapted from linux arch/x86/events/intel/ds.c |
| 926 |
|
| 927 |
It broken sorting so that the entry block was not the first node after |
| 928 |
sorting. */ |
| 929 |
void |
| 930 |
mcdc022c (int a) |
| 931 |
{ |
| 932 |
if (!a) /* conditions(2/2) */ |
| 933 |
return; |
| 934 |
|
| 935 |
for (int i = 0; i < 5; i++) /* conditions(2/2) */ |
| 936 |
{ |
| 937 |
if (id (a + i) || inv (a - 1)) /* conditions(1/4) false(0 1) true(1) */ |
| 938 |
/* conditions(end) */ |
| 939 |
x = a + i; |
| 940 |
if (inv (a)) /* conditions(1/2) true(0) */ |
| 941 |
/* conditions(end) */ |
| 942 |
break; |
| 943 |
} |
| 944 |
} |
| 945 |
|
| 946 |
void |
| 947 |
mcdc022d (int a) |
| 948 |
{ |
| 949 |
int i; |
| 950 |
for (i = 0; i < id (a); i++) /* conditions(1/2) false(0) */ |
| 951 |
{ |
| 952 |
if (!inv (a)) /* conditions(1/2) false(0)*/ |
| 953 |
/* conditions(end) */ |
| 954 |
break; |
| 955 |
} |
| 956 |
|
| 957 |
if (i < a) /* conditions(1/2) false(0) */ |
| 958 |
/* conditions(end) */ |
| 959 |
x = a + 1; |
| 960 |
} |
| 961 |
|
| 962 |
/* Adapted from openssl-3.0.1/crypto/cmp/cmp_msg.c ossl_cmp_error_new (). */ |
| 963 |
void |
| 964 |
mcdc022e (int a, int b, int c, int d) |
| 965 |
{ |
| 966 |
if (a || b) /* conditions(1/4) true(0) false(0 1) */ |
| 967 |
/* conditions(end) */ |
| 968 |
{ |
| 969 |
if (always (c)) /* conditions(1/2) false(0) */ |
| 970 |
/* conditions(end) */ |
| 971 |
goto err; |
| 972 |
d++; |
| 973 |
} |
| 974 |
|
| 975 |
if (d) /* conditions(0/2) true(0) false(0) */ |
| 976 |
/* conditions(end) */ |
| 977 |
goto err; |
| 978 |
return; |
| 979 |
|
| 980 |
err: |
| 981 |
noop (); |
| 982 |
} |
| 983 |
|
| 984 |
/* 023 specifically tests that masking works correctly, which gets complicated |
| 985 |
fast with a mix of operators and deep subexpressions. These tests violates |
| 986 |
the style guide slightly to emphasize the nesting. They all share the same |
| 987 |
implementation and only one input is given to each function to obtain clean |
| 988 |
coverage results. */ |
| 989 |
void |
| 990 |
mcdc023a (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 991 |
int l, int m, int n) |
| 992 |
{ |
| 993 |
// [a m n] = 0, [b, ...] = 1 |
| 994 |
// a is masked by b and the remaining terms should be short circuited |
| 995 |
if (/* conditions(1/24) true(0 2 3 4 5 6 7 8 9 10 11) false(0 1 2 3 4 5 6 7 8 9 10 11) */ |
| 996 |
/* conditions(end) */ |
| 997 |
(a || b) |
| 998 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 999 |
&& (k || l) |
| 1000 |
&& (m || n))) |
| 1001 |
x = a + b; |
| 1002 |
else |
| 1003 |
x = b + c; |
| 1004 |
} |
| 1005 |
|
| 1006 |
void |
| 1007 |
mcdc023b (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 1008 |
int l, int m, int n) |
| 1009 |
{ |
| 1010 |
// [a b d h] = 0, [c, ...] = 1 |
| 1011 |
// h = 0 => false but does not mask (a || b) or (c && d). d = 0 masks c. |
| 1012 |
if (/* conditions(4/24) true(0 1 2 3 4 5 6 7 8 9 10 11) false(2 4 5 6 8 9 10 11) */ |
| 1013 |
/* conditions(end) */ |
| 1014 |
(a || b) |
| 1015 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 1016 |
&& (k || l) |
| 1017 |
&& (m || n))) |
| 1018 |
x = a + b; |
| 1019 |
else |
| 1020 |
x = b + c; |
| 1021 |
} |
| 1022 |
|
| 1023 |
void |
| 1024 |
mcdc023c (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 1025 |
int l, int m, int n) |
| 1026 |
{ |
| 1027 |
/* [m n a b] = 0, [...] = 1 |
| 1028 |
n,m = 0 should mask all other terms than a, b */ |
| 1029 |
if (/* conditions(4/24) true(0 1 2 3 4 5 6 7 8 9 10 11) false(2 3 4 5 6 7 8 9) */ |
| 1030 |
/* conditions(end) */ |
| 1031 |
(a || b) |
| 1032 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 1033 |
&& (k || l) |
| 1034 |
&& (m || n))) |
| 1035 |
x = a + b; |
| 1036 |
else |
| 1037 |
x = b + c; |
| 1038 |
} |
| 1039 |
|
| 1040 |
void |
| 1041 |
mcdc023d (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 1042 |
int l, int m, int n) |
| 1043 |
{ |
| 1044 |
/* [a b] = 0, [h, ...] = 1 |
| 1045 |
n,m = 0 should mask all other terms than a, b */ |
| 1046 |
if (/* conditions(4/24) true(0 1 2 3 4 5 6 7 8 9 10 11) false(2 3 4 5 6 7 10 11) */ |
| 1047 |
/* conditions(end) */ |
| 1048 |
(a || b) |
| 1049 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 1050 |
&& (k || l) |
| 1051 |
&& (m || n))) |
| 1052 |
x = a + b; |
| 1053 |
else |
| 1054 |
x = b + c; |
| 1055 |
} |
| 1056 |
|
| 1057 |
void |
| 1058 |
mcdc023e (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 1059 |
int l, int m, int n) |
| 1060 |
{ |
| 1061 |
/* [a b d] = 0, [c h, ...] = 1 |
| 1062 |
h = 1 should mask c, d, leave other terms intact. |
| 1063 |
If [k l m n] were false then h itself would be masked. |
| 1064 |
[a b] are masked as collateral by [m n]. */ |
| 1065 |
if (/* conditions(5/24) true(0 1 2 3 6 9 11) false(0 1 2 3 4 5 6 7 8 9 10 11) */ |
| 1066 |
/* conditions(end) */ |
| 1067 |
(a || b) |
| 1068 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 1069 |
&& (k || l) |
| 1070 |
&& (m || n))) |
| 1071 |
x = a + b; |
| 1072 |
else |
| 1073 |
x = b + c; |
| 1074 |
} |
| 1075 |
|
| 1076 |
void |
| 1077 |
mcdc023f (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 1078 |
int l, int m, int n) |
| 1079 |
{ |
| 1080 |
/* [a b c f g] = 0, [e, ...] = 1 |
| 1081 |
[f g] = 0 should mask e, leave [c d] intact. */ |
| 1082 |
if (/* conditions(5/24) true(0 1 2 3 4 5 6 7 8 9 10 11) false(3 4 7 8 9 10 11) */ |
| 1083 |
/* conditions(end) */ |
| 1084 |
(a || b) |
| 1085 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 1086 |
&& (k || l) |
| 1087 |
&& (m || n))) |
| 1088 |
x = a + b; |
| 1089 |
else |
| 1090 |
x = b + c; |
| 1091 |
} |
| 1092 |
|
| 1093 |
void |
| 1094 |
mcdc023g (int a, int b, int c, int d, int e, int f, int g, int h, int i, int k, |
| 1095 |
int l, int m, int n) |
| 1096 |
{ |
| 1097 |
/* [a b d f g] = 0, [e c, ...] = 1 |
| 1098 |
Same as 023f but with [c d] flipped so d masks c rather than c |
| 1099 |
short-circuits. This should not be lost. */ |
| 1100 |
if (/* conditions(5/24) true(0 1 2 3 4 5 6 7 8 9 10 11) false(2 4 7 8 9 10 11) */ |
| 1101 |
/* conditions(end) */ |
| 1102 |
(a || b) |
| 1103 |
|| ( ((c && d) || (e && (f || g) && h)) |
| 1104 |
&& (k || l) |
| 1105 |
&& (m || n))) |
| 1106 |
x = a + b; |
| 1107 |
else |
| 1108 |
x = b + c; |
| 1109 |
} |
| 1110 |
|
| 1111 |
/* Gotos, return, labels can make odd graphs. It is important that conditions |
| 1112 |
are assigned to the right expression, and that there are no miscounts. In |
| 1113 |
these tests values may be re-used, as checking things like masking an |
| 1114 |
independence is done in other test cases and not so useful here. */ |
| 1115 |
void |
| 1116 |
mcdc024a (int a, int b) |
| 1117 |
{ |
| 1118 |
/* This is a reference implementation without the labels, which should not |
| 1119 |
alter behavior. */ |
| 1120 |
if (a && b) /* conditions(2/4) true(0 1) */ |
| 1121 |
/* conditions(end) */ |
| 1122 |
{ |
| 1123 |
x = 1; |
| 1124 |
} |
| 1125 |
else |
| 1126 |
{ |
| 1127 |
x = 2; |
| 1128 |
} |
| 1129 |
|
| 1130 |
if (a || b) /* conditions(2/4) false(0 1) */ |
| 1131 |
/* conditions(end) */ |
| 1132 |
{ |
| 1133 |
x = 1; |
| 1134 |
} |
| 1135 |
else |
| 1136 |
{ |
| 1137 |
x = 2; |
| 1138 |
} |
| 1139 |
} |
| 1140 |
|
| 1141 |
void |
| 1142 |
mcdc024b (int a, int b) |
| 1143 |
{ |
| 1144 |
if (a && b) /* conditions(2/4) true(0 1) */ |
| 1145 |
/* conditions(end) */ |
| 1146 |
{ |
| 1147 |
label1: |
| 1148 |
x = 1; |
| 1149 |
} |
| 1150 |
else |
| 1151 |
{ |
| 1152 |
x = 2; |
| 1153 |
} |
| 1154 |
|
| 1155 |
if (a || b) /* conditions(2/4) false(0 1) */ |
| 1156 |
/* conditions(end) */ |
| 1157 |
{ |
| 1158 |
label2: |
| 1159 |
x = 1; |
| 1160 |
} |
| 1161 |
else |
| 1162 |
{ |
| 1163 |
x = 2; |
| 1164 |
} |
| 1165 |
} |
| 1166 |
|
| 1167 |
void |
| 1168 |
mcdc024c (int a, int b) |
| 1169 |
{ |
| 1170 |
|
| 1171 |
if (a && b) /* conditions(2/4) true(0 1) */ |
| 1172 |
/* conditions(end) */ |
| 1173 |
{ |
| 1174 |
x = 1; |
| 1175 |
} |
| 1176 |
else |
| 1177 |
{ |
| 1178 |
label1: |
| 1179 |
x = 2; |
| 1180 |
} |
| 1181 |
|
| 1182 |
if (a || b) /* conditions(2/4) false(0 1) */ |
| 1183 |
/* conditions(end) */ |
| 1184 |
{ |
| 1185 |
x = 1; |
| 1186 |
} |
| 1187 |
else |
| 1188 |
{ |
| 1189 |
label2: |
| 1190 |
x = 2; |
| 1191 |
} |
| 1192 |
} |
| 1193 |
|
| 1194 |
void |
| 1195 |
mcdc024d (int a, int b) |
| 1196 |
{ |
| 1197 |
if (a && b) /* conditions(2/4) true(0 1) */ |
| 1198 |
/* conditions(end) */ |
| 1199 |
{ |
| 1200 |
label1: |
| 1201 |
x = 1; |
| 1202 |
} |
| 1203 |
else |
| 1204 |
{ |
| 1205 |
label2: |
| 1206 |
x = 2; |
| 1207 |
} |
| 1208 |
|
| 1209 |
if (a || b) /* conditions(2/4) false(0 1) */ |
| 1210 |
/* conditions(end) */ |
| 1211 |
{ |
| 1212 |
label3: |
| 1213 |
x = 1; |
| 1214 |
} |
| 1215 |
else |
| 1216 |
{ |
| 1217 |
label4: |
| 1218 |
x = 2; |
| 1219 |
} |
| 1220 |
} |
| 1221 |
|
| 1222 |
int |
| 1223 |
mcdc024e (int a, int b, int c) |
| 1224 |
{ |
| 1225 |
/* Graphs can get complicated with the innermost returns and else-less if, |
| 1226 |
so we must make sure these conditions are counted correctly. */ |
| 1227 |
if (a) /* conditions(1/2) true(0) */ |
| 1228 |
/* conditions(end) */ |
| 1229 |
{ |
| 1230 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1231 |
/* conditions(end) */ |
| 1232 |
{ |
| 1233 |
if (c) /* conditions(0/2) true(0) false(0) */ |
| 1234 |
/* conditions(end) */ |
| 1235 |
return 1; |
| 1236 |
else |
| 1237 |
return 2; |
| 1238 |
} |
| 1239 |
|
| 1240 |
if (a) /* conditions(0/2) true(0) false(0) */ |
| 1241 |
/* conditions(end) */ |
| 1242 |
return 3; |
| 1243 |
} |
| 1244 |
|
| 1245 |
return 5; |
| 1246 |
} |
| 1247 |
|
| 1248 |
/* Nested else-less ifs with inner returns needs to be counted right, which |
| 1249 |
puts some pressure on the expression isolation. */ |
| 1250 |
int |
| 1251 |
mcdc024f (int a, int b, int c) |
| 1252 |
{ |
| 1253 |
if (a) /* conditions(1/2) true(0) */ |
| 1254 |
/* conditions(end) */ |
| 1255 |
{ |
| 1256 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1257 |
/* conditions(end) */ |
| 1258 |
{ |
| 1259 |
if (c) /* conditions(0/2) true(0) false(0) */ |
| 1260 |
/* conditions(end) */ |
| 1261 |
{ |
| 1262 |
if (a) /* conditions(0/2) true(0) false(0) */ |
| 1263 |
/* conditions(end) */ |
| 1264 |
return 1; |
| 1265 |
else |
| 1266 |
return 2; |
| 1267 |
} |
| 1268 |
|
| 1269 |
if (a) /* conditions(0/2) true(0) false(0) */ |
| 1270 |
/* conditions(end) */ |
| 1271 |
return 3; |
| 1272 |
} |
| 1273 |
|
| 1274 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1275 |
/* conditions(end) */ |
| 1276 |
return 4; |
| 1277 |
} |
| 1278 |
return 5; |
| 1279 |
} |
| 1280 |
|
| 1281 |
int |
| 1282 |
mcdc024g (int a, int b, int c) |
| 1283 |
{ |
| 1284 |
if (b) /* conditions(1/2) true(0) */ |
| 1285 |
/* conditions(end) */ |
| 1286 |
return 0; |
| 1287 |
|
| 1288 |
if (a) /* conditions(1/2) true(0) */ |
| 1289 |
/* conditions(end) */ |
| 1290 |
{ |
| 1291 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1292 |
/* conditions(end) */ |
| 1293 |
{ |
| 1294 |
b += 2; |
| 1295 |
if (b & 0xFF) /* conditions(0/2) true(0) false(0) */ |
| 1296 |
/* conditions(end) */ |
| 1297 |
c++; |
| 1298 |
|
| 1299 |
return c; |
| 1300 |
} |
| 1301 |
c += 10; |
| 1302 |
} |
| 1303 |
return 1; |
| 1304 |
} |
| 1305 |
|
| 1306 |
|
| 1307 |
int |
| 1308 |
mcdc024h (int a, int b, int c) |
| 1309 |
{ |
| 1310 |
if (b) /* conditions(1/2) true(0) */ |
| 1311 |
/* conditions(end) */ |
| 1312 |
goto inner; |
| 1313 |
|
| 1314 |
if (a) /* conditions(1/2) true(0) */ |
| 1315 |
/* conditions(end) */ |
| 1316 |
++a; |
| 1317 |
|
| 1318 |
|
| 1319 |
if (a) /* conditions(1/2) true(0) */ |
| 1320 |
/* conditions(end) */ |
| 1321 |
{ |
| 1322 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1323 |
/* conditions(end) */ |
| 1324 |
{ |
| 1325 |
inner: |
| 1326 |
b += 2; |
| 1327 |
if (b & 0xFF) /* conditions(0/2) true(0) false(0) */ |
| 1328 |
/* conditions(end) */ |
| 1329 |
c++; |
| 1330 |
|
| 1331 |
return c; |
| 1332 |
} |
| 1333 |
c += 10; |
| 1334 |
} |
| 1335 |
return 1; |
| 1336 |
} |
| 1337 |
|
| 1338 |
int |
| 1339 |
mcdc024i (int a, int b, int c) |
| 1340 |
{ |
| 1341 |
fst: |
| 1342 |
b++; |
| 1343 |
snd: |
| 1344 |
b++; |
| 1345 |
|
| 1346 |
if (b > 10) /* conditions(2/2) */ |
| 1347 |
/* conditions(end) */ |
| 1348 |
goto end; |
| 1349 |
|
| 1350 |
if (b < 5) /* conditions(2/2) */ |
| 1351 |
/* conditions(end) */ |
| 1352 |
goto fst; |
| 1353 |
else |
| 1354 |
goto snd; |
| 1355 |
|
| 1356 |
end: |
| 1357 |
if (a) /* conditions(1/2) true(0) */ |
| 1358 |
/* conditions(end) */ |
| 1359 |
++a; |
| 1360 |
|
| 1361 |
|
| 1362 |
if (a) /* conditions(1/2) true(0) */ |
| 1363 |
/* conditions(end) */ |
| 1364 |
{ |
| 1365 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1366 |
/* conditions(end) */ |
| 1367 |
{ |
| 1368 |
b += 2; |
| 1369 |
if (b & 0xFF) /* conditions(0/2) true(0) false(0) */ |
| 1370 |
/* conditions(end) */ |
| 1371 |
c++; |
| 1372 |
|
| 1373 |
return c; |
| 1374 |
} |
| 1375 |
c += 10; |
| 1376 |
} |
| 1377 |
return 1; |
| 1378 |
} |
| 1379 |
|
| 1380 |
/* Adapted from alsa-lib 1.2.8 src/control/control.c. If two expressions share |
| 1381 |
an outcome with bypass nodes they would be handled twice. */ |
| 1382 |
int |
| 1383 |
mcdc025a (int a, int b, int c) |
| 1384 |
{ |
| 1385 |
int err; |
| 1386 |
if (id (a)) /* conditions(1/2) true(0) */ |
| 1387 |
/* conditions(end) */ |
| 1388 |
{ |
| 1389 |
if (b) /* conditions(0/2) true(0) false(0) */ |
| 1390 |
/* conditions(end) */ |
| 1391 |
return -1; |
| 1392 |
} |
| 1393 |
else |
| 1394 |
{ |
| 1395 |
err = id (c); |
| 1396 |
if (err > 0) /* conditions(1/2) false(0) */ |
| 1397 |
/* conditions(end) */ |
| 1398 |
return err; |
| 1399 |
} |
| 1400 |
err = id (a); |
| 1401 |
return err; |
| 1402 |
} |
| 1403 |
|
| 1404 |
/* Boolean expressions in function call parameters. These tests are all built |
| 1405 |
with a reference expression which should behave the same as the function |
| 1406 |
call versions. */ |
| 1407 |
int |
| 1408 |
mcdc026a (int a, int b, int c, int d, int e) |
| 1409 |
{ |
| 1410 |
int cad = c && d; /* conditions(4/4) */ |
| 1411 |
/* conditions(end) */ |
| 1412 |
int x = a && b && cad && e; /* conditions(5/8) false(0 1 3) */ |
| 1413 |
/* conditions(end) */ |
| 1414 |
int y = a && b && id (c && d) && e; /* conditions(5/8; 4/4) false(0 1 3;;) */ |
| 1415 |
/* conditions(end) */ |
| 1416 |
return x + y; |
| 1417 |
} |
| 1418 |
|
| 1419 |
int |
| 1420 |
mcdc026b (int a, int b, int c, int d, int e) |
| 1421 |
{ |
| 1422 |
int dae = d && e; /* conditions(3/4) false(1) */ |
| 1423 |
/* conditions(end) */ |
| 1424 |
int x = a && b && c && dae; /* conditions(6/8) false(0 1) */ |
| 1425 |
int y = a && b && c && id (d && e); /* conditions(6/8; 3/4) false(0 1; 1) */ |
| 1426 |
/* conditions(end) */ |
| 1427 |
return x + y; |
| 1428 |
} |
| 1429 |
|
| 1430 |
int |
| 1431 |
mcdc026c (int a, int b, int c, int d, int e) |
| 1432 |
{ |
| 1433 |
int cod = c || d; /* conditions(3/4) true(1) */ |
| 1434 |
/* conditions(end) */ |
| 1435 |
int x = a && b && cod && e; /* conditions(5/8) false(0 1 3) */ |
| 1436 |
int y = a && b && id (c || d) && e; /* conditions(5/8; 3/4) true(;1) false(0 1 3;) */ |
| 1437 |
/* conditions(end) */ |
| 1438 |
return x+y; |
| 1439 |
} |
| 1440 |
|
| 1441 |
int |
| 1442 |
mcdc026d (int a, int b, int c, int d, int e) |
| 1443 |
{ |
| 1444 |
int aab = a && b; /* conditions(2/4) false(0 1) */ |
| 1445 |
/* conditions(end) */ |
| 1446 |
int cod = c || d; /* conditions(3/4) true(1) */ |
| 1447 |
/* conditions(end) */ |
| 1448 |
int x = aab && cod && e; /* conditions(4/6) false(0 2) */ |
| 1449 |
/* conditions(end) */ |
| 1450 |
int y = id (a && b) && id (c || d) && e; /* conditions(2/4;4/6;3/4) true(;;1) false(0 1;0 2;;) */ |
| 1451 |
/* conditions(end) */ |
| 1452 |
return x + y; |
| 1453 |
} |
| 1454 |
|
| 1455 |
int |
| 1456 |
mcdc026e (int a, int b, int c, int d, int e) |
| 1457 |
{ |
| 1458 |
int cod = c || d; /* conditions(3/4) true(1) */ |
| 1459 |
/* conditions(end) */ |
| 1460 |
int dae = d && e; /* conditions(3/4) false(1) */ |
| 1461 |
/* conditions(end) */ |
| 1462 |
int aacod = a && cod; /* conditions(3/4) false(0)*/ |
| 1463 |
/* conditions(end) */ |
| 1464 |
int x = aacod && dae; /* conditions(4/4) */ |
| 1465 |
/* conditions(end) */ |
| 1466 |
int y = id (a && id (c || d)) && id (d && e); /* conditions(3/4; 3/4; 4/4; 3/4) true(;1;;) false(0;;;1) */ |
| 1467 |
/* conditions(end) */ |
| 1468 |
return x + y; |
| 1469 |
} |
| 1470 |
|
| 1471 |
__attribute__((always_inline)) |
| 1472 |
inline int |
| 1473 |
mcdc027_inlined (int a) |
| 1474 |
{ |
| 1475 |
if (a) |
| 1476 |
x = a; |
| 1477 |
else |
| 1478 |
x = 1; |
| 1479 |
|
| 1480 |
return a + 1; |
| 1481 |
} |
| 1482 |
|
| 1483 |
/* Check that conditions in a function inlined into a function without |
| 1484 |
conditionals works. */ |
| 1485 |
void |
| 1486 |
mcdc027a (int a) /* conditions(1/2) false(0) */ |
| 1487 |
/* conditions(end) */ |
| 1488 |
{ |
| 1489 |
mcdc027_inlined (a); |
| 1490 |
} |
| 1491 |
|
| 1492 |
/* Check that conditions in a function inlined into a function with |
| 1493 |
conditionals works and that the conditions are not mixed up. */ |
| 1494 |
void |
| 1495 |
mcdc027b (int a) /* conditions(1/2) false(0) */ |
| 1496 |
/* conditions(end) */ |
| 1497 |
{ |
| 1498 |
int v = mcdc027_inlined (a); |
| 1499 |
|
| 1500 |
if (v > 10) /* conditions(1/2) true(0) */ |
| 1501 |
/* condiitions(end) */ |
| 1502 |
x = 10; |
| 1503 |
} |
| 1504 |
|
| 1505 |
/* Check that conditions in a function inlined into a function with |
| 1506 |
conditionals works and that the conditions are not mixed up. Use different |
| 1507 |
number of conditions to distinguish the expressions. */ |
| 1508 |
void |
| 1509 |
mcdc027c (int a, int b) /* conditions(1/2) false(0) */ |
| 1510 |
/* conditions(end) */ |
| 1511 |
{ |
| 1512 |
int v = mcdc027_inlined (a); |
| 1513 |
|
| 1514 |
if (v > 10 && b) /* conditions(1/4) true(0 1) false(1) */ |
| 1515 |
/* condiitions(end) */ |
| 1516 |
x = 10; |
| 1517 |
} |
| 1518 |
|
| 1519 |
int main () |
| 1520 |
{ |
| 1521 |
mcdc001a (0, 1); |
| 1522 |
|
| 1523 |
mcdc001b (0, 1); |
| 1524 |
mcdc001b (0, 0); |
| 1525 |
|
| 1526 |
mcdc001c (0, 1); |
| 1527 |
mcdc001c (0, 0); |
| 1528 |
mcdc001c (1, 1); |
| 1529 |
|
| 1530 |
mcdc001d (1, 1, 1); |
| 1531 |
mcdc001d (0, 1, 0); |
| 1532 |
|
| 1533 |
mcdc002a (1, 0); |
| 1534 |
|
| 1535 |
mcdc002b (1, 0); |
| 1536 |
mcdc002b (1, 1); |
| 1537 |
|
| 1538 |
mcdc002c (0, 0); |
| 1539 |
mcdc002c (1, 1); |
| 1540 |
mcdc002c (1, 0); |
| 1541 |
|
| 1542 |
mcdc002d (1, 1, 1); |
| 1543 |
mcdc002d (1, 0, 0); |
| 1544 |
|
| 1545 |
mcdc003a (0, 0); |
| 1546 |
mcdc003a (1, 0); |
| 1547 |
|
| 1548 |
mcdc004a (0); |
| 1549 |
mcdc004b (0); |
| 1550 |
mcdc004b (1); |
| 1551 |
mcdc004c (1); |
| 1552 |
|
| 1553 |
mcdc004d (0, 0, 0); |
| 1554 |
mcdc004d (1, 1, 1); |
| 1555 |
|
| 1556 |
mcdc004e (0, 0, 0); |
| 1557 |
mcdc004e (1, 1, 1); |
| 1558 |
|
| 1559 |
mcdc004f (1, 1, 1); |
| 1560 |
|
| 1561 |
mcdc005a (1, 0, 1); |
| 1562 |
|
| 1563 |
mcdc005b (1, 1, 0, 0); |
| 1564 |
mcdc005b (1, 0, 0, 0); |
| 1565 |
|
| 1566 |
mcdc005c (0, 1, 1, 0); |
| 1567 |
|
| 1568 |
mcdc005d (1, 0, 0, 0); |
| 1569 |
|
| 1570 |
mcdc005e (0, 0); |
| 1571 |
mcdc005e (0, 1); |
| 1572 |
mcdc005e (1, 0); |
| 1573 |
mcdc005e (1, 1); |
| 1574 |
|
| 1575 |
mcdc006a (0, 0, 0, 0, 0); |
| 1576 |
mcdc006a (1, 0, 0, 0, 0); |
| 1577 |
mcdc006a (1, 1, 1, 0, 0); |
| 1578 |
|
| 1579 |
mcdc006b (0, 0, 0); |
| 1580 |
mcdc006b (1, 0, 0); |
| 1581 |
mcdc006b (1, 1, 0); |
| 1582 |
mcdc006b (1, 1, 1); |
| 1583 |
|
| 1584 |
mcdc006c (0, 0, 0); |
| 1585 |
mcdc006c (1, 0, 0); |
| 1586 |
mcdc006c (1, 1, 0); |
| 1587 |
mcdc006c (1, 1, 1); |
| 1588 |
|
| 1589 |
mcdc006d (1, 0, 0); |
| 1590 |
mcdc006d (1, 0, 1); |
| 1591 |
|
| 1592 |
mcdc006e (0, 0, 0, 0); |
| 1593 |
mcdc006e (0, 0, 1, 0); |
| 1594 |
mcdc006e (0, 1, 0, 0); |
| 1595 |
|
| 1596 |
mcdc007a (0, 0, 0, 0); |
| 1597 |
mcdc007a (1, 0, 0, 0); |
| 1598 |
mcdc007a (0, 0, 1, 0); |
| 1599 |
|
| 1600 |
mcdc007b (0, 0, 0); |
| 1601 |
mcdc007b (0, 1, 1); |
| 1602 |
mcdc007b (1, 0, 1); |
| 1603 |
|
| 1604 |
mcdc007c (0, 0, 0); |
| 1605 |
mcdc007c (0, 1, 1); |
| 1606 |
mcdc007c (1, 0, 1); |
| 1607 |
|
| 1608 |
mcdc007d (0, 1, 0, 1, 1); |
| 1609 |
|
| 1610 |
mcdc008a (0); |
| 1611 |
|
| 1612 |
mcdc008b (0); |
| 1613 |
|
| 1614 |
mcdc008c (0); |
| 1615 |
mcdc008c (1); |
| 1616 |
|
| 1617 |
mcdc008d (0, 0, 0, 0); |
| 1618 |
mcdc008d (1, 0, 0, 0); |
| 1619 |
mcdc008d (1, 0, 1, 0); |
| 1620 |
mcdc008d (1, 0, 1, 1); |
| 1621 |
mcdc008d (1, 1, 1, 1); |
| 1622 |
|
| 1623 |
mcdc009a (0, 0); |
| 1624 |
mcdc009a (1, 1); |
| 1625 |
|
| 1626 |
mcdc009b (0, 0); |
| 1627 |
mcdc009b (1, 0); |
| 1628 |
|
| 1629 |
mcdc010a (0, 0); |
| 1630 |
mcdc010a (0, 9); |
| 1631 |
mcdc010a (2, 1); |
| 1632 |
|
| 1633 |
mcdc010b (); |
| 1634 |
|
| 1635 |
mcdc010c (0, 0, 0); |
| 1636 |
mcdc010c (0, 1, 0); |
| 1637 |
|
| 1638 |
mcdc010d (1); |
| 1639 |
|
| 1640 |
mcdc011a (0, 0, 0); |
| 1641 |
mcdc011a (1, 1, 0); |
| 1642 |
mcdc011a (1, 0, 1); |
| 1643 |
|
| 1644 |
mcdc012a (0, 0, 0); |
| 1645 |
mcdc012a (0, 1, 1); |
| 1646 |
|
| 1647 |
mcdc013a (0, 0, 0); |
| 1648 |
mcdc013a (0, 0, 1); |
| 1649 |
mcdc013a (0, 1, 0); |
| 1650 |
mcdc013a (0, 1, 1); |
| 1651 |
mcdc013a (1, 0, 0); |
| 1652 |
mcdc013a (1, 0, 1); |
| 1653 |
mcdc013a (1, 1, 0); |
| 1654 |
mcdc013a (1, 1, 1); |
| 1655 |
|
| 1656 |
mcdc014a (); |
| 1657 |
|
| 1658 |
mcdc015a (0, 0); |
| 1659 |
mcdc015a (1, 0); |
| 1660 |
|
| 1661 |
mcdc015b (0, 0); |
| 1662 |
mcdc015b (0, 1); |
| 1663 |
mcdc015b (6, 1); |
| 1664 |
|
| 1665 |
mcdc015c (0, 0); |
| 1666 |
mcdc015c (0, 5); |
| 1667 |
mcdc015c (6, 1); |
| 1668 |
|
| 1669 |
mcdc015d (1, 0, 0); |
| 1670 |
|
| 1671 |
mcdc016a (5, 5); |
| 1672 |
|
| 1673 |
mcdc016b (5, 5); |
| 1674 |
mcdc016b (6, 5); |
| 1675 |
|
| 1676 |
mcdc016c (5, 5); |
| 1677 |
|
| 1678 |
mcdc016d (1, 0); |
| 1679 |
|
| 1680 |
mcdc017a (0); |
| 1681 |
mcdc017a (2); |
| 1682 |
|
| 1683 |
mcdc017b (2, 0); |
| 1684 |
mcdc017b (0, 1); |
| 1685 |
|
| 1686 |
mcdc017c (1, 1); |
| 1687 |
|
| 1688 |
mcdc018a (0, 0, 1, 1, 0, 0, 0, 0); |
| 1689 |
mcdc018a (0, 1, 0, 0, 0, 0, 1, -2); |
| 1690 |
mcdc018a (0, 6, 0, 0, 0, 0, 1, -2); |
| 1691 |
mcdc018a (0, 6, 0, 0, 0, 0, 1, -2); |
| 1692 |
mcdc018a (0, 0, 0, 1, 0, 1, 1, 0); |
| 1693 |
mcdc018a (1, 0, 0, 0, 1, 1, 0, 0); |
| 1694 |
|
| 1695 |
mcdc018b (1, 0, 0); |
| 1696 |
mcdc018b (1, 1, 0); |
| 1697 |
|
| 1698 |
mcdc018c (1, 1); |
| 1699 |
|
| 1700 |
mcdc019a (); |
| 1701 |
|
| 1702 |
mcdc020a (0); |
| 1703 |
mcdc020a (1); |
| 1704 |
|
| 1705 |
mcdc020b (0, 0); |
| 1706 |
mcdc020b (1, 0); |
| 1707 |
|
| 1708 |
mcdc020c (0, 1); |
| 1709 |
mcdc020c (1, 1); |
| 1710 |
|
| 1711 |
mcdc020d (0, 0, 0, 0, 0); |
| 1712 |
mcdc020d (1, 0, 0, 1, 1); |
| 1713 |
mcdc020d (1, 1, 0, 1, 1); |
| 1714 |
|
| 1715 |
mcdc021d (1, 0, 1, 0); |
| 1716 |
|
| 1717 |
mcdc022a (0, 0); |
| 1718 |
|
| 1719 |
mcdc022b (0); |
| 1720 |
mcdc022b (1); |
| 1721 |
|
| 1722 |
mcdc022c (0); |
| 1723 |
mcdc022c (1); |
| 1724 |
|
| 1725 |
mcdc022d (1); |
| 1726 |
mcdc022e (0, 1, 1, 0); |
| 1727 |
|
| 1728 |
mcdc023a (0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); |
| 1729 |
mcdc023b (0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1); |
| 1730 |
mcdc023c (0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0); |
| 1731 |
mcdc023d (0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1); |
| 1732 |
mcdc023e (0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1); |
| 1733 |
mcdc023f (0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1); |
| 1734 |
mcdc023g (0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1); |
| 1735 |
|
| 1736 |
mcdc024a (0, 1); |
| 1737 |
mcdc024b (0, 1); |
| 1738 |
mcdc024c (0, 1); |
| 1739 |
mcdc024d (0, 1); |
| 1740 |
mcdc024a (1, 0); |
| 1741 |
mcdc024b (1, 0); |
| 1742 |
mcdc024c (1, 0); |
| 1743 |
mcdc024d (1, 0); |
| 1744 |
|
| 1745 |
mcdc024e (0, 0, 0); |
| 1746 |
mcdc024f (0, 0, 0); |
| 1747 |
mcdc024g (0, 0, 0); |
| 1748 |
mcdc024h (0, 0, 0); |
| 1749 |
mcdc024i (0, 0, 0); |
| 1750 |
|
| 1751 |
mcdc025a (0, 0, 1); |
| 1752 |
|
| 1753 |
mcdc026a (1, 1, 1, 0, 1); |
| 1754 |
mcdc026a (1, 1, 0, 0, 1); |
| 1755 |
mcdc026a (1, 1, 1, 1, 1); |
| 1756 |
|
| 1757 |
mcdc026b (1, 1, 1, 0, 1); |
| 1758 |
mcdc026b (1, 1, 0, 0, 1); |
| 1759 |
mcdc026b (1, 1, 1, 1, 1); |
| 1760 |
|
| 1761 |
mcdc026c (1, 1, 1, 0, 1); |
| 1762 |
mcdc026c (1, 1, 0, 0, 1); |
| 1763 |
mcdc026c (1, 1, 1, 1, 1); |
| 1764 |
|
| 1765 |
mcdc026d (1, 1, 1, 0, 1); |
| 1766 |
mcdc026d (1, 1, 0, 0, 1); |
| 1767 |
mcdc026d (1, 1, 1, 1, 1); |
| 1768 |
|
| 1769 |
mcdc026e (1, 1, 1, 0, 1); |
| 1770 |
mcdc026e (1, 1, 0, 0, 1); |
| 1771 |
mcdc026e (1, 1, 1, 1, 1); |
| 1772 |
|
| 1773 |
mcdc027a (1); |
| 1774 |
mcdc027b (1); |
| 1775 |
mcdc027c (1, 0); |
| 1776 |
} |
| 1777 |
|
| 1778 |
/* { dg-final { run-gcov conditions { --conditions gcov-19.c } } } */ |