summaryrefslogtreecommitdiff
path: root/test/scudo/malloc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/scudo/malloc.cpp')
-rw-r--r--test/scudo/malloc.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/scudo/malloc.cpp b/test/scudo/malloc.cpp
index cafc744a20c24..50e52590f5651 100644
--- a/test/scudo/malloc.cpp
+++ b/test/scudo/malloc.cpp
@@ -1,10 +1,11 @@
-// RUN: %clang_scudo %s -o %t
+// RUN: %clang_scudo %s -lstdc++ -o %t
// RUN: %run %t 2>&1
// Tests that a regular workflow of allocation, memory fill and free works as
// intended. Tests various sizes serviced by the primary and secondary
// allocators.
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -18,8 +19,7 @@ int main(int argc, char **argv)
std::vector<int> offsets{1, 0, -1, -7, -8, -15, -16, -31, -32};
p = malloc(0);
- if (!p)
- return 1;
+ assert(p);
free(p);
for (ssize_t size : sizes) {
for (int offset: offsets) {
@@ -27,8 +27,7 @@ int main(int argc, char **argv)
if (actual_size <= 0)
continue;
p = malloc(actual_size);
- if (!p)
- return 1;
+ assert(p);
memset(p, 0xff, actual_size);
free(p);
}