Avoid potential negative array index access to cached text.
[LibreOffice.git] / tools / qa / cppunit / test_cpu_runtime_detection_AVX2.cxx
blob5ba8ed9ee2fb59075b9c29b73031e542d8ff576e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "test_cpu_runtime_detection_x86_checks.hxx"
12 #include <cppunit/TestFixture.h>
13 #include <cppunit/extensions/HelperMacros.h>
15 #include <tools/cpuid.hxx>
17 namespace
19 class CpuRuntimeDetection_AVX2 : public CppUnit::TestFixture
21 public:
22 void testCpuRuntimeDetection();
24 CPPUNIT_TEST_SUITE(CpuRuntimeDetection_AVX2);
25 CPPUNIT_TEST(testCpuRuntimeDetection);
26 CPPUNIT_TEST_SUITE_END();
29 void CpuRuntimeDetection_AVX2::testCpuRuntimeDetection()
31 // can only run this function if CPU supports AVX2
32 if (cpuid::isCpuInstructionSetSupported(cpuid::InstructionSetFlags::AVX2))
33 CpuRuntimeDetectionX86Checks::checkAVX2();
36 CPPUNIT_TEST_SUITE_REGISTRATION(CpuRuntimeDetection_AVX2);
38 } // end anonymous namespace
40 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */