brintos

brintos / llvm-project-archived public Read only

0
0
Text · 651 B · 8a58b79 Raw
21 lines · cpp
1// RUN: %clang_analyze_cc1 %s \2// RUN:   -analyzer-checker=core \3// RUN:   -analyzer-checker=debug.ExprInspection \4// RUN:   -analyzer-config eagerly-assume=false \5// RUN:   -verify6 7// Here we test whether the SValBuilder is capable to simplify existing8// IntSym expressions based on a newly added constraint on the sub-expression.9 10void clang_analyzer_eval(bool);11 12void test_SValBuilder_simplifies_IntSym(int x, int y) {13  // Most IntSym BinOps are transformed to SymInt in SimpleSValBuilder.14  // Division is one exception.15  x = 77 / y;16  if (y != 1)17    return;18  clang_analyzer_eval(x == 77); // expected-warning{{TRUE}}19  (void)(x * y);20}21