Skip to content

Commit

Permalink
[clang][dataflow] Use IntegerValue instead of StructValue in `Val…
Browse files Browse the repository at this point in the history
…ueTest`.

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.

Reviewed By: xazax.hun, gribozavr2

Differential Revision: https://reviews.llvm.org/D154934
  • Loading branch information
martinboehme committed Jul 12, 2023
1 parent 5b6b2ca commit 0014aab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clang/unittests/Analysis/FlowSensitive/ValueTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ using namespace clang;
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);
Expand Down

0 comments on commit 0014aab

Please sign in to comment.