aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-12-18 10:24:22 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2014-12-18 12:12:31 +0100
commit7ee29f69918ef11b83f7ee6acc1fa9c508c9f4a3 (patch)
tree6208affc4abb174cd353fb69bc540f111bf5212c /tests
parent87ac0d66abbe235e353fbe10dc864ebdc9904d41 (diff)
V4: only optimize out to-int32 conversions when the operands are int32.
The operands of bit-ops are not typed as int32 when no type-inference is done, like for the interpreter. Task-number: QTBUG-43309 Change-Id: I67af18e14ddbc0649530ac23601332ee7d7a1f34 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index c43bd29614..b1ec4b709c 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -173,6 +173,8 @@ private slots:
void privateMethods();
+ void intConversion_QTBUG43309();
+
signals:
void testSignal();
};
@@ -3601,6 +3603,16 @@ void tst_QJSEngine::privateMethods()
}
}
+void tst_QJSEngine::intConversion_QTBUG43309()
+{
+ // This failed in the interpreter:
+ QJSEngine engine;
+ QString jsCode = "var n = 0.1; var m = (n*255) | 0; m";
+ QJSValue result = engine.evaluate( jsCode );
+// QVERIFY(result.isNumber());
+// QCOMPARE(result.toNumber(), 25.0);
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"