summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-11-30 10:19:23 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2021-12-06 19:06:30 +0100
commit9e835fe5a4f8b266082869fc4c0b218c8eec75fd (patch)
treecd6d42552cd2007ef74344d3c23c7817e2a3cfd9 /tests/auto/testlib
parentd5c605b14896a444430414a7dc719397107cdc9d (diff)
tst_BenchlibCallgrind: fix x86 preprocessor check
Its twoHundredMillionInstructions() test has #if-ery to limit it to gcc and x86; however, it was testing only __i386 for the x86 part, where gcc defines __x86_64 instead on modern 64-bit systems. In the process, invert the condition and the branches it controls - positive tests are easier to comprehend. Change-Id: I8e906c606c48aa5034e02e3ed5d042fbb1f2ecbc Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp b/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
index bd3a27ec24..db3e4123fb 100644
--- a/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
+++ b/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -62,9 +62,7 @@ void tst_BenchlibCallgrind::failInChildProcess()
void tst_BenchlibCallgrind::twoHundredMillionInstructions()
{
-#if !defined(__GNUC__) || !defined(__i386)
- QSKIP("This test is only defined for gcc and x86.");
-#else
+#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
QBENCHMARK {
__asm__ __volatile__(
"mov $100000000,%%eax \n"
@@ -76,6 +74,8 @@ void tst_BenchlibCallgrind::twoHundredMillionInstructions()
: /* clobber */ "eax"
);
}
+#else
+ QSKIP("This test is only implemented for gcc on x86.");
#endif
}