aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-12-19 11:48:49 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-12-20 09:44:16 +0100
commitdaab238846a80b83b0dabb50a4244a7eb29955f4 (patch)
tree517e676fa19c6b51ff099819a29edbac4c790f1d /tests/auto/qml/qmlcppcodegen/data
parentbac4723a30988c6b5b0430b8a394bbcf0b604db1 (diff)
QmlCompiler: Round towards 0 when coercing to 64bit integers
The regular int32 coercion doesn't apply here. We have our own logic for this case. Pick-to: 6.9 6.8 Task-number: QTBUG-132345 Change-Id: I96596567ce83fcaa714c8372171261e8dd876480 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/takenumber.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/takenumber.qml b/tests/auto/qml/qmlcppcodegen/data/takenumber.qml
index 8acb38dffe..ac1edfb193 100644
--- a/tests/auto/qml/qmlcppcodegen/data/takenumber.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/takenumber.qml
@@ -57,4 +57,31 @@ TakeNumber {
foo.takeNumbers({i:a, n:-a, s:a, l:a});
foo.propertyNumbers = {i:a, n:-a, s:a, l:a};
}
+
+ function literal3B() {
+ foo.takeInt(3000000000)
+ foo.propertyInt = 3000000000;
+ foo.takeNegativeInt(-3000000000)
+ foo.propertyNegativeInt = -3000000000;
+ foo.takeQSizeType(3000000000)
+ foo.propertyQSizeType = 3000000000;
+ foo.takeQLongLong(3000000000)
+ foo.propertyQLongLong = 3000000000;
+ foo.takeNumbers({i:3000000000, n:-3000000000, s:3000000000, l:3000000000});
+ foo.propertyNumbers = {i:3000000000, n:-3000000000, s:3000000000, l:3000000000};
+ }
+
+ function variable3B() {
+ var a = 3000000000
+ foo.takeInt(a)
+ foo.propertyInt = a;
+ foo.takeNegativeInt(-a)
+ foo.propertyNegativeInt = -a;
+ foo.takeQSizeType(a)
+ foo.propertyQSizeType = a;
+ foo.takeQLongLong(a)
+ foo.propertyQLongLong = a;
+ foo.takeNumbers({i:a, n:-a, s:a, l:a});
+ foo.propertyNumbers = {i:a, n:-a, s:a, l:a};
+ }
}