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>
This commit is contained in:
parent
d5c605b148
commit
9e835fe5a4
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user