}
}
+#if !V8_HOST_ARCH_64_BIT
// Helper function used by the CHECK_EQ function when given int64_t
// arguments. Should not be called directly.
static inline void CheckEqualsHelper(const char* file, int line,
uint32_t(value >> 32), uint32_t(value));
}
}
+#endif
// Helper function used by the CHECK_NE function when given int
}
+#if V8_HOST_ARCH_64_BIT
+# define CAST_TO_INT64(x) (int(x))
+#else
+# define CAST_TO_INT64(x) (int64_t(x))
+#endif
+
THREADED_TEST(TinyInteger) {
v8::HandleScope scope;
LocalContext env;
int32_t value = 239;
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}
CHECK(i::Smi::IsValid(value));
CHECK(!i::Smi::IsValid(value + 1));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}
int32_t value = (1 << 30) + 1;
CHECK(!i::Smi::IsValid(value));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}
LocalContext env;
uint32_t value = 239;
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}
CHECK(i::Smi::IsValid(value));
CHECK(!i::Smi::IsValid(value + 1));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}
uint32_t value = (1 << 30) + 1;
CHECK(!i::Smi::IsValid(value));
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}
LocalContext env;
uint32_t value = uint32_t(0xffffffff);
Local<v8::Integer> value_obj = v8::Integer::New(value);
- CHECK_EQ(int64_t(value), value_obj->Value());
+ CHECK_EQ(CAST_TO_INT64(value), value_obj->Value());
}