diff --git a/test/CPUID.cpp b/test/CPUID.cpp index aa486891..2d251eb3 100644 --- a/test/CPUID.cpp +++ b/test/CPUID.cpp @@ -18,29 +18,49 @@ int main() defined(_M_X64) || \ defined(_M_IX86) - #if defined(__POPCNT__) && !defined(HAS_POPCNT) - std::cerr << "Error: HAS_POPCNT must be defined if __POPCNT__ is defined!" << std::endl; - return 1; + #if defined(__POPCNT__) + #if defined(HAS_POPCNT) + std::cout << "OK: __POPCNT__ and HAS_POPCNT are defined!" << std::endl; + #else + std::cerr << "Error: HAS_POPCNT must be defined if __POPCNT__ is defined!" << std::endl; + return 1; + #endif #endif - #if defined(__AVX__) && !defined(HAS_POPCNT) - std::cerr << "Error: HAS_POPCNT must be defined if __AVX__ is defined!" << std::endl; - return 1; + #if defined(__AVX__) + #if defined(HAS_POPCNT) + std::cout << "OK: __AVX__ and HAS_POPCNT are defined!" << std::endl; + #else + std::cerr << "Error: HAS_POPCNT must be defined if __AVX__ is defined!" << std::endl; + return 1; + #endif #endif - #if defined(__AVX2__) && !defined(HAS_POPCNT) - std::cerr << "Error: HAS_POPCNT must be defined if __AVX2__ is defined!" << std::endl; - return 1; + #if defined(__AVX2__) + #if defined(HAS_POPCNT) + std::cout << "OK: __AVX2__ and HAS_POPCNT are defined!" << std::endl; + #else + std::cerr << "Error: HAS_POPCNT must be defined if __AVX2__ is defined!" << std::endl; + return 1; + #endif #endif - #if defined(HAS_POPCNT) && defined(ENABLE_CPUID_POPCNT) - std::cerr << "Error: ENABLE_CPUID_POPCNT must not be defined if HAS_POPCNT is defined!" << std::endl; - return 1; + #if defined(HAS_POPCNT) + #if !defined(ENABLE_CPUID_POPCNT) + std::cout << "OK: HAS_POPCNT is defined but ENABLE_CPUID_POPCNT is not defined!" << std::endl; + #else + std::cerr << "Error: ENABLE_CPUID_POPCNT must not be defined if HAS_POPCNT is defined!" << std::endl; + return 1; + #endif #endif - #if !defined(HAS_POPCNT) && !defined(ENABLE_CPUID_POPCNT) - std::cerr << "Error: ENABLE_CPUID_POPCNT must be defined if HAS_POPCNT is not defined!" << std::endl; - return 1; + #if !defined(HAS_POPCNT) + #if defined(ENABLE_CPUID_POPCNT) + std::cout << "OK: HAS_POPCNT is not defined but ENABLE_CPUID_POPCNT is defined!" << std::endl; + #else + std::cerr << "Error: ENABLE_CPUID_POPCNT must be defined if HAS_POPCNT is not defined!" << std::endl; + return 1; + #endif #endif #if defined(ENABLE_CPUID_POPCNT)