diff options
Diffstat (limited to 'clang/test/Analysis/ptr-arith.c')
-rw-r--r-- | clang/test/Analysis/ptr-arith.c | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/clang/test/Analysis/ptr-arith.c b/clang/test/Analysis/ptr-arith.c index b78ec503a1c..2b15badf427 100644 --- a/clang/test/Analysis/ptr-arith.c +++ b/clang/test/Analysis/ptr-arith.c @@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-tautological-pointer-compare %s -// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple i686-apple-darwin9 -Wno-tautological-pointer-compare %s +// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple x86_64-apple-darwin9 -Wno-tautological-pointer-compare %s +// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.core.FixedAddr,alpha.core.PointerArithm,alpha.core.PointerSub,debug.ExprInspection -analyzer-store=region -verify -triple i686-apple-darwin9 -Wno-tautological-pointer-compare %s void clang_analyzer_eval(int); @@ -213,12 +213,7 @@ void comparisons_imply_size(int *lhs, int *rhs) { } clang_analyzer_eval(lhs <= rhs); // expected-warning{{TRUE}} -// FIXME: In Z3ConstraintManager, ptrdiff_t is mapped to signed bitvector. However, this does not directly imply the unsigned comparison. -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval((rhs - lhs) >= 0); // expected-warning{{UNKNOWN}} -#else clang_analyzer_eval((rhs - lhs) >= 0); // expected-warning{{TRUE}} -#endif clang_analyzer_eval((rhs - lhs) > 0); // expected-warning{{UNKNOWN}} if (lhs >= rhs) { @@ -228,11 +223,7 @@ void comparisons_imply_size(int *lhs, int *rhs) { clang_analyzer_eval(lhs == rhs); // expected-warning{{FALSE}} clang_analyzer_eval(lhs < rhs); // expected-warning{{TRUE}} -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval((rhs - lhs) > 0); // expected-warning{{UNKNOWN}} -#else clang_analyzer_eval((rhs - lhs) > 0); // expected-warning{{TRUE}} -#endif } void size_implies_comparison(int *lhs, int *rhs) { @@ -243,11 +234,7 @@ void size_implies_comparison(int *lhs, int *rhs) { return; } -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval(lhs <= rhs); // expected-warning{{UNKNOWN}} -#else clang_analyzer_eval(lhs <= rhs); // expected-warning{{TRUE}} -#endif clang_analyzer_eval((rhs - lhs) >= 0); // expected-warning{{TRUE}} clang_analyzer_eval((rhs - lhs) > 0); // expected-warning{{UNKNOWN}} @@ -257,11 +244,7 @@ void size_implies_comparison(int *lhs, int *rhs) { } clang_analyzer_eval(lhs == rhs); // expected-warning{{FALSE}} -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval(lhs < rhs); // expected-warning{{UNKNOWN}} -#else clang_analyzer_eval(lhs < rhs); // expected-warning{{TRUE}} -#endif clang_analyzer_eval((rhs - lhs) > 0); // expected-warning{{TRUE}} } @@ -272,42 +255,30 @@ void size_implies_comparison(int *lhs, int *rhs) { void zero_implies_reversed_equal(int *lhs, int *rhs) { clang_analyzer_eval((rhs - lhs) == 0); // expected-warning{{UNKNOWN}} if ((rhs - lhs) == 0) { -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval(rhs != lhs); // expected-warning{{FALSE}} - clang_analyzer_eval(rhs == lhs); // expected-warning{{TRUE}} -#else + // FIXME: Should be FALSE. clang_analyzer_eval(rhs != lhs); // expected-warning{{UNKNOWN}} + // FIXME: Should be TRUE. clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} -#endif return; } clang_analyzer_eval((rhs - lhs) == 0); // expected-warning{{FALSE}} -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval(rhs == lhs); // expected-warning{{FALSE}} - clang_analyzer_eval(rhs != lhs); // expected-warning{{TRUE}} -#else + // FIXME: Should be FALSE. clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} + // FIXME: Should be TRUE. clang_analyzer_eval(rhs != lhs); // expected-warning{{UNKNOWN}} -#endif } void canonical_equal(int *lhs, int *rhs) { clang_analyzer_eval(lhs == rhs); // expected-warning{{UNKNOWN}} if (lhs == rhs) { -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval(rhs == lhs); // expected-warning{{TRUE}} -#else + // FIXME: Should be TRUE. clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} -#endif return; } clang_analyzer_eval(lhs == rhs); // expected-warning{{FALSE}} -#ifdef ANALYZER_CM_Z3 - clang_analyzer_eval(rhs == lhs); // expected-warning{{FALSE}} -#else + // FIXME: Should be FALSE. clang_analyzer_eval(rhs == lhs); // expected-warning{{UNKNOWN}} -#endif } void compare_element_region_and_base(int *p) { |