Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / Darwin / realloc-zero.cpp
blob98262463cb2d1d09f650a9c40eda643b5bdfb26d
1 // Test that realloc(nullptr, 0) return a non-NULL pointer.
3 // RUN: %clang_tsan %s -o %t
4 // RUN: %run %t 2>&1 | FileCheck %s
6 #include <malloc/malloc.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <sys/mman.h>
11 int main() {
12 void *p = realloc(NULL, 0);
13 if (!p) {
14 abort();
16 fprintf(stderr, "Okay.\n");
17 return 0;
20 // CHECK: Okay.