Index: test/cctest/compiler/test-representation-change.cc |
diff --git a/test/cctest/compiler/test-representation-change.cc b/test/cctest/compiler/test-representation-change.cc |
index 9c55a802c2c924961b3b034e4f21e4a3ad4d658d..6c9026b2e018ee7147b684239fbd3fc516249902 100644 |
--- a/test/cctest/compiler/test-representation-change.cc |
+++ b/test/cctest/compiler/test-representation-change.cc |
@@ -88,6 +88,7 @@ class RepresentationChangerTester : public HandleAndZoneScope, |
} // namespace v8::internal::compiler |
+// TODO(titzer): add kRepFloat32 when fully supported. |
static const MachineType all_reps[] = {kRepBit, kRepWord32, kRepWord64, |
kRepFloat64, kRepTagged}; |
@@ -225,6 +226,11 @@ TEST(Nops) { |
r.CheckNop(all_reps[i], all_reps[i]); |
} |
+ // 32-bit floats. |
+ r.CheckNop(kRepFloat32, kRepFloat32); |
+ r.CheckNop(kRepFloat32 | kTypeNumber, kRepFloat32); |
+ r.CheckNop(kRepFloat32, kRepFloat32 | kTypeNumber); |
+ |
// 32-bit or 64-bit words can be used as branch conditions (kRepBit). |
r.CheckNop(kRepWord32, kRepBit); |
r.CheckNop(kRepWord32, kRepBit | kTypeBool); |
@@ -261,6 +267,12 @@ TEST(TypeErrors) { |
r.CheckTypeError(kRepBit, kRepFloat64); |
r.CheckTypeError(kRepBit | kTypeBool, kRepFloat64); |
+ // Floats cannot be implicitly converted to/from comparison conditions. |
+ r.CheckTypeError(kRepFloat32, kRepBit); |
+ r.CheckTypeError(kRepFloat32, kRepBit | kTypeBool); |
+ r.CheckTypeError(kRepBit, kRepFloat32); |
+ r.CheckTypeError(kRepBit | kTypeBool, kRepFloat32); |
+ |
// Word64 is internal and shouldn't be implicitly converted. |
r.CheckTypeError(kRepWord64, kRepTagged | kTypeBool); |
r.CheckTypeError(kRepWord64, kRepTagged); |
@@ -283,24 +295,11 @@ TEST(TypeErrors) { |
r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); |
} |
} |
-} |
- |
-TEST(CompleteMatrix) { |
- // TODO(titzer): test all variants in the matrix. |
- // rB |
- // tBrB |
- // tBrT |
- // rW32 |
- // tIrW32 |
- // tUrW32 |
- // rW64 |
- // tIrW64 |
- // tUrW64 |
- // rF64 |
- // tIrF64 |
- // tUrF64 |
- // tArF64 |
- // rT |
- // tArT |
+ // TODO(titzer): Float32 representation changes trigger type errors now. |
+ // Enforce current behavior to test all paths through representation changer. |
+ for (size_t i = 0; i < arraysize(all_reps); i++) { |
+ r.CheckTypeError(all_reps[i], kRepFloat32); |
+ r.CheckTypeError(kRepFloat32, all_reps[i]); |
+ } |
} |