[orc] Fix unit tests that use ORC C API
authorBen Langmuir <blangmuir@apple.com>
Tue, 24 Aug 2021 18:10:11 +0000 (11:10 -0700)
committerBen Langmuir <blangmuir@apple.com>
Tue, 24 Aug 2021 21:19:46 +0000 (14:19 -0700)
commit1c53cadf08c07fb3fa70993c6210355c58c3b149
treeddadf22b3ec7b3d5bd9695aa50213cd044ba18f3
parent35b0b1a64af58f25fc8467d3348703439be19f29
[orc] Fix unit tests that use ORC C API

* c_api_tests was failing to build after the API change to
  __orc_rt_CWrapperFunctionResultAllocate

* wrapper_function_utils_test was causing an assertion failure, because
  it was creating a result for `void(void)` with Size = 0, but seeing an
  uninitialized pointer, which it considered to be an out-of-bound
  error.

I noticed locally that making modifications to c_api.h is not causing
these unit tests to be rebuilt, which may be how the bug slipped in in
the first place.

Differential Revision: https://reviews.llvm.org/D108649
compiler-rt/lib/orc/c_api.h
compiler-rt/lib/orc/unittests/c_api_test.cpp