[MemProf] Templatize CallStackRadixTreeBuilder (NFC) (#117014)
[llvm-project.git] / libc / test / integration / scudo / integration_test.cpp
blob67437bdc6a239feaf238110218f919adf766e9f7
1 //===-- Integration Test for Scudo ----------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include <stdlib.h>
11 static const size_t ALLOC_SIZE = 128;
13 int main() {
14 void *P = malloc(ALLOC_SIZE);
15 if (P == nullptr) {
16 return 1;
19 free(P);
21 P = calloc(4, ALLOC_SIZE);
22 if (P == nullptr) {
23 return 2;
26 P = realloc(P, ALLOC_SIZE * 8);
27 if (P == nullptr) {
28 return 3;
31 free(P);
33 P = aligned_alloc(64, ALLOC_SIZE);
34 if (P == nullptr) {
35 return 4;
38 free(P);
40 return 0;