check_cxx_source_runs(
"
#include <cstdio>
#include <cstdlib>
#include <iostream>
class BarB
{
public:
float y;
/* Include something that uses a virtual function. The symbols
that are broken on current OS X libc++ involve this */
virtual int arst(int o)
{
return 4 + o;
}
};
/* Just include something that ubsan will need to check */
int main(int argc, const char* argv[])
{
BarB* b = new BarB();
if (argc > 1)
{
fputs(argv[atoi(argv[1])], stdout);
std::cout << b->arst(atoi(argv[1]));
}
delete b;
return 0;
}
"
HAVE_UNDEFINED_BEHAVIOR_SANITIZER)