diff --git a/cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll b/cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll index 990def8b2f1c..673d0c3c4eaa 100644 --- a/cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll +++ b/cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll @@ -769,26 +769,32 @@ private float getLowerBoundsImpl(Expr expr) { exists(float x, float y | x = getFullyConvertedLowerBounds(maxExpr.getLeftOperand()) and y = getFullyConvertedLowerBounds(maxExpr.getRightOperand()) and - if x >= y then result = x else result = y + result = x.maximum(y) ) ) or - // ConditionalExpr (true branch) - exists(ConditionalExpr condExpr | + exists(ConditionalExpr condExpr, Expr conv, float ub, float lb | expr = condExpr and + conv = condExpr.getCondition().getFullyConverted() and // Use `boolConversionUpperBound` to determine whether the condition // might evaluate to `true`. - boolConversionUpperBound(condExpr.getCondition().getFullyConverted()) = 1 and - result = getFullyConvertedLowerBounds(condExpr.getThen()) - ) - or - // ConditionalExpr (false branch) - exists(ConditionalExpr condExpr | - expr = condExpr and - // Use `boolConversionLowerBound` to determine whether the condition - // might evaluate to `false`. - boolConversionLowerBound(condExpr.getCondition().getFullyConverted()) = 0 and - result = getFullyConvertedLowerBounds(condExpr.getElse()) + lb = boolConversionLowerBound(conv) and + ub = boolConversionUpperBound(conv) + | + // Both branches can be taken + ub = 1 and + lb = 0 and + exists(float thenLb, float elseLb | + thenLb = getFullyConvertedLowerBounds(condExpr.getThen()) and + elseLb = getFullyConvertedLowerBounds(condExpr.getElse()) and + result = thenLb.minimum(elseLb) + ) + or + // Only the `true` branch can be taken + ub = 1 and lb != 0 and result = getFullyConvertedLowerBounds(condExpr.getThen()) + or + // Only the `false` branch can be taken + ub != 1 and lb = 0 and result = getFullyConvertedLowerBounds(condExpr.getElse()) ) or exists(AddExpr addExpr, float xLow, float yLow | @@ -973,26 +979,32 @@ private float getUpperBoundsImpl(Expr expr) { exists(float x, float y | x = getFullyConvertedUpperBounds(minExpr.getLeftOperand()) and y = getFullyConvertedUpperBounds(minExpr.getRightOperand()) and - if x <= y then result = x else result = y + result = x.minimum(y) ) ) or - // ConditionalExpr (true branch) - exists(ConditionalExpr condExpr | + exists(ConditionalExpr condExpr, Expr conv, float ub, float lb | expr = condExpr and + conv = condExpr.getCondition().getFullyConverted() and // Use `boolConversionUpperBound` to determine whether the condition // might evaluate to `true`. - boolConversionUpperBound(condExpr.getCondition().getFullyConverted()) = 1 and - result = getFullyConvertedUpperBounds(condExpr.getThen()) - ) - or - // ConditionalExpr (false branch) - exists(ConditionalExpr condExpr | - expr = condExpr and - // Use `boolConversionLowerBound` to determine whether the condition - // might evaluate to `false`. - boolConversionLowerBound(condExpr.getCondition().getFullyConverted()) = 0 and - result = getFullyConvertedUpperBounds(condExpr.getElse()) + lb = boolConversionLowerBound(conv) and + ub = boolConversionUpperBound(conv) + | + // Both branches can be taken + ub = 1 and + lb = 0 and + exists(float thenLb, float elseLb | + thenLb = getFullyConvertedUpperBounds(condExpr.getThen()) and + elseLb = getFullyConvertedUpperBounds(condExpr.getElse()) and + result = thenLb.maximum(elseLb) + ) + or + // Only the `true` branch can be taken + ub = 1 and lb != 0 and result = getFullyConvertedUpperBounds(condExpr.getThen()) + or + // Only the `false` branch can be taken + ub != 1 and lb = 0 and result = getFullyConvertedUpperBounds(condExpr.getElse()) ) or exists(AddExpr addExpr, float xHigh, float yHigh | @@ -1140,10 +1152,7 @@ private float getUpperBoundsImpl(Expr expr) { not expr instanceof SimpleRangeAnalysisExpr or // A modeled expression for range analysis - exists(SimpleRangeAnalysisExpr rangeAnalysisExpr | - rangeAnalysisExpr = expr and - result = rangeAnalysisExpr.getUpperBounds() - ) + result = expr.(SimpleRangeAnalysisExpr).getUpperBounds() } /** @@ -1594,7 +1603,7 @@ private module SimpleRangeAnalysisCached { * the lower bound of the expression after all the casts have been applied, * call `lowerBound` like this: * - * `lowerBound(expr.getFullyConverted())` + * lowerBound(expr.getFullyConverted()) */ cached float lowerBound(Expr expr) { @@ -1613,7 +1622,7 @@ private module SimpleRangeAnalysisCached { * the upper bound of the expression after all the casts have been applied, * call `upperBound` like this: * - * `upperBound(expr.getFullyConverted())` + * upperBound(expr.getFullyConverted()) */ cached float upperBound(Expr expr) { diff --git a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/lowerBound.expected b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/lowerBound.expected index 112b6cb02014..bc8f42dafc3f 100644 --- a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/lowerBound.expected +++ b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/lowerBound.expected @@ -412,197 +412,270 @@ | test.c:389:20:389:21 | y3 | 0 | | test.c:389:25:389:26 | y4 | 100 | | test.c:389:30:389:31 | y5 | 0 | -| test.c:394:20:394:20 | x | 0 | -| test.c:394:30:394:30 | x | 0 | -| test.c:397:3:397:4 | y1 | 0 | -| test.c:397:11:397:11 | y | 0 | -| test.c:397:14:397:14 | y | 1 | -| test.c:398:3:398:4 | y2 | 0 | -| test.c:398:9:398:9 | y | 1 | -| test.c:398:14:398:14 | y | 2 | -| test.c:398:22:398:22 | y | 5 | -| test.c:399:10:399:11 | y1 | 1 | -| test.c:399:15:399:16 | y2 | 5 | -| test.c:407:3:407:3 | i | -2147483648 | -| test.c:408:7:408:7 | i | 10 | -| test.c:410:3:410:3 | i | -2147483648 | -| test.c:411:3:411:3 | i | 10 | -| test.c:412:7:412:7 | i | 20 | -| test.c:414:3:414:3 | i | -2147483648 | -| test.c:415:3:415:3 | i | 40 | -| test.c:416:7:416:7 | i | 30 | -| test.c:418:3:418:3 | i | -2147483648 | -| test.c:418:7:418:7 | j | -2147483648 | -| test.c:419:7:419:7 | i | 40 | -| test.c:421:3:421:3 | i | -2147483648 | -| test.c:421:8:421:8 | j | 40 | -| test.c:422:7:422:7 | i | 50 | -| test.c:424:3:424:3 | i | -2147483648 | -| test.c:424:13:424:13 | j | 50 | -| test.c:425:7:425:7 | i | 60 | -| test.c:432:12:432:12 | a | 0 | -| test.c:432:17:432:17 | a | 3 | -| test.c:432:33:432:33 | b | 0 | -| test.c:432:38:432:38 | b | 5 | -| test.c:433:13:433:13 | a | 3 | -| test.c:433:15:433:15 | b | 5 | -| test.c:434:5:434:9 | total | 0 | -| test.c:434:14:434:14 | r | 15 | -| test.c:436:12:436:12 | a | 0 | -| test.c:436:17:436:17 | a | 3 | -| test.c:436:33:436:33 | b | 0 | -| test.c:436:38:436:38 | b | 0 | -| test.c:437:13:437:13 | a | 3 | -| test.c:437:15:437:15 | b | 0 | -| test.c:438:5:438:9 | total | 0 | -| test.c:438:14:438:14 | r | 0 | -| test.c:440:12:440:12 | a | 0 | -| test.c:440:17:440:17 | a | 3 | -| test.c:440:34:440:34 | b | 0 | -| test.c:440:39:440:39 | b | 13 | -| test.c:441:13:441:13 | a | 3 | -| test.c:441:15:441:15 | b | 13 | -| test.c:442:5:442:9 | total | 0 | -| test.c:442:14:442:14 | r | 39 | -| test.c:445:10:445:14 | total | 0 | -| test.c:451:12:451:12 | b | 0 | -| test.c:451:17:451:17 | b | 5 | -| test.c:452:16:452:16 | b | 5 | -| test.c:453:5:453:9 | total | 0 | -| test.c:453:14:453:14 | r | 55 | -| test.c:455:12:455:12 | b | 0 | -| test.c:455:17:455:17 | b | 0 | -| test.c:456:16:456:16 | b | 0 | -| test.c:457:5:457:9 | total | 0 | -| test.c:457:14:457:14 | r | 0 | -| test.c:459:13:459:13 | b | 0 | -| test.c:459:18:459:18 | b | 13 | -| test.c:460:16:460:16 | b | 13 | -| test.c:461:5:461:9 | total | 0 | -| test.c:461:14:461:14 | r | 143 | -| test.c:464:10:464:14 | total | 0 | -| test.c:469:3:469:3 | x | 0 | -| test.c:469:7:469:7 | y | 0 | -| test.c:470:3:470:4 | xy | 0 | -| test.c:470:8:470:8 | x | 1000000003 | -| test.c:470:12:470:12 | y | 1000000003 | -| test.c:471:10:471:11 | xy | 1000000006000000000 | -| test.c:476:3:476:3 | x | 0 | -| test.c:477:3:477:3 | y | 0 | -| test.c:478:3:478:4 | xy | 0 | -| test.c:478:8:478:8 | x | 274177 | -| test.c:478:12:478:12 | y | 67280421310721 | -| test.c:479:10:479:11 | xy | 18446744073709551616 | -| test.c:483:7:483:8 | ui | 0 | -| test.c:484:43:484:44 | ui | 10 | -| test.c:484:48:484:49 | ui | 10 | -| test.c:485:12:485:17 | result | 100 | -| test.c:487:7:487:8 | ul | 0 | -| test.c:488:28:488:29 | ul | 10 | -| test.c:488:33:488:34 | ul | 10 | -| test.c:489:12:489:17 | result | 0 | -| test.c:495:7:495:8 | ui | 0 | -| test.c:495:19:495:20 | ui | 0 | -| test.c:496:5:496:6 | ui | 2 | -| test.c:496:11:496:12 | ui | 2 | -| test.c:497:12:497:13 | ui | 4 | -| test.c:501:3:501:9 | uiconst | 10 | -| test.c:504:3:504:9 | ulconst | 10 | -| test.c:505:10:505:16 | uiconst | 40 | -| test.c:505:20:505:26 | ulconst | 40 | -| test.c:509:7:509:7 | i | -2147483648 | -| test.c:509:18:509:18 | i | -1 | -| test.c:510:5:510:5 | i | -2147483648 | -| test.c:510:13:510:13 | i | -1 | -| test.c:511:9:511:9 | i | -5 | -| test.c:513:5:513:5 | i | -2147483648 | -| test.c:513:9:513:9 | i | -5 | -| test.c:514:9:514:9 | i | -30 | -| test.c:516:5:516:5 | i | -30 | -| test.c:517:9:517:9 | i | -210 | -| test.c:519:5:519:5 | i | -210 | -| test.c:520:9:520:9 | i | -1155 | -| test.c:522:7:522:7 | i | -2147483648 | -| test.c:523:5:523:5 | i | -2147483648 | -| test.c:523:9:523:9 | i | -1 | -| test.c:524:9:524:9 | i | 1 | -| test.c:526:3:526:3 | i | -2147483648 | -| test.c:526:7:526:7 | i | -2147483648 | -| test.c:527:10:527:10 | i | -2147483648 | -| test.c:530:3:530:3 | i | -2147483648 | -| test.c:530:10:530:11 | sc | 1 | -| test.c:532:7:532:7 | i | -128 | -| test.c:539:7:539:7 | n | 0 | -| test.c:541:7:541:7 | n | 0 | -| test.c:542:9:542:9 | n | 1 | -| test.c:545:7:545:7 | n | 0 | -| test.c:546:9:546:9 | n | 1 | -| test.c:548:9:548:9 | n | 0 | -| test.c:551:8:551:8 | n | 0 | -| test.c:552:9:552:9 | n | 0 | -| test.c:554:9:554:9 | n | 1 | -| test.c:557:10:557:10 | n | 0 | -| test.c:558:5:558:5 | n | 1 | -| test.c:561:7:561:7 | n | 0 | -| test.c:565:7:565:7 | n | -32768 | -| test.c:568:7:568:7 | n | 0 | -| test.c:569:9:569:9 | n | 0 | -| test.c:571:9:571:9 | n | 1 | -| test.c:574:7:574:7 | n | 0 | -| test.c:575:9:575:9 | n | 1 | -| test.c:577:9:577:9 | n | 0 | -| test.c:580:10:580:10 | n | 0 | -| test.c:581:5:581:5 | n | 1 | -| test.c:584:7:584:7 | n | 0 | -| test.c:588:7:588:7 | n | -32768 | -| test.c:589:9:589:9 | n | -32768 | -| test.c:590:11:590:11 | n | 0 | -| test.c:594:7:594:7 | n | -32768 | -| test.c:595:13:595:13 | n | 5 | -| test.c:598:9:598:9 | n | 6 | -| test.c:601:7:601:7 | n | -32768 | -| test.c:601:22:601:22 | n | -32767 | -| test.c:602:9:602:9 | n | -32766 | -| test.c:605:7:605:7 | n | -32768 | -| test.c:606:5:606:5 | n | 0 | -| test.c:606:10:606:10 | n | 1 | -| test.c:606:14:606:14 | n | 0 | -| test.c:607:6:607:6 | n | 0 | -| test.c:607:10:607:10 | n | 0 | -| test.c:607:14:607:14 | n | 1 | -| test.c:618:7:618:8 | ss | -32768 | -| test.c:619:9:619:10 | ss | 0 | -| test.c:622:7:622:8 | ss | -32768 | -| test.c:623:9:623:10 | ss | -32768 | -| test.c:626:14:626:15 | us | 0 | -| test.c:627:9:627:10 | us | 0 | -| test.c:630:14:630:15 | us | 0 | -| test.c:631:9:631:10 | us | 0 | -| test.c:634:7:634:8 | ss | -32768 | -| test.c:635:9:635:10 | ss | -32768 | -| test.c:638:7:638:8 | ss | -32768 | -| test.c:639:9:639:10 | ss | -1 | -| test.c:645:8:645:8 | s | -2147483648 | -| test.c:645:15:645:15 | s | 0 | -| test.c:645:23:645:23 | s | 0 | -| test.c:646:18:646:18 | s | 0 | -| test.c:646:22:646:22 | s | 0 | -| test.c:647:9:647:14 | result | 0 | -| test.c:653:7:653:7 | i | 0 | -| test.c:654:9:654:9 | i | -2147483648 | -| test.c:658:7:658:7 | u | 0 | -| test.c:659:9:659:9 | u | 0 | -| test.c:664:12:664:12 | s | -2147483648 | -| test.c:665:7:665:8 | s2 | -4 | -| test.c:670:7:670:7 | x | -2147483648 | -| test.c:671:9:671:9 | y | -2147483648 | -| test.c:675:7:675:7 | y | -2147483648 | -| test.c:684:7:684:7 | x | -2147483648 | -| test.c:689:7:689:7 | x | -2147483648 | -| test.c:696:8:696:8 | x | 2147483647 | -| test.c:696:12:696:12 | y | 256 | -| test.c:697:9:697:9 | x | 2147483647 | -| test.c:698:9:698:9 | y | 256 | +| test.c:394:14:394:14 | m | -Infinity | +| test.c:394:18:394:18 | n | -Infinity | +| test.c:394:22:394:22 | o | -Infinity | +| test.c:394:26:394:26 | p | -Infinity | +| test.c:394:30:394:30 | q | -Infinity | +| test.c:395:14:395:14 | m | -Infinity | +| test.c:395:18:395:18 | n | -Infinity | +| test.c:395:22:395:22 | o | -Infinity | +| test.c:395:26:395:26 | p | -Infinity | +| test.c:395:30:395:30 | q | -Infinity | +| test.c:396:14:396:14 | m | -Infinity | +| test.c:396:18:396:18 | n | -Infinity | +| test.c:396:22:396:22 | o | -Infinity | +| test.c:396:26:396:26 | p | -Infinity | +| test.c:396:30:396:30 | q | -Infinity | +| test.c:397:14:397:14 | m | -Infinity | +| test.c:397:18:397:18 | n | -Infinity | +| test.c:397:22:397:22 | o | -Infinity | +| test.c:397:26:397:26 | p | -Infinity | +| test.c:397:30:397:30 | q | -Infinity | +| test.c:398:14:398:14 | m | -Infinity | +| test.c:398:18:398:18 | n | -Infinity | +| test.c:398:22:398:22 | o | -Infinity | +| test.c:398:26:398:26 | p | -Infinity | +| test.c:398:30:398:30 | q | -Infinity | +| test.c:399:14:399:14 | m | -Infinity | +| test.c:399:18:399:18 | n | -Infinity | +| test.c:399:22:399:22 | o | -Infinity | +| test.c:399:26:399:26 | p | -Infinity | +| test.c:399:30:399:30 | q | -Infinity | +| test.c:400:14:400:14 | m | -Infinity | +| test.c:400:18:400:18 | n | -Infinity | +| test.c:400:22:400:22 | o | -Infinity | +| test.c:400:26:400:26 | p | -Infinity | +| test.c:400:30:400:30 | q | -Infinity | +| test.c:401:14:401:14 | m | -Infinity | +| test.c:401:18:401:18 | n | -Infinity | +| test.c:401:22:401:22 | o | -Infinity | +| test.c:401:26:401:26 | p | -Infinity | +| test.c:401:30:401:30 | q | -Infinity | +| test.c:402:14:402:14 | m | -Infinity | +| test.c:402:18:402:18 | n | -Infinity | +| test.c:402:22:402:22 | o | -Infinity | +| test.c:402:26:402:26 | p | -Infinity | +| test.c:402:30:402:30 | q | -Infinity | +| test.c:403:14:403:14 | m | -Infinity | +| test.c:403:18:403:18 | n | -Infinity | +| test.c:403:22:403:22 | o | -Infinity | +| test.c:403:26:403:26 | p | -Infinity | +| test.c:403:30:403:30 | q | -Infinity | +| test.c:404:14:404:14 | m | -Infinity | +| test.c:404:18:404:18 | n | -Infinity | +| test.c:404:22:404:22 | o | -Infinity | +| test.c:404:26:404:26 | p | -Infinity | +| test.c:404:30:404:30 | q | -Infinity | +| test.c:405:14:405:14 | m | -Infinity | +| test.c:405:18:405:18 | n | -Infinity | +| test.c:405:22:405:22 | o | -Infinity | +| test.c:405:26:405:26 | p | -Infinity | +| test.c:405:30:405:30 | q | -Infinity | +| test.c:411:19:411:19 | a | 0.143339 | +| test.c:411:23:411:23 | b | 0.222479 | +| test.c:411:27:411:27 | c | 0.051213 | +| test.c:411:31:411:31 | d | 0.369769 | +| test.c:411:35:411:35 | e | 0.105977 | +| test.c:411:39:411:39 | f | 0.107867 | +| test.c:411:43:411:43 | g | 0.025243 | +| test.c:411:47:411:47 | h | 0.149635 | +| test.c:411:51:411:51 | i | 0.053282 | +| test.c:411:55:411:55 | j | 0.276432 | +| test.c:411:59:411:59 | k | 0.205191 | +| test.c:411:63:411:63 | l | 0.132041 | +| test.c:413:10:413:15 | output | 1.842468 | +| test.c:418:20:418:20 | x | 0 | +| test.c:418:30:418:30 | x | 0 | +| test.c:421:3:421:4 | y1 | 0 | +| test.c:421:11:421:11 | y | 0 | +| test.c:421:14:421:14 | y | 1 | +| test.c:422:3:422:4 | y2 | 0 | +| test.c:422:9:422:9 | y | 1 | +| test.c:422:14:422:14 | y | 2 | +| test.c:422:22:422:22 | y | 5 | +| test.c:423:10:423:11 | y1 | 1 | +| test.c:423:15:423:16 | y2 | 5 | +| test.c:431:3:431:3 | i | -2147483648 | +| test.c:432:7:432:7 | i | 10 | +| test.c:434:3:434:3 | i | -2147483648 | +| test.c:435:3:435:3 | i | 10 | +| test.c:436:7:436:7 | i | 20 | +| test.c:438:3:438:3 | i | -2147483648 | +| test.c:439:3:439:3 | i | 40 | +| test.c:440:7:440:7 | i | 30 | +| test.c:442:3:442:3 | i | -2147483648 | +| test.c:442:7:442:7 | j | -2147483648 | +| test.c:443:7:443:7 | i | 40 | +| test.c:445:3:445:3 | i | -2147483648 | +| test.c:445:8:445:8 | j | 40 | +| test.c:446:7:446:7 | i | 50 | +| test.c:448:3:448:3 | i | -2147483648 | +| test.c:448:13:448:13 | j | 50 | +| test.c:449:7:449:7 | i | 60 | +| test.c:456:12:456:12 | a | 0 | +| test.c:456:17:456:17 | a | 3 | +| test.c:456:33:456:33 | b | 0 | +| test.c:456:38:456:38 | b | 5 | +| test.c:457:13:457:13 | a | 3 | +| test.c:457:15:457:15 | b | 5 | +| test.c:458:5:458:9 | total | 0 | +| test.c:458:14:458:14 | r | 15 | +| test.c:460:12:460:12 | a | 0 | +| test.c:460:17:460:17 | a | 3 | +| test.c:460:33:460:33 | b | 0 | +| test.c:460:38:460:38 | b | 0 | +| test.c:461:13:461:13 | a | 3 | +| test.c:461:15:461:15 | b | 0 | +| test.c:462:5:462:9 | total | 0 | +| test.c:462:14:462:14 | r | 0 | +| test.c:464:12:464:12 | a | 0 | +| test.c:464:17:464:17 | a | 3 | +| test.c:464:34:464:34 | b | 0 | +| test.c:464:39:464:39 | b | 13 | +| test.c:465:13:465:13 | a | 3 | +| test.c:465:15:465:15 | b | 13 | +| test.c:466:5:466:9 | total | 0 | +| test.c:466:14:466:14 | r | 39 | +| test.c:469:10:469:14 | total | 0 | +| test.c:475:12:475:12 | b | 0 | +| test.c:475:17:475:17 | b | 5 | +| test.c:476:16:476:16 | b | 5 | +| test.c:477:5:477:9 | total | 0 | +| test.c:477:14:477:14 | r | 55 | +| test.c:479:12:479:12 | b | 0 | +| test.c:479:17:479:17 | b | 0 | +| test.c:480:16:480:16 | b | 0 | +| test.c:481:5:481:9 | total | 0 | +| test.c:481:14:481:14 | r | 0 | +| test.c:483:13:483:13 | b | 0 | +| test.c:483:18:483:18 | b | 13 | +| test.c:484:16:484:16 | b | 13 | +| test.c:485:5:485:9 | total | 0 | +| test.c:485:14:485:14 | r | 143 | +| test.c:488:10:488:14 | total | 0 | +| test.c:493:3:493:3 | x | 0 | +| test.c:493:7:493:7 | y | 0 | +| test.c:494:3:494:4 | xy | 0 | +| test.c:494:8:494:8 | x | 1000000003 | +| test.c:494:12:494:12 | y | 1000000003 | +| test.c:495:10:495:11 | xy | 1000000006000000000 | +| test.c:500:3:500:3 | x | 0 | +| test.c:501:3:501:3 | y | 0 | +| test.c:502:3:502:4 | xy | 0 | +| test.c:502:8:502:8 | x | 274177 | +| test.c:502:12:502:12 | y | 67280421310721 | +| test.c:503:10:503:11 | xy | 18446744073709551616 | +| test.c:507:7:507:8 | ui | 0 | +| test.c:508:43:508:44 | ui | 10 | +| test.c:508:48:508:49 | ui | 10 | +| test.c:509:12:509:17 | result | 100 | +| test.c:511:7:511:8 | ul | 0 | +| test.c:512:28:512:29 | ul | 10 | +| test.c:512:33:512:34 | ul | 10 | +| test.c:513:12:513:17 | result | 0 | +| test.c:519:7:519:8 | ui | 0 | +| test.c:519:19:519:20 | ui | 0 | +| test.c:520:5:520:6 | ui | 2 | +| test.c:520:11:520:12 | ui | 2 | +| test.c:521:12:521:13 | ui | 4 | +| test.c:525:3:525:9 | uiconst | 10 | +| test.c:528:3:528:9 | ulconst | 10 | +| test.c:529:10:529:16 | uiconst | 40 | +| test.c:529:20:529:26 | ulconst | 40 | +| test.c:533:7:533:7 | i | -2147483648 | +| test.c:533:18:533:18 | i | -1 | +| test.c:534:5:534:5 | i | -2147483648 | +| test.c:534:13:534:13 | i | -1 | +| test.c:535:9:535:9 | i | -5 | +| test.c:537:5:537:5 | i | -2147483648 | +| test.c:537:9:537:9 | i | -5 | +| test.c:538:9:538:9 | i | -30 | +| test.c:540:5:540:5 | i | -30 | +| test.c:541:9:541:9 | i | -210 | +| test.c:543:5:543:5 | i | -210 | +| test.c:544:9:544:9 | i | -1155 | +| test.c:546:7:546:7 | i | -2147483648 | +| test.c:547:5:547:5 | i | -2147483648 | +| test.c:547:9:547:9 | i | -1 | +| test.c:548:9:548:9 | i | 1 | +| test.c:550:3:550:3 | i | -2147483648 | +| test.c:550:7:550:7 | i | -2147483648 | +| test.c:551:10:551:10 | i | -2147483648 | +| test.c:554:3:554:3 | i | -2147483648 | +| test.c:554:10:554:11 | sc | 1 | +| test.c:556:7:556:7 | i | -128 | +| test.c:563:7:563:7 | n | 0 | +| test.c:565:7:565:7 | n | 0 | +| test.c:566:9:566:9 | n | 1 | +| test.c:569:7:569:7 | n | 0 | +| test.c:570:9:570:9 | n | 1 | +| test.c:572:9:572:9 | n | 0 | +| test.c:575:8:575:8 | n | 0 | +| test.c:576:9:576:9 | n | 0 | +| test.c:578:9:578:9 | n | 1 | +| test.c:581:10:581:10 | n | 0 | +| test.c:582:5:582:5 | n | 1 | +| test.c:585:7:585:7 | n | 0 | +| test.c:589:7:589:7 | n | -32768 | +| test.c:592:7:592:7 | n | 0 | +| test.c:593:9:593:9 | n | 0 | +| test.c:595:9:595:9 | n | 1 | +| test.c:598:7:598:7 | n | 0 | +| test.c:599:9:599:9 | n | 1 | +| test.c:601:9:601:9 | n | 0 | +| test.c:604:10:604:10 | n | 0 | +| test.c:605:5:605:5 | n | 1 | +| test.c:608:7:608:7 | n | 0 | +| test.c:612:7:612:7 | n | -32768 | +| test.c:613:9:613:9 | n | -32768 | +| test.c:614:11:614:11 | n | 0 | +| test.c:618:7:618:7 | n | -32768 | +| test.c:619:13:619:13 | n | 5 | +| test.c:622:9:622:9 | n | 6 | +| test.c:625:7:625:7 | n | -32768 | +| test.c:625:22:625:22 | n | -32767 | +| test.c:626:9:626:9 | n | -32766 | +| test.c:629:7:629:7 | n | -32768 | +| test.c:630:5:630:5 | n | 0 | +| test.c:630:10:630:10 | n | 1 | +| test.c:630:14:630:14 | n | 0 | +| test.c:631:6:631:6 | n | 0 | +| test.c:631:10:631:10 | n | 0 | +| test.c:631:14:631:14 | n | 1 | +| test.c:642:7:642:8 | ss | -32768 | +| test.c:643:9:643:10 | ss | 0 | +| test.c:646:7:646:8 | ss | -32768 | +| test.c:647:9:647:10 | ss | -32768 | +| test.c:650:14:650:15 | us | 0 | +| test.c:651:9:651:10 | us | 0 | +| test.c:654:14:654:15 | us | 0 | +| test.c:655:9:655:10 | us | 0 | +| test.c:658:7:658:8 | ss | -32768 | +| test.c:659:9:659:10 | ss | -32768 | +| test.c:662:7:662:8 | ss | -32768 | +| test.c:663:9:663:10 | ss | -1 | +| test.c:669:8:669:8 | s | -2147483648 | +| test.c:669:15:669:15 | s | 0 | +| test.c:669:23:669:23 | s | 0 | +| test.c:670:18:670:18 | s | 0 | +| test.c:670:22:670:22 | s | 0 | +| test.c:671:9:671:14 | result | 0 | +| test.c:677:7:677:7 | i | 0 | +| test.c:678:9:678:9 | i | -2147483648 | +| test.c:682:7:682:7 | u | 0 | +| test.c:683:9:683:9 | u | 0 | +| test.c:688:12:688:12 | s | -2147483648 | +| test.c:689:7:689:8 | s2 | -4 | +| test.c:694:7:694:7 | x | -2147483648 | +| test.c:695:9:695:9 | y | -2147483648 | +| test.c:699:7:699:7 | y | -2147483648 | +| test.c:708:7:708:7 | x | -2147483648 | +| test.c:713:7:713:7 | x | -2147483648 | +| test.c:720:8:720:8 | x | 2147483647 | +| test.c:720:12:720:12 | y | 256 | +| test.c:721:9:721:9 | x | 2147483647 | +| test.c:722:9:722:9 | y | 256 | | test.cpp:10:7:10:7 | b | -2147483648 | | test.cpp:11:5:11:5 | x | -2147483648 | | test.cpp:13:10:13:10 | x | -2147483648 | diff --git a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryLower.expected b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryLower.expected index f012490f1156..0cd2437e0730 100644 --- a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryLower.expected +++ b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryLower.expected @@ -12,8 +12,68 @@ | test.c:385:10:385:21 | ... ? ... : ... | 0.0 | 0.0 | 5.0 | | test.c:386:10:386:21 | ... ? ... : ... | 100.0 | 100.0 | 5.0 | | test.c:387:10:387:38 | ... ? ... : ... | 0.0 | 100.0 | 5.0 | -| test.c:394:20:394:36 | ... ? ... : ... | 0.0 | 0.0 | 100.0 | -| test.c:606:5:606:14 | ... ? ... : ... | 0.0 | 1.0 | 0.0 | -| test.c:607:5:607:14 | ... ? ... : ... | 0.0 | 0.0 | 1.0 | +| test.c:394:14:394:108 | ... ? ... : ... | 0.14333887 | 0.14333887 | 0.40496805 | +| test.c:394:18:394:95 | ... ? ... : ... | 0.14333887 | 0.14333887 | 0.21540225 | +| test.c:394:22:394:82 | ... ? ... : ... | 0.14333887 | 0.14333887 | 0.39206458 | +| test.c:394:26:394:69 | ... ? ... : ... | 0.14333887 | 0.14333887 | 0.35279203 | +| test.c:394:30:394:56 | ... ? ... : ... | 0.14333887 | 0.47438827 | 0.14333887 | +| test.c:395:14:395:108 | ... ? ... : ... | 0.22247853 | 0.22247853 | 0.5297741 | +| test.c:395:18:395:95 | ... ? ... : ... | 0.22247853 | 0.22247853 | 0.59270465 | +| test.c:395:22:395:82 | ... ? ... : ... | 0.22247853 | 0.22247853 | 0.32661893 | +| test.c:395:26:395:69 | ... ? ... : ... | 0.22247853 | 0.34183348 | 0.22247853 | +| test.c:395:30:395:56 | ... ? ... : ... | 0.34183348 | 0.34183348 | 0.3533464 | +| test.c:396:14:396:108 | ... ? ... : ... | 0.05121256 | 0.05121256 | 0.67981451 | +| test.c:396:18:396:95 | ... ? ... : ... | 0.05121256 | 0.05121256 | 0.79310745 | +| test.c:396:22:396:82 | ... ? ... : ... | 0.05121256 | 0.31235514 | 0.05121256 | +| test.c:396:26:396:69 | ... ? ... : ... | 0.31235514 | 0.31478084 | 0.31235514 | +| test.c:396:30:396:56 | ... ? ... : ... | 0.31478084 | 0.77429603 | 0.31478084 | +| test.c:397:14:397:108 | ... ? ... : ... | 0.36976948 | 0.36976948 | 0.83866835 | +| test.c:397:18:397:95 | ... ? ... : ... | 0.36976948 | 0.44729556 | 0.36976948 | +| test.c:397:22:397:82 | ... ? ... : ... | 0.44729556 | 0.44729556 | 0.59952732 | +| test.c:397:26:397:69 | ... ? ... : ... | 0.44729556 | 0.44729556 | 0.98997262 | +| test.c:397:30:397:56 | ... ? ... : ... | 0.44729556 | 0.44729556 | 0.80599202 | +| test.c:398:14:398:108 | ... ? ... : ... | 0.10597712 | 0.10597712 | 0.68734874 | +| test.c:398:18:398:95 | ... ? ... : ... | 0.10597712 | 0.10597712 | 0.72485966 | +| test.c:398:22:398:82 | ... ? ... : ... | 0.10597712 | 0.10597712 | 0.21778426 | +| test.c:398:26:398:69 | ... ? ... : ... | 0.10597712 | 0.49311828 | 0.10597712 | +| test.c:398:30:398:56 | ... ? ... : ... | 0.49311828 | 0.49311828 | 0.90389911 | +| test.c:399:14:399:108 | ... ? ... : ... | 0.1078665 | 0.1078665 | 0.58440865 | +| test.c:399:18:399:95 | ... ? ... : ... | 0.1078665 | 0.1078665 | 0.34808892 | +| test.c:399:22:399:82 | ... ? ... : ... | 0.1078665 | 0.1078665 | 0.76164052 | +| test.c:399:26:399:69 | ... ? ... : ... | 0.1078665 | 0.1078665 | 0.11884576 | +| test.c:399:30:399:56 | ... ? ... : ... | 0.1078665 | 0.47452848 | 0.1078665 | +| test.c:400:14:400:108 | ... ? ... : ... | 0.02524326 | 0.02524326 | 0.36232384 | +| test.c:400:18:400:95 | ... ? ... : ... | 0.02524326 | 0.02524326 | 0.85235179 | +| test.c:400:22:400:82 | ... ? ... : ... | 0.02524326 | 0.02524326 | 0.12516558 | +| test.c:400:26:400:69 | ... ? ... : ... | 0.02524326 | 0.02524326 | 0.95823075 | +| test.c:400:30:400:56 | ... ? ... : ... | 0.02524326 | 0.02524326 | 0.82905046 | +| test.c:401:14:401:108 | ... ? ... : ... | 0.14963485 | 0.14963485 | 0.84331272 | +| test.c:401:18:401:95 | ... ? ... : ... | 0.14963485 | 0.14963485 | 0.48640909 | +| test.c:401:22:401:82 | ... ? ... : ... | 0.14963485 | 0.14963485 | 0.45041108 | +| test.c:401:26:401:69 | ... ? ... : ... | 0.14963485 | 0.32876044 | 0.14963485 | +| test.c:401:30:401:56 | ... ? ... : ... | 0.32876044 | 0.38708626 | 0.32876044 | +| test.c:402:14:402:108 | ... ? ... : ... | 0.05328182 | 0.14800508 | 0.05328182 | +| test.c:402:18:402:95 | ... ? ... : ... | 0.14800508 | 0.14800508 | 0.37428143 | +| test.c:402:22:402:82 | ... ? ... : ... | 0.14800508 | 0.15755063 | 0.14800508 | +| test.c:402:26:402:69 | ... ? ... : ... | 0.15755063 | 0.15755063 | 0.26428481 | +| test.c:402:30:402:56 | ... ? ... : ... | 0.15755063 | 0.15755063 | 0.77086833 | +| test.c:403:14:403:108 | ... ? ... : ... | 0.27643238 | 0.27643238 | 0.69072144 | +| test.c:403:18:403:95 | ... ? ... : ... | 0.27643238 | 0.27643238 | 0.39468857 | +| test.c:403:22:403:82 | ... ? ... : ... | 0.27643238 | 0.27643238 | 0.55679274 | +| test.c:403:26:403:69 | ... ? ... : ... | 0.27643238 | 0.41736536 | 0.27643238 | +| test.c:403:30:403:56 | ... ? ... : ... | 0.41736536 | 0.41736536 | 0.76826628 | +| test.c:404:14:404:108 | ... ? ... : ... | 0.2051911 | 0.2051911 | 0.81372798 | +| test.c:404:18:404:95 | ... ? ... : ... | 0.2051911 | 0.2051911 | 0.88745559 | +| test.c:404:22:404:82 | ... ? ... : ... | 0.2051911 | 0.29904824 | 0.2051911 | +| test.c:404:26:404:69 | ... ? ... : ... | 0.29904824 | 0.29904824 | 0.76242583 | +| test.c:404:30:404:56 | ... ? ... : ... | 0.29904824 | 0.88955345 | 0.29904824 | +| test.c:405:14:405:108 | ... ? ... : ... | 0.13204114 | 0.13204114 | 0.42762647 | +| test.c:405:18:405:95 | ... ? ... : ... | 0.13204114 | 0.13204114 | 0.52031241 | +| test.c:405:22:405:82 | ... ? ... : ... | 0.13204114 | 0.42186276 | 0.13204114 | +| test.c:405:26:405:69 | ... ? ... : ... | 0.42186276 | 0.42186276 | 0.44996679 | +| test.c:405:30:405:56 | ... ? ... : ... | 0.42186276 | 0.42186276 | 0.53843358 | +| test.c:418:20:418:36 | ... ? ... : ... | 0.0 | 0.0 | 100.0 | +| test.c:630:5:630:14 | ... ? ... : ... | 0.0 | 1.0 | 0.0 | +| test.c:631:5:631:14 | ... ? ... : ... | 0.0 | 0.0 | 1.0 | | test.cpp:121:3:121:12 | ... ? ... : ... | 0.0 | 1.0 | 0.0 | | test.cpp:122:3:122:12 | ... ? ... : ... | 0.0 | 0.0 | 1.0 | diff --git a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryUpper.expected b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryUpper.expected index 8a387c3ae464..b34beda10d42 100644 --- a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryUpper.expected +++ b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/ternaryUpper.expected @@ -12,8 +12,68 @@ | test.c:385:10:385:21 | ... ? ... : ... | 4.294967295E9 | 4.294967295E9 | 5.0 | | test.c:386:10:386:21 | ... ? ... : ... | 4.294967295E9 | 4.294967295E9 | 5.0 | | test.c:387:10:387:38 | ... ? ... : ... | 255.0 | 4.294967295E9 | 5.0 | -| test.c:394:20:394:36 | ... ? ... : ... | 100.0 | 99.0 | 100.0 | -| test.c:606:5:606:14 | ... ? ... : ... | 32767.0 | 32767.0 | 0.0 | -| test.c:607:5:607:14 | ... ? ... : ... | 32767.0 | 0.0 | 32767.0 | +| test.c:394:14:394:108 | ... ? ... : ... | 0.47438827 | 0.47438827 | 0.40496805 | +| test.c:394:18:394:95 | ... ? ... : ... | 0.47438827 | 0.47438827 | 0.21540225 | +| test.c:394:22:394:82 | ... ? ... : ... | 0.47438827 | 0.47438827 | 0.39206458 | +| test.c:394:26:394:69 | ... ? ... : ... | 0.47438827 | 0.47438827 | 0.35279203 | +| test.c:394:30:394:56 | ... ? ... : ... | 0.47438827 | 0.47438827 | 0.14333887 | +| test.c:395:14:395:108 | ... ? ... : ... | 0.59270465 | 0.59270465 | 0.5297741 | +| test.c:395:18:395:95 | ... ? ... : ... | 0.59270465 | 0.3533464 | 0.59270465 | +| test.c:395:22:395:82 | ... ? ... : ... | 0.3533464 | 0.3533464 | 0.32661893 | +| test.c:395:26:395:69 | ... ? ... : ... | 0.3533464 | 0.3533464 | 0.22247853 | +| test.c:395:30:395:56 | ... ? ... : ... | 0.3533464 | 0.34183348 | 0.3533464 | +| test.c:396:14:396:108 | ... ? ... : ... | 0.79310745 | 0.79310745 | 0.67981451 | +| test.c:396:18:396:95 | ... ? ... : ... | 0.79310745 | 0.77429603 | 0.79310745 | +| test.c:396:22:396:82 | ... ? ... : ... | 0.77429603 | 0.77429603 | 0.05121256 | +| test.c:396:26:396:69 | ... ? ... : ... | 0.77429603 | 0.77429603 | 0.31235514 | +| test.c:396:30:396:56 | ... ? ... : ... | 0.77429603 | 0.77429603 | 0.31478084 | +| test.c:397:14:397:108 | ... ? ... : ... | 0.98997262 | 0.98997262 | 0.83866835 | +| test.c:397:18:397:95 | ... ? ... : ... | 0.98997262 | 0.98997262 | 0.36976948 | +| test.c:397:22:397:82 | ... ? ... : ... | 0.98997262 | 0.98997262 | 0.59952732 | +| test.c:397:26:397:69 | ... ? ... : ... | 0.98997262 | 0.80599202 | 0.98997262 | +| test.c:397:30:397:56 | ... ? ... : ... | 0.80599202 | 0.44729556 | 0.80599202 | +| test.c:398:14:398:108 | ... ? ... : ... | 0.90389911 | 0.90389911 | 0.68734874 | +| test.c:398:18:398:95 | ... ? ... : ... | 0.90389911 | 0.90389911 | 0.72485966 | +| test.c:398:22:398:82 | ... ? ... : ... | 0.90389911 | 0.90389911 | 0.21778426 | +| test.c:398:26:398:69 | ... ? ... : ... | 0.90389911 | 0.90389911 | 0.10597712 | +| test.c:398:30:398:56 | ... ? ... : ... | 0.90389911 | 0.49311828 | 0.90389911 | +| test.c:399:14:399:108 | ... ? ... : ... | 0.76164052 | 0.76164052 | 0.58440865 | +| test.c:399:18:399:95 | ... ? ... : ... | 0.76164052 | 0.76164052 | 0.34808892 | +| test.c:399:22:399:82 | ... ? ... : ... | 0.76164052 | 0.47452848 | 0.76164052 | +| test.c:399:26:399:69 | ... ? ... : ... | 0.47452848 | 0.47452848 | 0.11884576 | +| test.c:399:30:399:56 | ... ? ... : ... | 0.47452848 | 0.47452848 | 0.1078665 | +| test.c:400:14:400:108 | ... ? ... : ... | 0.95823075 | 0.95823075 | 0.36232384 | +| test.c:400:18:400:95 | ... ? ... : ... | 0.95823075 | 0.95823075 | 0.85235179 | +| test.c:400:22:400:82 | ... ? ... : ... | 0.95823075 | 0.95823075 | 0.12516558 | +| test.c:400:26:400:69 | ... ? ... : ... | 0.95823075 | 0.82905046 | 0.95823075 | +| test.c:400:30:400:56 | ... ? ... : ... | 0.82905046 | 0.02524326 | 0.82905046 | +| test.c:401:14:401:108 | ... ? ... : ... | 0.84331272 | 0.48640909 | 0.84331272 | +| test.c:401:18:401:95 | ... ? ... : ... | 0.48640909 | 0.45041108 | 0.48640909 | +| test.c:401:22:401:82 | ... ? ... : ... | 0.45041108 | 0.38708626 | 0.45041108 | +| test.c:401:26:401:69 | ... ? ... : ... | 0.38708626 | 0.38708626 | 0.14963485 | +| test.c:401:30:401:56 | ... ? ... : ... | 0.38708626 | 0.38708626 | 0.32876044 | +| test.c:402:14:402:108 | ... ? ... : ... | 0.77086833 | 0.77086833 | 0.05328182 | +| test.c:402:18:402:95 | ... ? ... : ... | 0.77086833 | 0.77086833 | 0.37428143 | +| test.c:402:22:402:82 | ... ? ... : ... | 0.77086833 | 0.77086833 | 0.14800508 | +| test.c:402:26:402:69 | ... ? ... : ... | 0.77086833 | 0.77086833 | 0.26428481 | +| test.c:402:30:402:56 | ... ? ... : ... | 0.77086833 | 0.15755063 | 0.77086833 | +| test.c:403:14:403:108 | ... ? ... : ... | 0.76826628 | 0.76826628 | 0.69072144 | +| test.c:403:18:403:95 | ... ? ... : ... | 0.76826628 | 0.76826628 | 0.39468857 | +| test.c:403:22:403:82 | ... ? ... : ... | 0.76826628 | 0.76826628 | 0.55679274 | +| test.c:403:26:403:69 | ... ? ... : ... | 0.76826628 | 0.76826628 | 0.27643238 | +| test.c:403:30:403:56 | ... ? ... : ... | 0.76826628 | 0.41736536 | 0.76826628 | +| test.c:404:14:404:108 | ... ? ... : ... | 0.88955345 | 0.88955345 | 0.81372798 | +| test.c:404:18:404:95 | ... ? ... : ... | 0.88955345 | 0.88955345 | 0.88745559 | +| test.c:404:22:404:82 | ... ? ... : ... | 0.88955345 | 0.88955345 | 0.2051911 | +| test.c:404:26:404:69 | ... ? ... : ... | 0.88955345 | 0.88955345 | 0.76242583 | +| test.c:404:30:404:56 | ... ? ... : ... | 0.88955345 | 0.88955345 | 0.29904824 | +| test.c:405:14:405:108 | ... ? ... : ... | 0.53843358 | 0.53843358 | 0.42762647 | +| test.c:405:18:405:95 | ... ? ... : ... | 0.53843358 | 0.53843358 | 0.52031241 | +| test.c:405:22:405:82 | ... ? ... : ... | 0.53843358 | 0.53843358 | 0.13204114 | +| test.c:405:26:405:69 | ... ? ... : ... | 0.53843358 | 0.53843358 | 0.44996679 | +| test.c:405:30:405:56 | ... ? ... : ... | 0.53843358 | 0.42186276 | 0.53843358 | +| test.c:418:20:418:36 | ... ? ... : ... | 100.0 | 99.0 | 100.0 | +| test.c:630:5:630:14 | ... ? ... : ... | 32767.0 | 32767.0 | 0.0 | +| test.c:631:5:631:14 | ... ? ... : ... | 32767.0 | 0.0 | 32767.0 | | test.cpp:121:3:121:12 | ... ? ... : ... | 32767.0 | 32767.0 | 0.0 | | test.cpp:122:3:122:12 | ... ? ... : ... | 32767.0 | 0.0 | 32767.0 | diff --git a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.c b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.c index 8c7978ac4aa6..db7c71e00504 100644 --- a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.c +++ b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.c @@ -389,6 +389,30 @@ unsigned int test_ternary02(unsigned int x) { return y1 + y2 + y3 + y4 + y5; } +// Test that nested ternary expressions of literals doesn't cause performance blow up. +double test_ternary_nested_of_literals(double m, double n, double o, double p, double q) { + double a = m ? n ? o ? p ? q ? 0.47438827 : 0.14333887 : 0.35279203 : 0.39206458 : 0.21540225 : 0.40496805; + double b = m ? n ? o ? p ? q ? 0.34183348 : 0.35334640 : 0.22247853 : 0.32661893 : 0.59270465 : 0.52977410; + double c = m ? n ? o ? p ? q ? 0.77429603 : 0.31478084 : 0.31235514 : 0.05121256 : 0.79310745 : 0.67981451; + double d = m ? n ? o ? p ? q ? 0.44729556 : 0.80599202 : 0.98997262 : 0.59952732 : 0.36976948 : 0.83866835; + double e = m ? n ? o ? p ? q ? 0.49311828 : 0.90389911 : 0.10597712 : 0.21778426 : 0.72485966 : 0.68734874; + double f = m ? n ? o ? p ? q ? 0.47452848 : 0.10786650 : 0.11884576 : 0.76164052 : 0.34808892 : 0.58440865; + double g = m ? n ? o ? p ? q ? 0.02524326 : 0.82905046 : 0.95823075 : 0.12516558 : 0.85235179 : 0.36232384; + double h = m ? n ? o ? p ? q ? 0.38708626 : 0.32876044 : 0.14963485 : 0.45041108 : 0.48640909 : 0.84331272; + double i = m ? n ? o ? p ? q ? 0.15755063 : 0.77086833 : 0.26428481 : 0.14800508 : 0.37428143 : 0.05328182; + double j = m ? n ? o ? p ? q ? 0.41736536 : 0.76826628 : 0.27643238 : 0.55679274 : 0.39468857 : 0.69072144; + double k = m ? n ? o ? p ? q ? 0.88955345 : 0.29904824 : 0.76242583 : 0.20519110 : 0.88745559 : 0.81372798; + double l = m ? n ? o ? p ? q ? 0.42186276 : 0.53843358 : 0.44996679 : 0.13204114 : 0.52031241 : 0.42762647; + + // Since the abstract interpretation of `+` produces a product of the bounds + // of the input operands, `output` will have k^12 bounds, where `k` is the + // number of bounds that each of the variables above have. This blows up + // unless `k` is 1. + double output = a + b + c + d + e + f + g + h + i + j + k + l; + + return output; +} + // Test the comma expression. unsigned int test_comma01(unsigned int x) { unsigned int y = x < 100 ? x : 100; diff --git a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/upperBound.expected b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/upperBound.expected index 8772a763a4d3..8696ecfe8d09 100644 --- a/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/upperBound.expected +++ b/cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/upperBound.expected @@ -412,197 +412,270 @@ | test.c:389:20:389:21 | y3 | 4294967295 | | test.c:389:25:389:26 | y4 | 4294967295 | | test.c:389:30:389:31 | y5 | 1000 | -| test.c:394:20:394:20 | x | 4294967295 | -| test.c:394:30:394:30 | x | 99 | -| test.c:397:3:397:4 | y1 | 4294967295 | -| test.c:397:11:397:11 | y | 100 | -| test.c:397:14:397:14 | y | 101 | -| test.c:398:3:398:4 | y2 | 4294967295 | -| test.c:398:9:398:9 | y | 101 | -| test.c:398:14:398:14 | y | 102 | -| test.c:398:22:398:22 | y | 105 | -| test.c:399:10:399:11 | y1 | 101 | -| test.c:399:15:399:16 | y2 | 105 | -| test.c:407:3:407:3 | i | 2147483647 | -| test.c:408:7:408:7 | i | 10 | -| test.c:410:3:410:3 | i | 2147483647 | -| test.c:411:3:411:3 | i | 10 | -| test.c:412:7:412:7 | i | 20 | -| test.c:414:3:414:3 | i | 2147483647 | -| test.c:415:3:415:3 | i | 40 | -| test.c:416:7:416:7 | i | 30 | -| test.c:418:3:418:3 | i | 2147483647 | -| test.c:418:7:418:7 | j | 2147483647 | -| test.c:419:7:419:7 | i | 40 | -| test.c:421:3:421:3 | i | 2147483647 | -| test.c:421:8:421:8 | j | 40 | -| test.c:422:7:422:7 | i | 50 | -| test.c:424:3:424:3 | i | 2147483647 | -| test.c:424:13:424:13 | j | 50 | -| test.c:425:7:425:7 | i | 60 | -| test.c:432:12:432:12 | a | 4294967295 | -| test.c:432:17:432:17 | a | 4294967295 | -| test.c:432:33:432:33 | b | 4294967295 | -| test.c:432:38:432:38 | b | 4294967295 | -| test.c:433:13:433:13 | a | 11 | -| test.c:433:15:433:15 | b | 23 | -| test.c:434:5:434:9 | total | 0 | -| test.c:434:14:434:14 | r | 253 | -| test.c:436:12:436:12 | a | 4294967295 | -| test.c:436:17:436:17 | a | 4294967295 | -| test.c:436:33:436:33 | b | 4294967295 | -| test.c:436:38:436:38 | b | 4294967295 | -| test.c:437:13:437:13 | a | 11 | -| test.c:437:15:437:15 | b | 23 | -| test.c:438:5:438:9 | total | 253 | -| test.c:438:14:438:14 | r | 253 | -| test.c:440:12:440:12 | a | 4294967295 | -| test.c:440:17:440:17 | a | 4294967295 | -| test.c:440:34:440:34 | b | 4294967295 | -| test.c:440:39:440:39 | b | 4294967295 | -| test.c:441:13:441:13 | a | 11 | -| test.c:441:15:441:15 | b | 23 | -| test.c:442:5:442:9 | total | 506 | -| test.c:442:14:442:14 | r | 253 | -| test.c:445:10:445:14 | total | 759 | -| test.c:451:12:451:12 | b | 4294967295 | -| test.c:451:17:451:17 | b | 4294967295 | -| test.c:452:16:452:16 | b | 23 | -| test.c:453:5:453:9 | total | 0 | -| test.c:453:14:453:14 | r | 253 | -| test.c:455:12:455:12 | b | 4294967295 | -| test.c:455:17:455:17 | b | 4294967295 | -| test.c:456:16:456:16 | b | 23 | -| test.c:457:5:457:9 | total | 253 | -| test.c:457:14:457:14 | r | 253 | -| test.c:459:13:459:13 | b | 4294967295 | -| test.c:459:18:459:18 | b | 4294967295 | -| test.c:460:16:460:16 | b | 23 | -| test.c:461:5:461:9 | total | 506 | -| test.c:461:14:461:14 | r | 253 | -| test.c:464:10:464:14 | total | 759 | -| test.c:469:3:469:3 | x | 18446744073709551616 | -| test.c:469:7:469:7 | y | 18446744073709551616 | -| test.c:470:3:470:4 | xy | 18446744073709551616 | -| test.c:470:8:470:8 | x | 1000000003 | -| test.c:470:12:470:12 | y | 1000000003 | -| test.c:471:10:471:11 | xy | 1000000006000000000 | -| test.c:476:3:476:3 | x | 18446744073709551616 | -| test.c:477:3:477:3 | y | 18446744073709551616 | -| test.c:478:3:478:4 | xy | 18446744073709551616 | -| test.c:478:8:478:8 | x | 274177 | -| test.c:478:12:478:12 | y | 67280421310721 | -| test.c:479:10:479:11 | xy | 18446744073709551616 | -| test.c:483:7:483:8 | ui | 4294967295 | -| test.c:484:43:484:44 | ui | 4294967295 | -| test.c:484:48:484:49 | ui | 4294967295 | -| test.c:485:12:485:17 | result | 18446744065119617024 | -| test.c:487:7:487:8 | ul | 18446744073709551616 | -| test.c:488:28:488:29 | ul | 18446744073709551616 | -| test.c:488:33:488:34 | ul | 18446744073709551616 | -| test.c:489:12:489:17 | result | 18446744073709551616 | -| test.c:495:7:495:8 | ui | 4294967295 | -| test.c:495:19:495:20 | ui | 10 | -| test.c:496:5:496:6 | ui | 10 | -| test.c:496:11:496:12 | ui | 10 | -| test.c:497:12:497:13 | ui | 100 | -| test.c:501:3:501:9 | uiconst | 10 | -| test.c:504:3:504:9 | ulconst | 10 | -| test.c:505:10:505:16 | uiconst | 40 | -| test.c:505:20:505:26 | ulconst | 40 | -| test.c:509:7:509:7 | i | 2147483647 | -| test.c:509:18:509:18 | i | 2147483647 | -| test.c:510:5:510:5 | i | 2147483647 | -| test.c:510:13:510:13 | i | 2 | -| test.c:511:9:511:9 | i | 10 | -| test.c:513:5:513:5 | i | 2147483647 | -| test.c:513:9:513:9 | i | 10 | -| test.c:514:9:514:9 | i | 15 | -| test.c:516:5:516:5 | i | 15 | -| test.c:517:9:517:9 | i | 105 | -| test.c:519:5:519:5 | i | 105 | -| test.c:520:9:520:9 | i | 2310 | -| test.c:522:7:522:7 | i | 2147483647 | -| test.c:523:5:523:5 | i | 2147483647 | -| test.c:523:9:523:9 | i | -1 | -| test.c:524:9:524:9 | i | 1 | -| test.c:526:3:526:3 | i | 2147483647 | -| test.c:526:7:526:7 | i | 2147483647 | -| test.c:527:10:527:10 | i | 2147483647 | -| test.c:530:3:530:3 | i | 2147483647 | -| test.c:530:10:530:11 | sc | 1 | -| test.c:532:7:532:7 | i | 127 | -| test.c:539:7:539:7 | n | 4294967295 | -| test.c:541:7:541:7 | n | 4294967295 | -| test.c:542:9:542:9 | n | 4294967295 | -| test.c:545:7:545:7 | n | 4294967295 | -| test.c:546:9:546:9 | n | 4294967295 | -| test.c:548:9:548:9 | n | 0 | -| test.c:551:8:551:8 | n | 4294967295 | -| test.c:552:9:552:9 | n | 0 | -| test.c:554:9:554:9 | n | 4294967295 | -| test.c:557:10:557:10 | n | 4294967295 | -| test.c:558:5:558:5 | n | 4294967295 | -| test.c:561:7:561:7 | n | 0 | -| test.c:565:7:565:7 | n | 32767 | -| test.c:568:7:568:7 | n | 32767 | -| test.c:569:9:569:9 | n | 0 | -| test.c:571:9:571:9 | n | 32767 | -| test.c:574:7:574:7 | n | 32767 | -| test.c:575:9:575:9 | n | 32767 | -| test.c:577:9:577:9 | n | 0 | -| test.c:580:10:580:10 | n | 32767 | -| test.c:581:5:581:5 | n | 32767 | -| test.c:584:7:584:7 | n | 0 | -| test.c:588:7:588:7 | n | 32767 | -| test.c:589:9:589:9 | n | 32767 | -| test.c:590:11:590:11 | n | 32767 | -| test.c:594:7:594:7 | n | 32767 | -| test.c:595:13:595:13 | n | 32767 | -| test.c:598:9:598:9 | n | 32767 | -| test.c:601:7:601:7 | n | 32767 | -| test.c:601:22:601:22 | n | 32767 | -| test.c:602:9:602:9 | n | 32767 | -| test.c:605:7:605:7 | n | 32767 | -| test.c:606:5:606:5 | n | 32767 | -| test.c:606:10:606:10 | n | 32767 | -| test.c:606:14:606:14 | n | 0 | -| test.c:607:6:607:6 | n | 32767 | -| test.c:607:10:607:10 | n | 0 | -| test.c:607:14:607:14 | n | 32767 | -| test.c:618:7:618:8 | ss | 32767 | -| test.c:619:9:619:10 | ss | 3 | -| test.c:622:7:622:8 | ss | 32767 | -| test.c:623:9:623:10 | ss | 32767 | -| test.c:626:14:626:15 | us | 65535 | -| test.c:627:9:627:10 | us | 32767 | -| test.c:630:14:630:15 | us | 65535 | -| test.c:631:9:631:10 | us | 65535 | -| test.c:634:7:634:8 | ss | 32767 | -| test.c:635:9:635:10 | ss | 32767 | -| test.c:638:7:638:8 | ss | 32767 | -| test.c:639:9:639:10 | ss | 2 | -| test.c:645:8:645:8 | s | 2147483647 | -| test.c:645:15:645:15 | s | 127 | -| test.c:645:23:645:23 | s | 9 | -| test.c:646:18:646:18 | s | 9 | -| test.c:646:22:646:22 | s | 9 | -| test.c:647:9:647:14 | result | 127 | -| test.c:653:7:653:7 | i | 0 | -| test.c:654:9:654:9 | i | 2147483647 | -| test.c:658:7:658:7 | u | 0 | -| test.c:659:9:659:9 | u | 4294967295 | -| test.c:664:12:664:12 | s | 2147483647 | -| test.c:665:7:665:8 | s2 | 4 | -| test.c:670:7:670:7 | x | 2147483647 | -| test.c:671:9:671:9 | y | 2147483647 | -| test.c:675:7:675:7 | y | 2147483647 | -| test.c:684:7:684:7 | x | 2147483647 | -| test.c:689:7:689:7 | x | 15 | -| test.c:696:8:696:8 | x | 2147483647 | -| test.c:696:12:696:12 | y | 256 | -| test.c:697:9:697:9 | x | 2147483647 | -| test.c:698:9:698:9 | y | 256 | +| test.c:394:14:394:14 | m | Infinity | +| test.c:394:18:394:18 | n | Infinity | +| test.c:394:22:394:22 | o | Infinity | +| test.c:394:26:394:26 | p | Infinity | +| test.c:394:30:394:30 | q | Infinity | +| test.c:395:14:395:14 | m | Infinity | +| test.c:395:18:395:18 | n | Infinity | +| test.c:395:22:395:22 | o | Infinity | +| test.c:395:26:395:26 | p | Infinity | +| test.c:395:30:395:30 | q | Infinity | +| test.c:396:14:396:14 | m | Infinity | +| test.c:396:18:396:18 | n | Infinity | +| test.c:396:22:396:22 | o | Infinity | +| test.c:396:26:396:26 | p | Infinity | +| test.c:396:30:396:30 | q | Infinity | +| test.c:397:14:397:14 | m | Infinity | +| test.c:397:18:397:18 | n | Infinity | +| test.c:397:22:397:22 | o | Infinity | +| test.c:397:26:397:26 | p | Infinity | +| test.c:397:30:397:30 | q | Infinity | +| test.c:398:14:398:14 | m | Infinity | +| test.c:398:18:398:18 | n | Infinity | +| test.c:398:22:398:22 | o | Infinity | +| test.c:398:26:398:26 | p | Infinity | +| test.c:398:30:398:30 | q | Infinity | +| test.c:399:14:399:14 | m | Infinity | +| test.c:399:18:399:18 | n | Infinity | +| test.c:399:22:399:22 | o | Infinity | +| test.c:399:26:399:26 | p | Infinity | +| test.c:399:30:399:30 | q | Infinity | +| test.c:400:14:400:14 | m | Infinity | +| test.c:400:18:400:18 | n | Infinity | +| test.c:400:22:400:22 | o | Infinity | +| test.c:400:26:400:26 | p | Infinity | +| test.c:400:30:400:30 | q | Infinity | +| test.c:401:14:401:14 | m | Infinity | +| test.c:401:18:401:18 | n | Infinity | +| test.c:401:22:401:22 | o | Infinity | +| test.c:401:26:401:26 | p | Infinity | +| test.c:401:30:401:30 | q | Infinity | +| test.c:402:14:402:14 | m | Infinity | +| test.c:402:18:402:18 | n | Infinity | +| test.c:402:22:402:22 | o | Infinity | +| test.c:402:26:402:26 | p | Infinity | +| test.c:402:30:402:30 | q | Infinity | +| test.c:403:14:403:14 | m | Infinity | +| test.c:403:18:403:18 | n | Infinity | +| test.c:403:22:403:22 | o | Infinity | +| test.c:403:26:403:26 | p | Infinity | +| test.c:403:30:403:30 | q | Infinity | +| test.c:404:14:404:14 | m | Infinity | +| test.c:404:18:404:18 | n | Infinity | +| test.c:404:22:404:22 | o | Infinity | +| test.c:404:26:404:26 | p | Infinity | +| test.c:404:30:404:30 | q | Infinity | +| test.c:405:14:405:14 | m | Infinity | +| test.c:405:18:405:18 | n | Infinity | +| test.c:405:22:405:22 | o | Infinity | +| test.c:405:26:405:26 | p | Infinity | +| test.c:405:30:405:30 | q | Infinity | +| test.c:411:19:411:19 | a | 0.474388 | +| test.c:411:23:411:23 | b | 0.592705 | +| test.c:411:27:411:27 | c | 0.793107 | +| test.c:411:31:411:31 | d | 0.989973 | +| test.c:411:35:411:35 | e | 0.903899 | +| test.c:411:39:411:39 | f | 0.761641 | +| test.c:411:43:411:43 | g | 0.958231 | +| test.c:411:47:411:47 | h | 0.843313 | +| test.c:411:51:411:51 | i | 0.770868 | +| test.c:411:55:411:55 | j | 0.768266 | +| test.c:411:59:411:59 | k | 0.889553 | +| test.c:411:63:411:63 | l | 0.538434 | +| test.c:413:10:413:15 | output | 9.284378 | +| test.c:418:20:418:20 | x | 4294967295 | +| test.c:418:30:418:30 | x | 99 | +| test.c:421:3:421:4 | y1 | 4294967295 | +| test.c:421:11:421:11 | y | 100 | +| test.c:421:14:421:14 | y | 101 | +| test.c:422:3:422:4 | y2 | 4294967295 | +| test.c:422:9:422:9 | y | 101 | +| test.c:422:14:422:14 | y | 102 | +| test.c:422:22:422:22 | y | 105 | +| test.c:423:10:423:11 | y1 | 101 | +| test.c:423:15:423:16 | y2 | 105 | +| test.c:431:3:431:3 | i | 2147483647 | +| test.c:432:7:432:7 | i | 10 | +| test.c:434:3:434:3 | i | 2147483647 | +| test.c:435:3:435:3 | i | 10 | +| test.c:436:7:436:7 | i | 20 | +| test.c:438:3:438:3 | i | 2147483647 | +| test.c:439:3:439:3 | i | 40 | +| test.c:440:7:440:7 | i | 30 | +| test.c:442:3:442:3 | i | 2147483647 | +| test.c:442:7:442:7 | j | 2147483647 | +| test.c:443:7:443:7 | i | 40 | +| test.c:445:3:445:3 | i | 2147483647 | +| test.c:445:8:445:8 | j | 40 | +| test.c:446:7:446:7 | i | 50 | +| test.c:448:3:448:3 | i | 2147483647 | +| test.c:448:13:448:13 | j | 50 | +| test.c:449:7:449:7 | i | 60 | +| test.c:456:12:456:12 | a | 4294967295 | +| test.c:456:17:456:17 | a | 4294967295 | +| test.c:456:33:456:33 | b | 4294967295 | +| test.c:456:38:456:38 | b | 4294967295 | +| test.c:457:13:457:13 | a | 11 | +| test.c:457:15:457:15 | b | 23 | +| test.c:458:5:458:9 | total | 0 | +| test.c:458:14:458:14 | r | 253 | +| test.c:460:12:460:12 | a | 4294967295 | +| test.c:460:17:460:17 | a | 4294967295 | +| test.c:460:33:460:33 | b | 4294967295 | +| test.c:460:38:460:38 | b | 4294967295 | +| test.c:461:13:461:13 | a | 11 | +| test.c:461:15:461:15 | b | 23 | +| test.c:462:5:462:9 | total | 253 | +| test.c:462:14:462:14 | r | 253 | +| test.c:464:12:464:12 | a | 4294967295 | +| test.c:464:17:464:17 | a | 4294967295 | +| test.c:464:34:464:34 | b | 4294967295 | +| test.c:464:39:464:39 | b | 4294967295 | +| test.c:465:13:465:13 | a | 11 | +| test.c:465:15:465:15 | b | 23 | +| test.c:466:5:466:9 | total | 506 | +| test.c:466:14:466:14 | r | 253 | +| test.c:469:10:469:14 | total | 759 | +| test.c:475:12:475:12 | b | 4294967295 | +| test.c:475:17:475:17 | b | 4294967295 | +| test.c:476:16:476:16 | b | 23 | +| test.c:477:5:477:9 | total | 0 | +| test.c:477:14:477:14 | r | 253 | +| test.c:479:12:479:12 | b | 4294967295 | +| test.c:479:17:479:17 | b | 4294967295 | +| test.c:480:16:480:16 | b | 23 | +| test.c:481:5:481:9 | total | 253 | +| test.c:481:14:481:14 | r | 253 | +| test.c:483:13:483:13 | b | 4294967295 | +| test.c:483:18:483:18 | b | 4294967295 | +| test.c:484:16:484:16 | b | 23 | +| test.c:485:5:485:9 | total | 506 | +| test.c:485:14:485:14 | r | 253 | +| test.c:488:10:488:14 | total | 759 | +| test.c:493:3:493:3 | x | 18446744073709551616 | +| test.c:493:7:493:7 | y | 18446744073709551616 | +| test.c:494:3:494:4 | xy | 18446744073709551616 | +| test.c:494:8:494:8 | x | 1000000003 | +| test.c:494:12:494:12 | y | 1000000003 | +| test.c:495:10:495:11 | xy | 1000000006000000000 | +| test.c:500:3:500:3 | x | 18446744073709551616 | +| test.c:501:3:501:3 | y | 18446744073709551616 | +| test.c:502:3:502:4 | xy | 18446744073709551616 | +| test.c:502:8:502:8 | x | 274177 | +| test.c:502:12:502:12 | y | 67280421310721 | +| test.c:503:10:503:11 | xy | 18446744073709551616 | +| test.c:507:7:507:8 | ui | 4294967295 | +| test.c:508:43:508:44 | ui | 4294967295 | +| test.c:508:48:508:49 | ui | 4294967295 | +| test.c:509:12:509:17 | result | 18446744065119617024 | +| test.c:511:7:511:8 | ul | 18446744073709551616 | +| test.c:512:28:512:29 | ul | 18446744073709551616 | +| test.c:512:33:512:34 | ul | 18446744073709551616 | +| test.c:513:12:513:17 | result | 18446744073709551616 | +| test.c:519:7:519:8 | ui | 4294967295 | +| test.c:519:19:519:20 | ui | 10 | +| test.c:520:5:520:6 | ui | 10 | +| test.c:520:11:520:12 | ui | 10 | +| test.c:521:12:521:13 | ui | 100 | +| test.c:525:3:525:9 | uiconst | 10 | +| test.c:528:3:528:9 | ulconst | 10 | +| test.c:529:10:529:16 | uiconst | 40 | +| test.c:529:20:529:26 | ulconst | 40 | +| test.c:533:7:533:7 | i | 2147483647 | +| test.c:533:18:533:18 | i | 2147483647 | +| test.c:534:5:534:5 | i | 2147483647 | +| test.c:534:13:534:13 | i | 2 | +| test.c:535:9:535:9 | i | 10 | +| test.c:537:5:537:5 | i | 2147483647 | +| test.c:537:9:537:9 | i | 10 | +| test.c:538:9:538:9 | i | 15 | +| test.c:540:5:540:5 | i | 15 | +| test.c:541:9:541:9 | i | 105 | +| test.c:543:5:543:5 | i | 105 | +| test.c:544:9:544:9 | i | 2310 | +| test.c:546:7:546:7 | i | 2147483647 | +| test.c:547:5:547:5 | i | 2147483647 | +| test.c:547:9:547:9 | i | -1 | +| test.c:548:9:548:9 | i | 1 | +| test.c:550:3:550:3 | i | 2147483647 | +| test.c:550:7:550:7 | i | 2147483647 | +| test.c:551:10:551:10 | i | 2147483647 | +| test.c:554:3:554:3 | i | 2147483647 | +| test.c:554:10:554:11 | sc | 1 | +| test.c:556:7:556:7 | i | 127 | +| test.c:563:7:563:7 | n | 4294967295 | +| test.c:565:7:565:7 | n | 4294967295 | +| test.c:566:9:566:9 | n | 4294967295 | +| test.c:569:7:569:7 | n | 4294967295 | +| test.c:570:9:570:9 | n | 4294967295 | +| test.c:572:9:572:9 | n | 0 | +| test.c:575:8:575:8 | n | 4294967295 | +| test.c:576:9:576:9 | n | 0 | +| test.c:578:9:578:9 | n | 4294967295 | +| test.c:581:10:581:10 | n | 4294967295 | +| test.c:582:5:582:5 | n | 4294967295 | +| test.c:585:7:585:7 | n | 0 | +| test.c:589:7:589:7 | n | 32767 | +| test.c:592:7:592:7 | n | 32767 | +| test.c:593:9:593:9 | n | 0 | +| test.c:595:9:595:9 | n | 32767 | +| test.c:598:7:598:7 | n | 32767 | +| test.c:599:9:599:9 | n | 32767 | +| test.c:601:9:601:9 | n | 0 | +| test.c:604:10:604:10 | n | 32767 | +| test.c:605:5:605:5 | n | 32767 | +| test.c:608:7:608:7 | n | 0 | +| test.c:612:7:612:7 | n | 32767 | +| test.c:613:9:613:9 | n | 32767 | +| test.c:614:11:614:11 | n | 32767 | +| test.c:618:7:618:7 | n | 32767 | +| test.c:619:13:619:13 | n | 32767 | +| test.c:622:9:622:9 | n | 32767 | +| test.c:625:7:625:7 | n | 32767 | +| test.c:625:22:625:22 | n | 32767 | +| test.c:626:9:626:9 | n | 32767 | +| test.c:629:7:629:7 | n | 32767 | +| test.c:630:5:630:5 | n | 32767 | +| test.c:630:10:630:10 | n | 32767 | +| test.c:630:14:630:14 | n | 0 | +| test.c:631:6:631:6 | n | 32767 | +| test.c:631:10:631:10 | n | 0 | +| test.c:631:14:631:14 | n | 32767 | +| test.c:642:7:642:8 | ss | 32767 | +| test.c:643:9:643:10 | ss | 3 | +| test.c:646:7:646:8 | ss | 32767 | +| test.c:647:9:647:10 | ss | 32767 | +| test.c:650:14:650:15 | us | 65535 | +| test.c:651:9:651:10 | us | 32767 | +| test.c:654:14:654:15 | us | 65535 | +| test.c:655:9:655:10 | us | 65535 | +| test.c:658:7:658:8 | ss | 32767 | +| test.c:659:9:659:10 | ss | 32767 | +| test.c:662:7:662:8 | ss | 32767 | +| test.c:663:9:663:10 | ss | 2 | +| test.c:669:8:669:8 | s | 2147483647 | +| test.c:669:15:669:15 | s | 127 | +| test.c:669:23:669:23 | s | 9 | +| test.c:670:18:670:18 | s | 9 | +| test.c:670:22:670:22 | s | 9 | +| test.c:671:9:671:14 | result | 127 | +| test.c:677:7:677:7 | i | 0 | +| test.c:678:9:678:9 | i | 2147483647 | +| test.c:682:7:682:7 | u | 0 | +| test.c:683:9:683:9 | u | 4294967295 | +| test.c:688:12:688:12 | s | 2147483647 | +| test.c:689:7:689:8 | s2 | 4 | +| test.c:694:7:694:7 | x | 2147483647 | +| test.c:695:9:695:9 | y | 2147483647 | +| test.c:699:7:699:7 | y | 2147483647 | +| test.c:708:7:708:7 | x | 2147483647 | +| test.c:713:7:713:7 | x | 15 | +| test.c:720:8:720:8 | x | 2147483647 | +| test.c:720:12:720:12 | y | 256 | +| test.c:721:9:721:9 | x | 2147483647 | +| test.c:722:9:722:9 | y | 256 | | test.cpp:10:7:10:7 | b | 2147483647 | | test.cpp:11:5:11:5 | x | 2147483647 | | test.cpp:13:10:13:10 | x | 2147483647 |