diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake --- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -128,7 +128,9 @@ if(NOT HAS_${arch}_DEF) set(CAN_TARGET_${arch} FALSE) elseif(TEST_COMPILE_ONLY) - try_compile_only(CAN_TARGET_${arch} FLAGS ${TARGET_${arch}_CFLAGS}) + try_compile_only(CAN_TARGET_${arch} + SOURCE "#include \nint foo(int x, int y) { return x + y; }\n" + FLAGS ${TARGET_${arch}_CFLAGS}) else() set(FLAG_NO_EXCEPTIONS "") if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG)