summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-02-27 01:31:56 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-02-27 01:31:56 +0000
commit06b7bd61f4986b18766977530417bf489f8d5578 (patch)
tree0cff6b7ce87bea563c1ba7dfdead9993ed8c6425 /clang/test
parent31254d4366359717fc56350a3043309ac1db55dd (diff)
downloadbcm5719-llvm-06b7bd61f4986b18766977530417bf489f8d5578.tar.gz
bcm5719-llvm-06b7bd61f4986b18766977530417bf489f8d5578.zip
[analyzer] Switch the default exploration strategy to priority queue based on coverage
After the investigation it seems safe to flip the switch. Differential Revision: https://reviews.llvm.org/D43782 llvm-svn: 326157
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/MisusedMovedObject.cpp2
-rw-r--r--clang/test/Analysis/analyzer-config.c4
-rw-r--r--clang/test/Analysis/analyzer-config.cpp4
-rw-r--r--clang/test/Analysis/loop-unrolling.cpp5
4 files changed, 10 insertions, 5 deletions
diff --git a/clang/test/Analysis/MisusedMovedObject.cpp b/clang/test/Analysis/MisusedMovedObject.cpp
index 132a65de104..c566d42eb4c 100644
--- a/clang/test/Analysis/MisusedMovedObject.cpp
+++ b/clang/test/Analysis/MisusedMovedObject.cpp
@@ -474,7 +474,7 @@ void differentBranchesTest(int i) {
// A variation on the theme above.
{
A a;
- a.foo() > 0 ? a.foo() : A(std::move(a)).foo(); // expected-note {{Assuming the condition is false}} expected-note {{'?' condition is false}}
+ a.foo() > 0 ? a.foo() : A(std::move(a)).foo(); // expected-note {{Assuming the condition is true}} expected-note {{'?' condition is true}}
}
// Same thing, but with a switch statement.
{
diff --git a/clang/test/Analysis/analyzer-config.c b/clang/test/Analysis/analyzer-config.c
index 78868a56255..13c4870ac39 100644
--- a/clang/test/Analysis/analyzer-config.c
+++ b/clang/test/Analysis/analyzer-config.c
@@ -1,5 +1,5 @@
// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 %s -o /dev/null -analyzer-checker=core,osx.cocoa,debug.ConfigDumper -analyzer-max-loop 34 > %t 2>&1
-// RUN: FileCheck --input-file=%t %s
+// RUN: FileCheck --input-file=%t %s --match-full-lines
void bar() {}
void foo() {
@@ -17,7 +17,7 @@ void foo() {
// CHECK-NEXT: cfg-loopexit = false
// CHECK-NEXT: cfg-rich-constructors = true
// CHECK-NEXT: cfg-temporary-dtors = false
-// CHECK-NEXT: exploration_strategy = dfs
+// CHECK-NEXT: exploration_strategy = unexplored_first_queue
// CHECK-NEXT: faux-bodies = true
// CHECK-NEXT: graph-trim-interval = 1000
// CHECK-NEXT: inline-lambdas = true
diff --git a/clang/test/Analysis/analyzer-config.cpp b/clang/test/Analysis/analyzer-config.cpp
index 9b949744efd..46336ffc667 100644
--- a/clang/test/Analysis/analyzer-config.cpp
+++ b/clang/test/Analysis/analyzer-config.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 %s -o /dev/null -analyzer-checker=core,osx.cocoa,debug.ConfigDumper -analyzer-max-loop 34 > %t 2>&1
-// RUN: FileCheck --input-file=%t %s
+// RUN: FileCheck --input-file=%t %s --match-full-lines
void bar() {}
void foo() {
@@ -30,7 +30,7 @@ public:
// CHECK-NEXT: cfg-loopexit = false
// CHECK-NEXT: cfg-rich-constructors = true
// CHECK-NEXT: cfg-temporary-dtors = false
-// CHECK-NEXT: exploration_strategy = dfs
+// CHECK-NEXT: exploration_strategy = unexplored_first_queue
// CHECK-NEXT: faux-bodies = true
// CHECK-NEXT: graph-trim-interval = 1000
// CHECK-NEXT: inline-lambdas = true
diff --git a/clang/test/Analysis/loop-unrolling.cpp b/clang/test/Analysis/loop-unrolling.cpp
index 844d1f18ea5..cd5e9ef8278 100644
--- a/clang/test/Analysis/loop-unrolling.cpp
+++ b/clang/test/Analysis/loop-unrolling.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config unroll-loops=true,cfg-loopexit=true -verify -std=c++11 %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config unroll-loops=true,cfg-loopexit=true,exploration_strategy=dfs -verify -std=c++11 -DDFS=1 %s
void clang_analyzer_numTimesReached();
void clang_analyzer_warnIfReached();
@@ -234,7 +235,11 @@ int simple_known_bound_loop() {
int simple_unknown_bound_loop() {
for (int i = 2; i < getNum(); i++) {
+#ifdef DFS
clang_analyzer_numTimesReached(); // expected-warning {{10}}
+#else
+ clang_analyzer_numTimesReached(); // expected-warning {{13}}
+#endif
}
return 0;
}
OpenPOWER on IntegriCloud