1 // RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s
2 // UNSUPPORTED: android, hwasan, ubsan
6 #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 2)
10 extern "C" int mcheck(void (*abortfunc
)(int mstatus
));
11 extern "C" int mcheck_pedantic(void (*abortfunc
)(int mstatus
));
12 extern "C" int mprobe(void *ptr
);
16 void *p
= malloc(1000);
23 int main(int argc
, char *argv
[]) {
25 if (mcheck(NULL
) != 0) {
26 fprintf(stderr
, "mcheck() failed\n");
33 if (mcheck_pedantic(NULL
) != 0) {
34 fprintf(stderr
, "mcheck_pedantic() failed\n");