@@ -45,7 +45,20 @@ TEST(ValueTest, TopsEquivalent) {
45
45
EXPECT_TRUE (areEquivalentValues (V2, V1));
46
46
}
47
47
48
- TEST (ValueTest, EquivalentValuesWithDifferentPropsEquivalent) {
48
+ // The framework does not (currently) consider equivalence for values with
49
+ // properties, leaving such to individual analyses.
50
+ TEST (ValueTest, ValuesWithSamePropsDifferent) {
51
+ Arena A;
52
+ TopBoolValue Prop (A.makeAtomRef (Atom (0 )));
53
+ TopBoolValue V1 (A.makeAtomRef (Atom (2 )));
54
+ TopBoolValue V2 (A.makeAtomRef (Atom (3 )));
55
+ V1.setProperty (" foo" , Prop);
56
+ V2.setProperty (" foo" , Prop);
57
+ EXPECT_FALSE (areEquivalentValues (V1, V2));
58
+ EXPECT_FALSE (areEquivalentValues (V2, V1));
59
+ }
60
+
61
+ TEST (ValueTest, ValuesWithDifferentPropsDifferent) {
49
62
Arena A;
50
63
TopBoolValue Prop1 (A.makeAtomRef (Atom (0 )));
51
64
TopBoolValue Prop2 (A.makeAtomRef (Atom (1 )));
@@ -57,6 +70,17 @@ TEST(ValueTest, EquivalentValuesWithDifferentPropsEquivalent) {
57
70
EXPECT_FALSE (areEquivalentValues (V2, V1));
58
71
}
59
72
73
+ TEST (ValueTest, ValuesWithDifferentNumberPropsDifferent) {
74
+ Arena A;
75
+ TopBoolValue Prop (A.makeAtomRef (Atom (0 )));
76
+ TopBoolValue V1 (A.makeAtomRef (Atom (2 )));
77
+ TopBoolValue V2 (A.makeAtomRef (Atom (3 )));
78
+ // Only set a property on `V1`.
79
+ V1.setProperty (" foo" , Prop);
80
+ EXPECT_FALSE (areEquivalentValues (V1, V2));
81
+ EXPECT_FALSE (areEquivalentValues (V2, V1));
82
+ }
83
+
60
84
TEST (ValueTest, DifferentKindsNotEquivalent) {
61
85
Arena A;
62
86
auto L = ScalarStorageLocation (QualType ());
0 commit comments