1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[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
This commit is contained in:
Markus Böck 2021-03-16 12:13:31 +01:00
parent 92405c8fe8
commit 1a004a81cb

View File

@ -29,7 +29,7 @@ function(get_errc_messages outvar)
${errc_test_code}
RUN_OUTPUT_VARIABLE errc_result
COMPILE_OUTPUT_VARIABLE errc_compile_errors)
if (errc_compiled)
if (errc_compiled AND "${errc_exit_code}" STREQUAL "0")
set(${outvar} ${errc_result} PARENT_SCOPE)
else()
set(${outvar} "" PARENT_SCOPE)