Make the compiler not optimize my test out
Austin discovered it was broken with -c opt.
Change-Id: If2008f98b8079c9c40f8050400e3a250414d909f
diff --git a/build_tests/tcmalloc.cc b/build_tests/tcmalloc.cc
index c1d4429..7fb9105 100644
--- a/build_tests/tcmalloc.cc
+++ b/build_tests/tcmalloc.cc
@@ -1,6 +1,8 @@
#include <stdlib.h>
+#include <unistd.h>
int main() {
- void *big_chunk = malloc(500000);
+ void *big_chunk = malloc(500000 + read(-1, nullptr, 0));
+ if (write(-1, big_chunk, 0) != -1) return 1;
free(big_chunk);
}