Thanks for the report. The issue is that your processor, the Intel(R) Pentium(R) CPU N3700, doesn't support AVX2 instructions and the test is running without checking. The main library should detect this at runtime and not cause a SIGILL.
For now you can add -E common_avx2_test to the ctest command line. You'll likely need to add more of the dsp tests too. There's not a great way to forward test arguments (--gtest_filter=-*AVX2* for example) to the tests through ctest.
I'll add a check in this test and take a look at the others. Something similar to the following should work:
diff --git a/src/dsp/x86/common_avx2_test.cc b/src/dsp/x86/common_avx2_test.cc
index 2062683..11c74b1 100644
--- a/src/dsp/x86/common_avx2_test.cc
+++ b/src/dsp/x86/common_avx2_test.cc
@@ -21,6 +21,7 @@
#include <cstdint>
#include "src/utils/common.h"
+#include "src/utils/cpu.h"
namespace libgav1 {
namespace dsp {
@@ -32,6 +33,7 @@ namespace {
// RightShiftWithRounding_S16() is equal to RightShiftWithRounding() only for
// negative values.
TEST(CommonDspTest, AVX2RightShiftWithRoundingS16) {
+ if ((GetCpuInfo() & kAVX2) == 0) GTEST_SKIP() << "No AVX2 support";
for (int bits = 0; bits < 16; ++bits) {
const int bias = (1 << bits) >> 1;
for (int32_t value = INT16_MIN; value <= INT16_MAX; ++value) {
diff --git a/tests/libgav1_tests.cmake b/tests/libgav1_tests.cmake
index 9c3fdb7..6428020 100644
--- a/tests/libgav1_tests.cmake
+++ b/tests/libgav1_tests.cmake
@@ -284,6 +284,8 @@ macro(libgav1_add_tests_targets)
${libgav1_defines}
INCLUDES
${libgav1_test_include_paths}
+ OBJLIB_DEPS
+ libgav1_utils
LIB_DEPS
${libgav1_common_test_absl_deps}
libgav1_gtest
Looking a little more closely, the test will need to be split to a fixture class that isn't built with AVX2 to allow the check to run without the risk of AVX/AVX2 instructions being used when registering the test.
For now, ctest -E common_avx2_test should work.
Thanks again for the report. After the change in comment #7 you should be able to run all the tests without any workarounds. Tests will be skipped if the device does not support the instructions.