CMake/Tests/RunCMake/cmake_language/exit_9_script_control.cmake
Brad King 86698eea85 cmake_language: Fix EXIT inside control flow blocks
These were missed in commit 1bb1769235 (cmake_language: Add EXIT
subcommand, 2024-01-05, v3.29.0-rc1~112^2).

Fixes: #25674
2024-02-14 08:51:48 -05:00

25 lines
634 B
CMake

function(exit_macro)
cmake_language(EXIT 9)
message(FATAL_ERROR "This should not be reached!")
endfunction()
function(exit_function)
exit_macro()
message(FATAL_ERROR "This should not be reached!")
endfunction()
block()
if(1)
foreach(i IN ITEMS a b)
while(1)
exit_function()
message(FATAL_ERROR "This should not be reached!")
endwhile()
message(FATAL_ERROR "This should not be reached!")
endforeach()
message(FATAL_ERROR "This should not be reached!")
endif()
message(FATAL_ERROR "This should not be reached!")
endblock()
message(FATAL_ERROR "This should not be reached!")