diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 85b462fc..1c6f2308 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -385,9 +385,16 @@ void testBitwiseRules(unsigned int a, int b) { clang_analyzer_eval((b | -2) >= 0); // expected-warning{{FALSE}} } ' > foo.c -if dpkg -l|grep -q libz3-dev; then - # Should work + +clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log +if ! grep -q "fatal error: error in backend: LLVM was not compiled with Z3 support, rebuild with -DLLVM_ENABLE_Z3_SOLVER=ON" foo.log; then + # Should work clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false -analyzer-constraints=z3 foo.c + clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log + if ! grep -q "2 warnings generated." foo.log; then + echo "Should find 2 warnings" + exit 1 + fi else echo "z3 support not available" fi @@ -399,16 +406,6 @@ if grep -q "File a.c Line 7: UNKNOWN" foo.log; then exit 1 fi -if dpkg -l|grep -q libz3-dev; then - clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log - if ! grep -q "2 warnings generated." foo.log; then - echo "Should find 2 warnings" - exit 1 - fi -else - echo "z3 support not available" -fi - clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection foo.c &> foo.log if ! grep -q "warnings generated." foo.log; then echo "Should find at least 2 warnings"