Actually use tcmalloc and test for it
Change-Id: I61e47db48fca960b77eafaf4c8bda4b4d9517617
diff --git a/build_tests/tcmalloc_test.sh b/build_tests/tcmalloc_test.sh
new file mode 100755
index 0000000..03c3bac
--- /dev/null
+++ b/build_tests/tcmalloc_test.sh
@@ -0,0 +1,17 @@
+set -e
+set -u
+
+OUTPUT=$(TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD=10 build_tests/tcmalloc_build_test_binary 2>&1)
+
+if [[ -z "${OUTPUT}" ]]; then
+ echo 'Empty output!' >&2
+ exit 1
+fi
+
+PATTERN='tcmalloc: large alloc [0-9]+ bytes =='
+
+if [[ ! "${OUTPUT}" =~ ${PATTERN} ]]; then
+ echo 'Unexpected output:' >&2
+ echo "${OUTPUT}" >&2
+ exit 1
+fi