Skip to content

Commit a7d25d5

Browse files
committedJun 6, 2018
[Analyzer][Z3] Test fixes for Z3 constraint manager
Summary: Since Z3 tests have been not been running [1] some tests needed to be updated. I also added a regression test for [1]. [1] https://reviews.llvm.org/D47722 Reviewers: george.karpenkov, NoQ, ddcc Reviewed By: george.karpenkov Subscribers: mikhail.ramalho, dcoughlin, xazax.hun, szepet, zzheng, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D47726 llvm-svn: 334067
1 parent 80a764b commit a7d25d5

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed
 

‎clang/test/Analysis/PR24184.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// UNSUPPORTED: z3
12
// RUN: %clang_analyze_cc1 -w -analyzer-eagerly-assume -fcxx-exceptions -analyzer-checker=core -analyzer-checker=alpha.core.PointerArithm,alpha.core.CastToStruct -analyzer-max-loop 64 -verify %s
23
// RUN: %clang_analyze_cc1 -w -analyzer-checker=core -analyzer-checker=cplusplus -fcxx-exceptions -analyzer-checker alpha.core.PointerArithm,alpha.core.CastToStruct -analyzer-max-loop 63 -verify %s
34

‎clang/test/Analysis/constant-folding.c

+4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ void testBitwiseRules(unsigned int a, int b) {
108108
clang_analyzer_eval((b | -2) == 0); // expected-warning{{FALSE}}
109109
clang_analyzer_eval((b | 10) == 0); // expected-warning{{FALSE}}
110110
clang_analyzer_eval((b | 0) == 0); // expected-warning{{UNKNOWN}}
111+
#ifdef ANALYZER_CM_Z3
112+
clang_analyzer_eval((b | -2) >= 0); // expected-warning{{FALSE}}
113+
#else
111114
clang_analyzer_eval((b | -2) >= 0); // expected-warning{{UNKNOWN}}
115+
#endif
112116

113117
// Check that dynamically computed constants also work.
114118
int constant = 1 << 3;

‎clang/test/Analysis/loop-unrolling.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,11 @@ int nested_inlined_unroll1() {
368368
int nested_inlined_no_unroll1() {
369369
int k;
370370
for (int i = 0; i < 9; i++) {
371+
#ifdef ANALYZER_CM_Z3
372+
clang_analyzer_numTimesReached(); // expected-warning {{13}}
373+
#else
371374
clang_analyzer_numTimesReached(); // expected-warning {{15}}
375+
#endif
372376
k = simple_unknown_bound_loop(); // reevaluation without inlining, splits the state as well
373377
}
374378
int a = 22 / k; // no-warning

‎clang/test/Analysis/z3/enabled.c

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// REQUIRES: z3
2+
// RUN: echo %clang_analyze_cc1 | FileCheck %s
3+
// CHECK: -analyzer-constraints=z3

0 commit comments

Comments
 (0)