diff --git a/tests/Makefile b/tests/Makefile
index 31421c63ce33d088b08effd36d4dbf33e06d91f4..3c45bf7f06ee97197572ad25fd800febcbb3bedd 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -37,6 +37,7 @@ EXPECT_NAMES=\
 	stdio/setvbuf \
 	stdio/sprintf \
 	stdlib/a64l \
+	stdlib/alloc \
 	stdlib/atof \
 	stdlib/atoi \
 	stdlib/div \
diff --git a/tests/expected/stdlib/alloc.stderr b/tests/expected/stdlib/alloc.stderr
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/tests/expected/stdlib/alloc.stdout b/tests/expected/stdlib/alloc.stdout
new file mode 100644
index 0000000000000000000000000000000000000000..dbbedd189ee0e0164942beee43db7f60bea8cfda
--- /dev/null
+++ b/tests/expected/stdlib/alloc.stdout
@@ -0,0 +1,31 @@
+malloc                : 0x2038870, errno: 0 = Success
+malloc (SIZE_MAX)     : (nil), errno: 12 = Out of memory
+calloc                : 0x2038870, errno: 0 = Success
+calloc (overflowing)  : (nil), errno: 12 = Out of memory
+realloc               : 0x2038870, errno: 0 = Success
+realloc (SIZE_MAX)    : (nil), errno: 12 = Out of memory
+memalign              : 0x2038a00, errno: 0 = Success
+memalign (SIZE_MAX)   : (nil), errno: 12 = Out of memory
+memalign (alignment 0): (nil), errno: 22 = Invalid argument
+memalign (alignment 3): (nil), errno: 22 = Invalid argument
+aligned_alloc (size % alignment == 0):
+                        0x2038980, errno: 0 = Success
+aligned_alloc (size % alignment != 0):
+                        (nil), errno: 22 = Invalid argument
+valloc                : 0x2039000, errno: 0 = Success
+valloc (SIZE_MAX)     : (nil), errno: 12 = Out of memory
+posix_memalign:
+                        0x2038980, return value: 0 = Success,
+                        errno: 0 = Success
+posix_memalign (alignment 0):
+                        (nil), return value: 22 = Invalid argument,
+                        errno: 0 = Success
+posix_memalign (non-power-of-two multiple of sizeof(void *)):
+                        (nil), return value: 22 = Invalid argument,
+                        errno: 0 = Success
+posix_memalign (size 0):
+                        0x2038ac0, return value: 0 = Success,
+                        errno: 0 = Success
+posix_memalign (SIZE_MAX):
+                        (nil), return value: 12 = Out of memory,
+                        errno: 12 = Out of memory