-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[clang][test] Fix test issue under LLVM_REVERSE_ITERATION #167394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@llvm/pr-subscribers-clang Author: Paul Kirth (ilovepi) ChangesThe order of these items may not be the same if reverse iteration is Fixes #167057 Full diff: https://github.com/llvm/llvm-project/pull/167394.diff 1 Files Affected:
diff --git a/clang/test/Analysis/analyzeOneFunction.cpp b/clang/test/Analysis/analyzeOneFunction.cpp
index 3a362dfd9a08c..9b752e29320a4 100644
--- a/clang/test/Analysis/analyzeOneFunction.cpp
+++ b/clang/test/Analysis/analyzeOneFunction.cpp
@@ -5,9 +5,9 @@
// RUN: -analyze-function="c:@S@Window@F@overloaded#I#"
// RUN: %clang_extdef_map %s | FileCheck %s
-// CHECK: 27:c:@S@Window@F@overloaded#I#
-// CHECK-NEXT: 27:c:@S@Window@F@overloaded#C#
-// CHECK-NEXT: 27:c:@S@Window@F@overloaded#d#
+// CHECK-DAG: 27:c:@S@Window@F@overloaded#I#
+// CHECK-DAG: 27:c:@S@Window@F@overloaded#C#
+// CHECK-DAG: 27:c:@S@Window@F@overloaded#d#
void clang_analyzer_warnIfReached();
|
|
@llvm/pr-subscribers-clang-static-analyzer-1 Author: Paul Kirth (ilovepi) ChangesThe order of these items may not be the same if reverse iteration is Fixes #167057 Full diff: https://github.com/llvm/llvm-project/pull/167394.diff 1 Files Affected:
diff --git a/clang/test/Analysis/analyzeOneFunction.cpp b/clang/test/Analysis/analyzeOneFunction.cpp
index 3a362dfd9a08c..9b752e29320a4 100644
--- a/clang/test/Analysis/analyzeOneFunction.cpp
+++ b/clang/test/Analysis/analyzeOneFunction.cpp
@@ -5,9 +5,9 @@
// RUN: -analyze-function="c:@S@Window@F@overloaded#I#"
// RUN: %clang_extdef_map %s | FileCheck %s
-// CHECK: 27:c:@S@Window@F@overloaded#I#
-// CHECK-NEXT: 27:c:@S@Window@F@overloaded#C#
-// CHECK-NEXT: 27:c:@S@Window@F@overloaded#d#
+// CHECK-DAG: 27:c:@S@Window@F@overloaded#I#
+// CHECK-DAG: 27:c:@S@Window@F@overloaded#C#
+// CHECK-DAG: 27:c:@S@Window@F@overloaded#d#
void clang_analyzer_warnIfReached();
|
The order of these items may not be the same if reverse iteration is enabled. From what I can tell this is related to visitation order, and I don't see an easy way to handle that using the typical solutions, like MapVector, etc. For now, just use CHECK-DAG to get the test into a passing state. Fixes #167057
0942fb7 to
87dbc93
Compare
necto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix makes sense.
The order in which functions are analyzed does not matter for this test.
P.S. I was not aware of LLVM_REVERSE_ITERATION, seems like a great tool!
|
FYI, CSA analyzes entry points in a reverse topological order of the call graph. There is a minimal, but nonzero number of dependencies between entry points. One notable example is the inline limit. If a callee was inlined when analyzing |

The order of these items may not be the same if reverse iteration is
enabled. From what I can tell this is related to visitation order, and I
don't see an easy way to handle that using the typical solutions, like
MapVector, etc. For now, just use CHECK-DAG to get the test into a
passing state.
Fixes #167057