================
@@ -975,6 +994,35 @@ TEST_F(WideningTest,
DistinctValuesWithSamePropertiesAreEquivalent) {
});
}
+TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) {
+ std::string Code = R"(
+ void target(bool Cond) {
+ int *Foo;
+ int i = 0;
+ Foo = nullptr;
+ while (Cond) {
+ Foo = &i;
+ }
+ (void)0;
+ /*[[p]]*/
+ }
+ )";
+ runDataflow(
+ Code,
+ [](const llvm::StringMap<DataflowAnalysisState<NoopLattice>> &Results,
+ ASTContext &ASTCtx) {
+ ASSERT_THAT(Results.keys(), UnorderedElementsAre("p"));
----------------
martinboehme wrote:
We do this in a lot of existing tests, but it's unnecessary:
`getEnvironmentAtAnnotation()` itself asserts that the annotation exists.
```suggestion
```
https://github.com/llvm/llvm-project/pull/87233
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits