aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-06-30 10:33:26 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-07-05 19:50:15 +0200
commit5e4a1738b05f6f188eada38f1805018bdccc1c96 (patch)
tree812623e95929ef77a477d0680ce1dbbd062bb105 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parentcd383f8406746a99f3cd7b51d2ef3dfdb9a0dd9f (diff)
QmlCompiler: Fix register propagation in basic blocks pass
a, We were recording too many jump origins and targets. That messed up the basic blocks ordering logic. b, In the presence of backward jumps, we need to revisit earlier basic blocks if additional writes are discovered. Otherwise the type adjustment will optimize "dead" type conversions out. Pick-to: 6.4 Fixes: QTBUG-104665 Change-Id: I7219f85625761817ae4f63582d80d247a85df73b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 3c5cb9f792..60ed501364 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -127,6 +127,7 @@ private slots:
void stringArg();
void conversionDecrement();
void unstoredUndefined();
+ void registerPropagation();
};
void tst_QmlCppCodegen::simpleBinding()
@@ -2318,6 +2319,18 @@ void tst_QmlCppCodegen::unstoredUndefined()
QCOMPARE(o->objectName(), u"NaN"_s);
}
+void tst_QmlCppCodegen::registerPropagation()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/registerPropagation.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+
+ int result = 0;
+ QMetaObject::invokeMethod(o.data(), "test", Q_RETURN_ARG(int, result));
+ QCOMPARE(result, 1);
+}
+
void tst_QmlCppCodegen::runInterpreted()
{
#ifdef Q_OS_ANDROID