Add Valgrind target tests
Change-Id: I1251ac2122c60ed5fcabf184704bc439243ee85b
diff --git a/test/valgrind-target-suppressions.txt b/test/valgrind-target-suppressions.txt
new file mode 100644
index 0000000..16bb8fd
--- /dev/null
+++ b/test/valgrind-target-suppressions.txt
@@ -0,0 +1,31 @@
+# Valgrind does not recognize the ashmen ioctl() calls on ARM64, so it assumes that a size
+# parameter is a pointer.
+{
+ ashmem ioctl
+ Memcheck:Param
+ ioctl(generic)
+ ...
+ fun:ioctl
+ fun:ashmem_create_region
+}
+
+# It seems that on ARM64 Valgrind considers the canary value used by the Clang stack protector to
+# be an uninitialized value.
+{
+ jemalloc chunk_alloc_cache
+ Memcheck:Cond
+ fun:je_chunk_alloc_cache
+}
+
+# The VectorImpl class does not hold a pointer to the allocated SharedBuffer structure, but to the
+# beginning of the data, which is effectively an interior pointer. Valgrind has limitations when
+# dealing with interior pointers.
+{
+ VectorImpl
+ Memcheck:Leak
+ match-leak-kinds:possible
+ fun:malloc
+ # The wildcards make this rule work both for 32-bit and 64-bit environments.
+ fun:_ZN7android12SharedBuffer5allocE?
+ fun:_ZN7android10VectorImpl5_growE??
+}