[PATCH] D154934: [clang][dataflow] Use `IntegerValue` instead of `StructValue` in `ValueTest`.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 11 02:25:36 PDT 2023


mboehme created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Soon, it will no longer be possible to default-construct `StructValue`.
For details, see https://discourse.llvm.org/t/70086.

For completeness, also add a test that `areEquivalentValues()` on different
`IntegerValue`s returns false.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154934

Files:
  clang/unittests/Analysis/FlowSensitive/ValueTest.cpp


Index: clang/unittests/Analysis/FlowSensitive/ValueTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/ValueTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/ValueTest.cpp
@@ -19,10 +19,16 @@
 using namespace dataflow;
 
 TEST(ValueTest, EquivalenceReflexive) {
-  StructValue V;
+  IntegerValue V;
   EXPECT_TRUE(areEquivalentValues(V, V));
 }
 
+TEST(ValueTest, DifferentIntegerValuesNotEquivalent) {
+  IntegerValue V1;
+  IntegerValue V2;
+  EXPECT_FALSE(areEquivalentValues(V1, V2));
+}
+
 TEST(ValueTest, AliasedReferencesEquivalent) {
   auto L = ScalarStorageLocation(QualType());
   ReferenceValue V1(L);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154934.538976.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230711/3b99104c/attachment.bin>


More information about the cfe-commits mailing list