Skip to content

Commit 953bb5e

Browse files
committed
[test] Make sure the test program in GetErrcMessages.cmake exits normally.
If for some reason the test program does not exit normally it'd currently lead to a false positive and it's stdout output being assigned to the output variable. Instead, check the test program exited normally before assigning the process output to the out variable. Follow up on rGaf2796c76d2ff4b73165ed47959afd35a769beee Fixes an issue discovered post commit in https://reviews.llvm.org/D98278
1 parent 43d0b1c commit 953bb5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/cmake/modules/GetErrcMessages.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function(get_errc_messages outvar)
2929
${errc_test_code}
3030
RUN_OUTPUT_VARIABLE errc_result
3131
COMPILE_OUTPUT_VARIABLE errc_compile_errors)
32-
if (errc_compiled)
32+
if (errc_compiled AND "${errc_exit_code}" STREQUAL "0")
3333
set(${outvar} ${errc_result} PARENT_SCOPE)
3434
else()
3535
set(${outvar} "" PARENT_SCOPE)

0 commit comments

Comments
 (0)