diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index eefc466a46..d65cb89ce2 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -116,7 +116,7 @@ macro(test_target_arch arch def)
     set(argstring "${argstring} ${arg}")
   endforeach()
   check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF)
-  if(NOT DEFINED CAN_TARGET_${arch})
+  if(NOT CAN_TARGET_${arch})
     if(NOT HAS_${arch}_DEF)
       set(CAN_TARGET_${arch} FALSE)
     elseif(TEST_COMPILE_ONLY)
