diff options
author | Dominic Chen <d.c.ddcc@gmail.com> | 2017-03-02 23:30:53 +0000 |
---|---|---|
committer | Dominic Chen <d.c.ddcc@gmail.com> | 2017-03-02 23:30:53 +0000 |
commit | 09d66f7528fcdd16178120c107f71aaaea6b79e1 (patch) | |
tree | c1a558348be60f7f1d8bb9416d61ed5fe5f2544e /clang/test/Analysis/ptr-arith.c | |
parent | ae85a922d5159966af7ac53cc5c8b712749a4a86 (diff) | |
download | bcm5719-llvm-09d66f7528fcdd16178120c107f71aaaea6b79e1.tar.gz bcm5719-llvm-09d66f7528fcdd16178120c107f71aaaea6b79e1.zip |
Revert "Reland 3: [analyzer] NFC: Update test infrastructure to support multiple constraint managers"
This reverts commit ea36f1406e1f36bf456c3f3929839b024128e468.
llvm-svn: 296841
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) { |