summaryrefslogtreecommitdiffstats
path: root/config.tests
diff options
context:
space:
mode:
Diffstat (limited to 'config.tests')
-rw-r--r--config.tests/arch/CMakeLists.txt9
-rw-r--r--config.tests/arch/arch.cpp51
-rw-r--r--config.tests/arch/arch.pro2
-rw-r--r--config.tests/arch/arch_host.pro3
-rw-r--r--config.tests/arch/write_info.pri11
-rw-r--r--config.tests/atomicfptr/icc2016_mac.diff18
-rw-r--r--config.tests/atomicfptr/qnx66.txt3
-rw-r--r--config.tests/avx512/avx512.cpp111
-rw-r--r--config.tests/avx512/avx512.pro10
-rw-r--r--config.tests/binary_for_strip/CMakeLists.txt12
-rw-r--r--config.tests/binary_for_strip/lib1.cpp4
-rw-r--r--config.tests/cmake_zstd/check_zstd.cmake8
-rw-r--r--config.tests/no_direct_extern_access/CMakeLists.txt14
-rw-r--r--config.tests/no_direct_extern_access/lib.cpp11
-rw-r--r--config.tests/no_direct_extern_access/lib.h17
-rw-r--r--config.tests/no_direct_extern_access/main.cpp20
-rw-r--r--config.tests/no_direct_extern_access/other.cpp8
-rw-r--r--config.tests/precompile_header/CMakeLists.txt8
-rw-r--r--config.tests/precompile_header/header.h8
-rw-r--r--config.tests/precompile_header/main.cpp7
-rw-r--r--config.tests/separate_debug_info/CMakeLists.txt10
-rw-r--r--config.tests/separate_debug_info/separate_debug_info.pro7
-rw-r--r--config.tests/static_link_order/CMakeLists.txt25
-rw-r--r--config.tests/static_link_order/main.cpp8
-rw-r--r--config.tests/static_link_order/objlib.cpp8
-rw-r--r--config.tests/static_link_order/staticlib1.cpp8
-rw-r--r--config.tests/static_link_order/staticlib2.cpp5
-rw-r--r--config.tests/stl/stl.pro1
-rw-r--r--config.tests/stl/stltest.cpp149
-rw-r--r--config.tests/verifyspec/verifyspec.pro37
-rw-r--r--config.tests/x86_simd/CMakeLists.txt5
-rw-r--r--config.tests/x86_simd/main.cpp263
-rw-r--r--config.tests/x86_simd/x86_simd.pro11
-rw-r--r--config.tests/x86intrin/CMakeLists.txt12
-rw-r--r--config.tests/x86intrin/main.cpp48
35 files changed, 272 insertions, 660 deletions
diff --git a/config.tests/arch/CMakeLists.txt b/config.tests/arch/CMakeLists.txt
index c0873a984f..b2517039df 100644
--- a/config.tests/arch/CMakeLists.txt
+++ b/config.tests/arch/CMakeLists.txt
@@ -1,6 +1,13 @@
-cmake_minimum_required(VERSION 3.15.0)
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
project(arch LANGUAGES CXX)
add_executable(architecture_test)
set_property(TARGET architecture_test PROPERTY MACOSX_BUNDLE FALSE)
target_sources(architecture_test PRIVATE arch.cpp)
+
+if(EMSCRIPTEN)
+ target_compile_options(architecture_test PRIVATE -O2 -msimd128 -msse -msse2)
+endif()
diff --git a/config.tests/arch/arch.cpp b/config.tests/arch/arch.cpp
index 2ccfe127b5..44ec721432 100644
--- a/config.tests/arch/arch.cpp
+++ b/config.tests/arch/arch.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the FOO module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2016 Intel Corporation.
+// SPDX-License-Identifier: BSD-3-Clause
#define QGLOBAL_H
#include "../../src/corelib/global/archdetect.cpp"
@@ -177,7 +141,7 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
// Leading-Zero bit count, Intel Core 4th Generation ("Haswell")
" lzcnt"
#endif
-#ifdef __MMX__
+#if defined(__MMX__) && defined(__i386__)
// Multimedia Extensions, Pentium MMX, AMD K6-2
" mmx"
#endif
@@ -234,11 +198,11 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
// Shadow stack, Intel processor TBA
" shstk"
#endif
-#if defined(__SSE__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1) || defined(_M_X64)
+#if (defined(__SSE__) && defined(__i386__)) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1 && defined(_M_IX86))
// Streaming SIMD Extensions, Intel Pentium III, AMD Athlon
" sse"
#endif
-#if defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2) || defined(_M_X64)
+#if (defined(__SSE2__) && defined(__i386__)) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2 && defined(_M_IX86))
// SSE2, Intel Pentium-M, Intel Pentium 4, AMD Opteron and Athlon 64
" sse2"
#endif
@@ -284,6 +248,9 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
#ifdef __ARM_FEATURE_CRC32
" crc32"
#endif
+#ifdef __ARM_FEATURE_CRYPTO
+" crypto"
+#endif
// -- SPARC --
#ifdef __VIS__
diff --git a/config.tests/arch/arch.pro b/config.tests/arch/arch.pro
deleted file mode 100644
index c607898b71..0000000000
--- a/config.tests/arch/arch.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES = arch.cpp
-include(write_info.pri)
diff --git a/config.tests/arch/arch_host.pro b/config.tests/arch/arch_host.pro
deleted file mode 100644
index ea0d1fa572..0000000000
--- a/config.tests/arch/arch_host.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-option(host_build)
-SOURCES = arch.cpp
-include(write_info.pri)
diff --git a/config.tests/arch/write_info.pri b/config.tests/arch/write_info.pri
deleted file mode 100644
index 5b43ce1cd5..0000000000
--- a/config.tests/arch/write_info.pri
+++ /dev/null
@@ -1,11 +0,0 @@
-targetinfofile = $$basename(_PRO_FILE_)
-targetinfofile ~= s/pro$/target.txt/
-
-win32 {
- ext = .exe
-} else:wasm {
- ext = .wasm
-}
-
-content = $${file_prefix}$${TARGET}$${ext}
-write_file($$OUT_PWD/$$targetinfofile, content)
diff --git a/config.tests/atomicfptr/icc2016_mac.diff b/config.tests/atomicfptr/icc2016_mac.diff
deleted file mode 100644
index 5de3b6e19a..0000000000
--- a/config.tests/atomicfptr/icc2016_mac.diff
+++ /dev/null
@@ -1,18 +0,0 @@
-Patch for fixing std::atomic support for function pointers for the Intel
-Composer XE 2016 (compiler version 16.0).
-
-To apply:
- cd /opt/intel/compilers_and_libraries_2016/mac/include
- sudo patch -p1 < /path-to-this-file/icc2016_mac.diff
-
---- include/stdatomic.h.orig 2015-08-28 15:05:13.000000000 -0700
-+++ include/stdatomic.h 2015-08-28 15:19:25.000000000 -0700
-@@ -451,7 +451,7 @@
- }
- _STRONG_INLINE atomic() _DEFAULTED
- _STRONG_INLINE _CONSTEXPR atomic(T* _Ptr)
-- : atomic_address(_Ptr)
-+ : atomic_address((void*)_Ptr)
- {
- }
- _STRONG_INLINE T* operator+=(ptrdiff_t _V) volatile
diff --git a/config.tests/atomicfptr/qnx66.txt b/config.tests/atomicfptr/qnx66.txt
deleted file mode 100644
index b4ea9d65b5..0000000000
--- a/config.tests/atomicfptr/qnx66.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Patch is available from QNX. Please see
-
-http://www.qnx.com/download/feature.html?programid=27555
diff --git a/config.tests/avx512/avx512.cpp b/config.tests/avx512/avx512.cpp
deleted file mode 100644
index 4d47db8463..0000000000
--- a/config.tests/avx512/avx512.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the configuration of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <immintrin.h>
-
-#ifndef __AVX512F__
-# error "There doesn't seem to be AVX-512 support in this compiler"
-#endif
-#ifndef WANT_AVX512
-# error ".pro file must define WANT_AVX512 macro to the AVX-512 feature to be tested"
-#endif
-
-// The following checks if __AVXx__ is defined, where x is the value in
-// WANT_AVX512
-#define HAS2(x) __AVX512 ## x ## __
-#define HAS(x) HAS2(x)
-#if !HAS(WANT_AVX512)
-# error "Feature not supported"
-#endif
-
-int main(int, char**argv)
-{
- /* AVX512 Foundation */
- __m512i i;
- __m512d d;
- __m512 f;
- __mmask16 m = ~1;
- i = _mm512_maskz_loadu_epi32(0, argv);
- d = _mm512_loadu_pd((double *)argv + 64);
- f = _mm512_loadu_ps((float *)argv + 128);
-
- // some intrinsic that GCC forgot until GCC 8
- i = _mm512_maskz_set1_epi32(m, '?');
- _mm512_mask_cvtepi32_storeu_epi8(argv, m, i);
-
-#ifdef WANT_AVX512ER
- /* AVX512 Exponential and Reciprocal */
- f = _mm512_exp2a23_round_ps(f, 8);
-#endif
-#ifdef WANT_AVX512CD
- /* AVX512 Conflict Detection */
- i = _mm512_maskz_conflict_epi32(m, i);
-#endif
-#ifdef WANT_AVX512PF
- /* AVX512 Prefetch */
- _mm512_mask_prefetch_i64scatter_pd(argv, 0xf, i, 2, 2);
-#endif
-#ifdef WANT_AVX512DQ
- /* AVX512 Doubleword and Quadword support */
- m = _mm512_movepi32_mask(i);
-#endif
-#ifdef WANT_AVX512BW
- /* AVX512 Byte and Word support */
- i = _mm512_mask_loadu_epi8(i, m, argv - 8);
- _mm512_mask_cvtepi16_storeu_epi8(argv + 8, m, i);
-#endif
-#ifdef WANT_AVX512VL
- /* AVX512 Vector Length */
- __m256i i2 = _mm256_maskz_loadu_epi32(0, argv);
- _mm256_mask_storeu_epi32(argv + 1, m, i2);
-#endif
-#ifdef WANT_AVX512IFMA
- /* AVX512 Integer Fused Multiply-Add */
- i = _mm512_madd52lo_epu64(i, i, i);
-#endif
-#ifdef WANT_AVX512VBMI
- /* AVX512 Vector Byte Manipulation Instructions */
- i = _mm512_permutexvar_epi8(i, i);
-#endif
-
- _mm512_mask_storeu_epi64(argv, m, i);
- _mm512_mask_storeu_ps(argv + 64, m, f);
- _mm512_mask_storeu_pd(argv + 128, m, d);
- return 0;
-}
diff --git a/config.tests/avx512/avx512.pro b/config.tests/avx512/avx512.pro
deleted file mode 100644
index d295f6320c..0000000000
--- a/config.tests/avx512/avx512.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-SOURCES = avx512.cpp
-
-!defined(AVX512, "var"): error("You must set the AVX512 variable!")
-
-varname = QMAKE_CFLAGS_AVX512$$AVX512
-value = $$eval($$varname)
-!defined($$varname, "var"): error("This compiler does not support AVX512")
-
-QMAKE_CXXFLAGS += $$value
-DEFINES += WANT_AVX512=$$AVX512 WANT_AVX512$$AVX512
diff --git a/config.tests/binary_for_strip/CMakeLists.txt b/config.tests/binary_for_strip/CMakeLists.txt
new file mode 100644
index 0000000000..2395dfad47
--- /dev/null
+++ b/config.tests/binary_for_strip/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(proj LANGUAGES CXX)
+add_library(lib1 SHARED lib1.cpp)
+
+add_custom_target(print_lib_path ALL
+ COMMAND ${CMAKE_COMMAND} -E echo "###$<TARGET_FILE:lib1>###"
+ VERBATIM
+)
+add_dependencies(print_lib_path lib1)
diff --git a/config.tests/binary_for_strip/lib1.cpp b/config.tests/binary_for_strip/lib1.cpp
new file mode 100644
index 0000000000..d2b7847557
--- /dev/null
+++ b/config.tests/binary_for_strip/lib1.cpp
@@ -0,0 +1,4 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+int libfunc() { return 0; }
diff --git a/config.tests/cmake_zstd/check_zstd.cmake b/config.tests/cmake_zstd/check_zstd.cmake
new file mode 100644
index 0000000000..6ab5f15f29
--- /dev/null
+++ b/config.tests/cmake_zstd/check_zstd.cmake
@@ -0,0 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+file(ARCHIVE_CREATE
+ OUTPUT cmake_zstd.zstd
+ PATHS "${CMAKE_CURRENT_LIST_FILE}"
+ FORMAT raw
+ COMPRESSION Zstd)
diff --git a/config.tests/no_direct_extern_access/CMakeLists.txt b/config.tests/no_direct_extern_access/CMakeLists.txt
new file mode 100644
index 0000000000..b4b881f1dc
--- /dev/null
+++ b/config.tests/no_direct_extern_access/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.16)
+project(direct_extern_access LANGUAGES CXX)
+
+# this is the test found in https://sourceware.org/bugzilla/show_bug.cgi?id=29087
+# and https://sourceware.org/bugzilla/show_bug.cgi?id=29377
+
+add_library(no_extern_access_lib SHARED lib.cpp)
+add_executable(no_extern_access_main other.cpp main.cpp)
+
+target_compile_options(no_extern_access_lib PRIVATE "-Werror")
+target_compile_options(no_extern_access_lib PUBLIC "$<$<CXX_COMPILER_ID:GNU>:-mno-direct-extern-access>")
+target_compile_options(no_extern_access_lib PUBLIC "$<$<CXX_COMPILER_ID:Clang>:-fno-direct-access-external-data>")
+
+target_link_libraries(no_extern_access_main no_extern_access_lib)
diff --git a/config.tests/no_direct_extern_access/lib.cpp b/config.tests/no_direct_extern_access/lib.cpp
new file mode 100644
index 0000000000..cf3b18bb38
--- /dev/null
+++ b/config.tests/no_direct_extern_access/lib.cpp
@@ -0,0 +1,11 @@
+// Copyright (C) 2022 Intel Corporation.
+// SPDX-License-Identifier: MIT
+
+// This is the test found in https://sourceware.org/bugzilla/show_bug.cgi?id=29087
+
+#define BUILD
+#include "lib.h"
+
+void *S::ptr = nullptr;
+S::~S() { }
+void *S::f() { return ptr; }
diff --git a/config.tests/no_direct_extern_access/lib.h b/config.tests/no_direct_extern_access/lib.h
new file mode 100644
index 0000000000..1a9c3c5533
--- /dev/null
+++ b/config.tests/no_direct_extern_access/lib.h
@@ -0,0 +1,17 @@
+// Copyright (C) 2022 Intel Corporation.
+// SPDX-License-Identifier: MIT
+
+// This is the test found in https://sourceware.org/bugzilla/show_bug.cgi?id=29087
+
+#ifdef BUILD
+# define LIB_API __attribute__((visibility("protected")))
+#else
+# define LIB_API __attribute__((visibility("default")))
+#endif
+
+struct LIB_API S
+{
+ virtual ~S();
+ virtual void *f();
+ static void *ptr;
+};
diff --git a/config.tests/no_direct_extern_access/main.cpp b/config.tests/no_direct_extern_access/main.cpp
new file mode 100644
index 0000000000..541c8b4b33
--- /dev/null
+++ b/config.tests/no_direct_extern_access/main.cpp
@@ -0,0 +1,20 @@
+// Copyright (C) 2022 Intel Corporation.
+// SPDX-License-Identifier: MIT
+
+// This is combining the tests found in:
+// https://sourceware.org/bugzilla/show_bug.cgi?id=29087
+// https://sourceware.org/bugzilla/show_bug.cgi?id=29377
+
+#include "lib.h"
+
+extern void foo(); // other.cpp
+void (*get_foo())()
+{
+ return foo;
+}
+
+struct Local : S { };
+int main()
+{
+ Local l;
+}
diff --git a/config.tests/no_direct_extern_access/other.cpp b/config.tests/no_direct_extern_access/other.cpp
new file mode 100644
index 0000000000..ff12b10930
--- /dev/null
+++ b/config.tests/no_direct_extern_access/other.cpp
@@ -0,0 +1,8 @@
+// Copyright (C) 2022 Intel Corporation.
+// SPDX-License-Identifier: MIT
+
+// This is the test found in https://sourceware.org/bugzilla/show_bug.cgi?id=29377
+
+__attribute__((visibility("protected"))) void foo()
+{
+}
diff --git a/config.tests/precompile_header/CMakeLists.txt b/config.tests/precompile_header/CMakeLists.txt
new file mode 100644
index 0000000000..d64887594a
--- /dev/null
+++ b/config.tests/precompile_header/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(precompile_header LANGUAGES CXX)
+
+add_executable(precompile_header main.cpp)
+target_precompile_headers(precompile_header PRIVATE header.h)
diff --git a/config.tests/precompile_header/header.h b/config.tests/precompile_header/header.h
new file mode 100644
index 0000000000..0e35f8cb85
--- /dev/null
+++ b/config.tests/precompile_header/header.h
@@ -0,0 +1,8 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+#ifndef HEADER_H
+#define HEADER_H
+
+// Nothing to see here. We just want the HEADER_H define.
+
+#endif
diff --git a/config.tests/precompile_header/main.cpp b/config.tests/precompile_header/main.cpp
new file mode 100644
index 0000000000..3ea84a8dae
--- /dev/null
+++ b/config.tests/precompile_header/main.cpp
@@ -0,0 +1,7 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+#ifndef HEADER_H
+# error no go
+#endif
+
+int main() {}
diff --git a/config.tests/separate_debug_info/CMakeLists.txt b/config.tests/separate_debug_info/CMakeLists.txt
index 1b98c0dab0..1b38d23e25 100644
--- a/config.tests/separate_debug_info/CMakeLists.txt
+++ b/config.tests/separate_debug_info/CMakeLists.txt
@@ -1,11 +1,13 @@
-# special case skip regeneration
-cmake_minimum_required(VERSION 3.14.0)
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
project(objcopytest LANGUAGES CXX)
-include(CMakeFindBinUtils)
add_executable(objcopytest main.cpp)
add_custom_command(
TARGET objcopytest
POST_BUILD
COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $<TARGET_FILE:objcopytest> objcopytest.debug
COMMAND ${CMAKE_OBJCOPY} --strip-debug $<TARGET_FILE:objcopytest>
- COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=objcopytest.debug $<TARGET_FILE:objcopytest>)
+ COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=objcopytest.debug $<TARGET_FILE:objcopytest>
+ VERBATIM)
diff --git a/config.tests/separate_debug_info/separate_debug_info.pro b/config.tests/separate_debug_info/separate_debug_info.pro
deleted file mode 100644
index 577aa734d6..0000000000
--- a/config.tests/separate_debug_info/separate_debug_info.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TARGET = objcopytest
-SOURCES += main.cpp
-load(resolve_target)
-QMAKE_POST_LINK += \
- $$QMAKE_OBJCOPY --only-keep-debug $$QMAKE_RESOLVED_TARGET objcopytest.debug && \
- $$QMAKE_OBJCOPY --strip-debug $$QMAKE_RESOLVED_TARGET && \
- $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopytest.debug $$QMAKE_RESOLVED_TARGET
diff --git a/config.tests/static_link_order/CMakeLists.txt b/config.tests/static_link_order/CMakeLists.txt
new file mode 100644
index 0000000000..c174fb95db
--- /dev/null
+++ b/config.tests/static_link_order/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# The test represents the order-related issue that we have with the ld linker.
+#
+# CMake versions < 3.21.0 produce the following linker line:
+# <binary_name> main.cpp -o static_link_order_test libstaticLib.a objlib.cpp.o
+# Since 'static_link_order_test' doesn't have direct use of 'staticlib2.cpp.o' symbols
+# the translation unit is not linked. When we link objlib.cpp.o it cannot resolve symbols from
+# staticlib2.cpp.o.
+#
+# For now it's only applicable for ld-like linkers. 'lld' has no such issue.
+cmake_minimum_required(VERSION 3.16)
+
+project(static_link_order_test LANGUAGES CXX)
+
+add_library(objLib OBJECT objlib.cpp)
+add_library(staticLib STATIC staticlib1.cpp staticlib2.cpp)
+
+target_link_libraries(staticLib
+ INTERFACE objLib "$<TARGET_OBJECTS:objLib>"
+)
+
+add_executable(static_link_order_test main.cpp)
+target_link_libraries(static_link_order_test PRIVATE staticLib)
diff --git a/config.tests/static_link_order/main.cpp b/config.tests/static_link_order/main.cpp
new file mode 100644
index 0000000000..93b8825fd9
--- /dev/null
+++ b/config.tests/static_link_order/main.cpp
@@ -0,0 +1,8 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+void staticLibFunc1();
+
+int main() {
+ staticLibFunc1();
+}
diff --git a/config.tests/static_link_order/objlib.cpp b/config.tests/static_link_order/objlib.cpp
new file mode 100644
index 0000000000..0ad7b76a80
--- /dev/null
+++ b/config.tests/static_link_order/objlib.cpp
@@ -0,0 +1,8 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+void staticLibFunc2();
+
+void objLibFunc() {
+ staticLibFunc2();
+}
diff --git a/config.tests/static_link_order/staticlib1.cpp b/config.tests/static_link_order/staticlib1.cpp
new file mode 100644
index 0000000000..f120f9229b
--- /dev/null
+++ b/config.tests/static_link_order/staticlib1.cpp
@@ -0,0 +1,8 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+void objLibFunc();
+
+void staticLibFunc1() {
+ objLibFunc();
+}
diff --git a/config.tests/static_link_order/staticlib2.cpp b/config.tests/static_link_order/staticlib2.cpp
new file mode 100644
index 0000000000..a9abf424fe
--- /dev/null
+++ b/config.tests/static_link_order/staticlib2.cpp
@@ -0,0 +1,5 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+void staticLibFunc2() {
+}
diff --git a/config.tests/stl/stl.pro b/config.tests/stl/stl.pro
deleted file mode 100644
index 91f29a232c..0000000000
--- a/config.tests/stl/stl.pro
+++ /dev/null
@@ -1 +0,0 @@
-SOURCES = stltest.cpp
diff --git a/config.tests/stl/stltest.cpp b/config.tests/stl/stltest.cpp
deleted file mode 100644
index a7a36ba0d3..0000000000
--- a/config.tests/stl/stltest.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/* Sample program for configure to test STL support on target
-platforms. We are mainly concerned with being able to instantiate
-templates for common STL container classes.
-*/
-
-#include <iterator>
-#include <map>
-#include <vector>
-#include <algorithm>
-#include <iostream>
-#include <cstddef>
-
-// something mean to see if the compiler and C++ standard lib are good enough
-template<class K, class T>
-class DummyClass
-{
- // everything in std namespace ?
- typedef std::bidirectional_iterator_tag i;
- typedef std::ptrdiff_t d;
- // typename implemented ?
- typedef typename std::map<K,T>::iterator MyIterator;
-};
-
-// extracted from QVector's strict iterator
-template<class T>
-class DummyIterator
-{
- typedef DummyIterator<int> iterator;
-public:
- T *i;
- typedef std::random_access_iterator_tag iterator_category;
- typedef std::ptrdiff_t difference_type;
- typedef T value_type;
- typedef T *pointer;
- typedef T &reference;
-
- inline DummyIterator() : i(0) {}
- inline DummyIterator(T *n) : i(n) {}
- inline DummyIterator(const DummyIterator &o): i(o.i){}
- inline T &operator*() const { return *i; }
- inline T *operator->() const { return i; }
- inline T &operator[](int j) const { return *(i + j); }
- inline bool operator==(const DummyIterator &o) const { return i == o.i; }
- inline bool operator!=(const DummyIterator &o) const { return i != o.i; }
- inline bool operator<(const DummyIterator& other) const { return i < other.i; }
- inline bool operator<=(const DummyIterator& other) const { return i <= other.i; }
- inline bool operator>(const DummyIterator& other) const { return i > other.i; }
- inline bool operator>=(const DummyIterator& other) const { return i >= other.i; }
- inline DummyIterator &operator++() { ++i; return *this; }
- inline DummyIterator operator++(int) { T *n = i; ++i; return n; }
- inline DummyIterator &operator--() { i--; return *this; }
- inline DummyIterator operator--(int) { T *n = i; i--; return n; }
- inline DummyIterator &operator+=(int j) { i+=j; return *this; }
- inline DummyIterator &operator-=(int j) { i-=j; return *this; }
- inline DummyIterator operator+(int j) const { return DummyIterator(i+j); }
- inline DummyIterator operator-(int j) const { return DummyIterator(i-j); }
- inline int operator-(DummyIterator j) const { return i - j.i; }
-};
-
-int main()
-{
- std::vector<int> v1;
- v1.push_back( 0 );
- v1.push_back( 1 );
- v1.push_back( 2 );
- v1.push_back( 3 );
- v1.push_back( 4 );
- int v1size = v1.size();
- v1size = 0;
- int v1capacity = v1.capacity();
- v1capacity = 0;
-
- std::vector<int>::iterator v1it = std::find( v1.begin(), v1.end(), 99 );
- bool v1notfound = (v1it == v1.end());
- v1notfound = false;
-
- v1it = std::find( v1.begin(), v1.end(), 3 );
- bool v1found = (v1it != v1.end());
- v1found = false;
-
- std::vector<int> v2;
- std::copy( v1.begin(), v1it, std::back_inserter( v2 ) );
- int v2size = v2.size();
- v2size = 0;
-
- std::map<int, double> m1;
- m1.insert( std::make_pair( 1, 2.0 ) );
- m1.insert( std::make_pair( 3, 2.0 ) );
- m1.insert( std::make_pair( 5, 2.0 ) );
- m1.insert( std::make_pair( 7, 2.0 ) );
- int m1size = m1.size();
- m1size = 0;
- std::map<int,double>::iterator m1it = m1.begin();
- for ( ; m1it != m1.end(); ++m1it ) {
- int first = (*m1it).first;
- first = 0;
- double second = (*m1it).second;
- second = 0.0;
- }
- std::map< int, double > m2( m1 );
- int m2size = m2.size();
- m2size = 0;
-
- DummyIterator<int> it1, it2;
- int n = std::distance(it1, it2);
- std::advance(it1, 3);
-
- return 0;
-}
-
diff --git a/config.tests/verifyspec/verifyspec.pro b/config.tests/verifyspec/verifyspec.pro
deleted file mode 100644
index 11a280e4ce..0000000000
--- a/config.tests/verifyspec/verifyspec.pro
+++ /dev/null
@@ -1,37 +0,0 @@
-SOURCES = verifyspec.cpp
-
-# Provide a function to be used by mkspecs
-defineTest(deviceSanityCheckCompiler) {
- equals(QMAKE_HOST.os, Windows): \
- sfx = .exe
- else: \
- sfx =
-
- # Build the compiler filename using the first value in QMAKE_CXX in order to
- # support tools like ccache, which give QMAKE_CXX values of the form:
- # ccache <path_to_compiler>
- compiler = $$first(QMAKE_CXX)$$sfx
-
- # Check if the binary exists with an absolute path. Do this check
- # before the CROSS_COMPILE empty check below to allow the mkspec
- # to derive the compiler path from other device options.
- exists($$compiler): return()
-
- # Check for possible reasons of failure
- # check if CROSS_COMPILE device-option is set
- isEmpty(CROSS_COMPILE): \
- error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>")
-
- # Check if QMAKE_CXX points to an executable.
- ensurePathEnv()
- for (dir, QMAKE_PATH_ENV) {
- exists($$dir/$${compiler}): \
- return()
- }
-
- # QMAKE_CXX does not point to a compiler.
- error("Compiler $$QMAKE_CXX not found. Check the value of CROSS_COMPILE -device-option")
-}
-
-defined(qtConfSanitizeMkspec, test): \
- qtConfSanitizeMkspec()
diff --git a/config.tests/x86_simd/CMakeLists.txt b/config.tests/x86_simd/CMakeLists.txt
index b624b7bc95..48878d196a 100644
--- a/config.tests/x86_simd/CMakeLists.txt
+++ b/config.tests/x86_simd/CMakeLists.txt
@@ -1,4 +1,7 @@
-cmake_minimum_required(VERSION 3.14.0)
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
project(x86_simd LANGUAGES CXX)
include(../../cmake/QtPlatformSupport.cmake)
diff --git a/config.tests/x86_simd/main.cpp b/config.tests/x86_simd/main.cpp
index 0e7ebed8d9..8634e29cf2 100644
--- a/config.tests/x86_simd/main.cpp
+++ b/config.tests/x86_simd/main.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Intel Corporation.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Intel Corporation.
+// SPDX-License-Identifier: BSD-3-Clause
// All of our supported compilers support <immintrin.h>
#include <immintrin.h>
@@ -48,222 +12,23 @@
# define attribute_target(x)
#endif
-#if T(SSE2)
-attribute_target("sse2") void test_sse2()
+#if T(AVX512VBMI2)
+attribute_target("avx512vl,avx512vbmi2") void test_avx512vbmi2()
{
- __m128i a = _mm_setzero_si128();
- _mm_maskmoveu_si128(a, _mm_setzero_si128(), 0);
+ /* AVX512 Vector Byte Manipulation Instructions 2 */
+ __m128i a = _mm_maskz_compress_epi16(-1, _mm_set1_epi16(1));
+ __m128i b = _mm_shrdi_epi32(a, a, 7);
}
#endif
-#if T(SSE3)
-attribute_target("sse3") void test_sse3()
+#if T(VAES)
+// VAES does not require AVX512 and works on Alder Lake
+attribute_target("avx2,vaes") void test_vaes()
{
- __m128d a = _mm_set1_pd(6.28);
- __m128d b = _mm_set1_pd(3.14);
- __m128d result = _mm_addsub_pd(a, b);
- (void) _mm_movedup_pd(result);
-}
-#endif
-
-#if T(SSSE3)
-attribute_target("ssse3") void test_ssse3()
-{
- __m128i a = _mm_set1_epi32(42);
- _mm_abs_epi8(a);
- (void) _mm_sign_epi16(a, _mm_set1_epi32(64));
-}
-#endif
-
-#if T(SSE4_1)
-attribute_target("sse4.1") void test_sse4_1()
-{
- __m128 a = _mm_setzero_ps();
- _mm_ceil_ps(a);
- __m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64));
- (void)result;
-}
-#endif
-
-#if T(SSE4_2)
-attribute_target("sse4.2") void test_sse4_2()
-{
- __m128i a = _mm_setzero_si128();
- __m128i b = _mm_set1_epi32(42);
- (void) _mm_cmpestrm(a, 16, b, 16, 0);
-}
-#endif
-
-#if T(AESNI)
-attribute_target("aes,sse4.2") void test_aesni()
-{
- __m128i a = _mm_setzero_si128();
- __m128i b = _mm_aesenc_si128(a, a);
- __m128i c = _mm_aesdec_si128(a, b);
- (void)c;
-}
-#endif
-
-#if T(F16C)
-attribute_target("f16c") void test_f16c()
-{
- __m128i a = _mm_setzero_si128();
- __m128 b = _mm_cvtph_ps(a);
- __m256 b256 = _mm256_cvtph_ps(a);
- (void) _mm_cvtps_ph(b, 0);
- (void) _mm256_cvtps_ph(b256, 0);
-}
-#endif
-
-#if T(RDRND)
-attribute_target("rdrnd") int test_rdrnd()
-{
- unsigned short us;
- unsigned int ui;
- if (_rdrand16_step(&us))
- return 1;
- if (_rdrand32_step(&ui))
- return 1;
-# if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
- unsigned long long ull;
- if (_rdrand64_step(&ull))
- return 1;
-# endif
-}
-#endif
-
-#if T(RDSEED)
-attribute_target("rdseed") int test_rdseed()
-{
- unsigned short us;
- unsigned int ui;
- if (_rdseed16_step(&us))
- return 1;
- if (_rdseed32_step(&ui))
- return 1;
-# if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
- unsigned long long ull;
- if (_rdseed64_step(&ull))
- return 1;
-# endif
-}
-#endif
-
-#if T(SHANI)
-attribute_target("sha") void test_shani()
-{
- __m128i a = _mm_setzero_si128();
- __m128i b = _mm_sha1rnds4_epu32(a, a, 0);
- __m128i c = _mm_sha1msg1_epu32(a, b);
- __m128i d = _mm_sha256msg2_epu32(b, c);
- (void)d;
-}
-#endif
-
-#if T(AVX)
-# if defined(__WIN64__) && defined(__GNUC__) && !defined(__clang__)
-# error "AVX support is broken in 64-bit MinGW - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49001"
-# endif
-attribute_target("avx") void test_avx()
-{
- __m256d a = _mm256_setzero_pd();
- __m256d b = _mm256_set1_pd(42.42);
- (void) _mm256_add_pd(a, b);
-}
-#endif
-
-#if T(AVX2)
-attribute_target("avx2") void test_avx2()
-{
- _mm256_zeroall();
- __m256i a = _mm256_setzero_si256();
- __m256i b = _mm256_and_si256(a, a);
- (void) _mm256_add_epi8(a, b);
-}
-#endif
-
-#if T(AVX512F)
-attribute_target("avx512f") void test_avx512f(char *ptr)
-{
- /* AVX512 Foundation */
- __mmask16 m = ~1;
- __m512i i;
- __m512d d;
- __m512 f;
- i = _mm512_maskz_loadu_epi32(0, ptr);
- d = _mm512_loadu_pd((double *)ptr + 64);
- f = _mm512_loadu_ps((float *)ptr + 128);
- _mm512_mask_storeu_epi64(ptr, m, i);
- _mm512_mask_storeu_ps(ptr + 64, m, f);
- _mm512_mask_storeu_pd(ptr + 128, m, d);
-}
-#endif
-
-#if T(AVX512ER)
-attribute_target("avx512er") void test_avx512er()
-{
- /* AVX512 Exponential and Reciprocal */
- __m512 f;
- f = _mm512_exp2a23_round_ps(f, 8);
-}
-#endif
-
-#if T(AVX512CD)
-attribute_target("avx512cd") void test_avx512cd()
-{
- /* AVX512 Conflict Detection */
- __mmask16 m = ~1;
- __m512i i;
- i = _mm512_maskz_conflict_epi32(m, i);
-}
-#endif
-
-#if T(AVX512PF)
-attribute_target("avx512pf") void test_avx512pf(void *ptr)
-{
- /* AVX512 Prefetch */
- __m512i i;
- __mmask16 m = 0xf;
- _mm512_mask_prefetch_i64scatter_pd(ptr, m, i, 2, 2);
-}
-#endif
-
-#if T(AVX512DQ)
-attribute_target("avx512dq") void test_avx512dq()
-{
- /* AVX512 Doubleword and Quadword support */
- __m512i i;
- __mmask16 m = ~1;
- m = _mm512_movepi32_mask(i);
-}
-#endif
-
-#if T(AVX512BW)
-attribute_target("avx512bw") void test_avx512bw(char *ptr)
-{
- /* AVX512 Byte and Word support */
- __m512i i;
- __mmask16 m = ~1;
- i = _mm512_mask_loadu_epi8(i, m, ptr - 8);
-}
-#endif
-
-#if T(AVX512VL)
-attribute_target("avx512vl") void test_avx512vl(char *ptr)
-{
- /* AVX512 Vector Length */
- __mmask16 m = ~1;
- __m256i i2 = _mm256_maskz_loadu_epi32(0, ptr);
- _mm256_mask_storeu_epi32(ptr + 1, m, i2);
-}
-#endif
-
-#if T(AVX512IFMA)
-attribute_target("avx512ifma") void test_avx512ifma()
-{
- /* AVX512 Integer Fused Multiply-Add */
- __m512i i;
- i = _mm512_madd52lo_epu64(i, i, i);
+ /* 256- and 512-bit AES */
+ __m256i a = _mm256_set1_epi32(-1);
+ __m256i b = _mm256_aesenc_epi128(a, a);
+ __m256i c = _mm256_aesdec_epi128(b, a);
}
#endif
diff --git a/config.tests/x86_simd/x86_simd.pro b/config.tests/x86_simd/x86_simd.pro
deleted file mode 100644
index 5751432980..0000000000
--- a/config.tests/x86_simd/x86_simd.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-SOURCES = main.cpp
-for (config, SIMD) {
- uc = $$upper($$config)
- DEFINES += QT_COMPILER_SUPPORTS_$${uc}
-
- add_cflags {
- cflags = QMAKE_CFLAGS_$${uc}
- !defined($$cflags, var): error("This compiler does not support $${uc}")
- QMAKE_CXXFLAGS += $$eval($$cflags)
- }
-}
diff --git a/config.tests/x86intrin/CMakeLists.txt b/config.tests/x86intrin/CMakeLists.txt
new file mode 100644
index 0000000000..1d5beac5ec
--- /dev/null
+++ b/config.tests/x86intrin/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(x86intrin LANGUAGES CXX)
+add_executable(x86intrin main.cpp)
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU|IntelLLVM|QCC")
+ target_compile_options(x86intrin PUBLIC
+ "-march=cannonlake" "-mrdrnd" "-mrdseed" "-maes" "-msha" "-w")
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ target_compile_options(x86intrin PUBLIC "-arch:AVX512" "-W0")
+endif()
diff --git a/config.tests/x86intrin/main.cpp b/config.tests/x86intrin/main.cpp
new file mode 100644
index 0000000000..2e6b198710
--- /dev/null
+++ b/config.tests/x86intrin/main.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2022 Intel Corporation.
+// SPDX-License-Identifier: BSD-3-Clause
+
+#include <immintrin.h>
+
+// Skylake AVX512 was added to GCC 4.9, Clang 3.7, and MSVC 2015.
+// Cannon Lake was added to GCC 5, Clang 3.8, and MSVC 2017 15.7,
+// so that's our minimum.
+// Ice Lake was completed with GCC 8, Clang 6, and MSVC 2017 15.8.
+
+int test(int argc, char **argv)
+{
+ unsigned randomvalue;
+ _rdrand32_step(&randomvalue); // RDRND (IVB)
+#ifndef __QNXNTO__ // buggy compiler is missing this intrinsic, but we allow it
+ _rdseed32_step(&randomvalue); // RDSEED (BDW)
+#endif
+ unsigned mask = _blsmsk_u32(argc); // BMI (HSW)
+ int clz = _lzcnt_u32(mask); // LZCNT (HSW)
+ int ctz = _tzcnt_u32(mask); // BMI (HSW)
+ mask = _bzhi_u32(-1, argc); // BMI2 (HSW)
+
+ __m128d d = _mm_setzero_pd(); // SSE2
+ d = _mm_cvtsi32_sd(d, argc); // SSE2
+ __m256d d2 = _mm256_broadcastsd_pd(d); // AVX (SNB)
+ d2 = _mm256_fmadd_pd(d2, d2, d2); // FMA (HSW)
+
+ __m128 f = _mm256_cvtpd_ps(d2); // AVX (SNB)
+ __m128i a = _mm_cvtps_ph(f, 0); // F16C (IVB)
+ __m128i b = _mm_aesenc_si128(a, a); // AESNI (WSM)
+ __m128i c = _mm_sha1rnds4_epu32(a, a, 0); // SHA (CNL)
+ __m128i e = _mm_sha1msg1_epu32(a, b); // SHA (CNL)
+ __m128i g = _mm_sha256msg2_epu32(b, c); // SHA (CNL)
+
+ __m512i zero = _mm512_setzero_si512(); // AVX512F (SKX)
+ __m512i data = _mm512_maskz_loadu_epi8(mask, argv[0]); // AVX512BW (SKX)
+ __m256i ptrs = _mm256_maskz_loadu_epi64(mask, argv); // AVX512VL (SKX)
+ __m512i data2 = _mm512_broadcast_i64x4(ptrs); // AVX512DQ (SKX)
+ __m256i data3 = _mm256_madd52lo_epu64(ptrs, ptrs, ptrs);// AVX512IFMA (CNL)
+ data2 = _mm512_multishift_epi64_epi8(data, data2); // AVX512VBMI (CNL)
+
+ return _mm256_extract_epi32(data3, 0); // AVX2 (HSW)
+}
+
+int main(int argc, char **argv)
+{
+ return test(argc, argv);
+}