Go to file
Edward Welbourne 23434f487b QMap benchmark: use unsigned accumulators and check them
The sum of the first 100000 naturals is more than 2^32, so using an
int accumulator to collect the values is susceptible to overflow,
which is UB for signed integral types. So switch to an unsigned type.
We don't care about the actual sum, only having the various map
entries we fetch "used".

Since unsigned arithmetic is well-defined even when it overflows, we
can calculate the expected sum and verify it, to ensure that no matter
how clever the optimizer, it won't throw out the accumulator as
written but not read (and then optimize out all the tested code).

As a drive-by, rename one of the accumulators to match the rest.

Change-Id: I93a2825247c96ca88fe52fdb7ce1e5456eebad54
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-07-23 17:19:12 +02:00
.github/workflows Github Actions: many minor updates 2021-01-22 18:48:54 +01:00
bin CMake: Allow usage of QtStandaloneTestTemplateProject as package component 2021-04-23 13:31:04 +02:00
cmake Fix generated pri and prl files 2021-07-17 02:42:13 +08:00
coin Make Integrity to use cross compile instructions 2021-07-15 18:56:23 +03:00
config.tests Fix the precompile_header configure test 2021-06-19 01:08:23 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Doc: Terminate C-comment 2021-06-30 13:36:26 +02:00
examples Rename QPermission namespace to QApplicationPermission 2021-07-15 01:57:41 +03:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Fix global header exclusion regex 2021-07-09 13:56:18 +02:00
mkspecs Fix location of qtattributionsscanner 2021-07-14 18:16:15 +02:00
qmake QDuplicateTracker: accept the number of elements to reserve as a ctor argument 2021-07-14 08:57:39 +02:00
src Remove special casing of HSL QColor comparison 2021-07-23 15:15:59 +00:00
tests QMap benchmark: use unsigned accumulators and check them 2021-07-23 17:19:12 +02:00
util locale_database: Use context manager interface to update source files 2021-07-20 16:51:51 +02:00
.cmake.conf Conan: Read status flag from .cmake.conf 2021-06-21 15:19:16 +03:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore .gitignore: Ignore __pycache__ directories 2021-07-07 19:05:25 +02:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.qmake.conf Bump version 2021-02-18 07:20:21 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt CMake: Fix global 'apk' target to actually build all apks 2021-06-08 22:37:50 +02:00
conanfile.py Conan: simplify Conan recipe 2021-06-21 15:19:16 +03:00
config_help.txt configure: Note that -linker works also with clang 2021-07-12 14:46:56 +02:00
configure Remove unsupported host-related configure options 2021-07-06 08:53:52 +02:00
configure.bat Remove superfluous variable assignments from configure.bat 2021-03-11 16:39:54 +01:00
configure.cmake Don't repeat conditions of use_*_linker features in QtFeature.cmake 2021-07-13 15:27:23 +02:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt 2018-04-16 11:02:14 +00:00
LICENSE.QT-LICENSE-AGREEMENT Update enterprise license agreement v4.2.1 2019-12-18 13:07:19 +02:00
qt_cmdline.cmake Remove unsupported host-related configure options 2021-07-06 08:53:52 +02:00
sync.profile Implement generating of a module cpp export header 2021-06-24 20:40:49 +02:00