diff --git a/androidtest/Android.bp b/androidtest/Android.bp
new file mode 100644
index 0000000..ae0aa49
--- /dev/null
+++ b/androidtest/Android.bp
@@ -0,0 +1,25 @@
+java_test_host {
+ name: "HMallocTest",
+ srcs: [
+ "src/**/*.java",
+ ],
+
+ libs: [
+ "tradefed",
+ "compatibility-tradefed",
+ "compatibility-host-util",
+ ],
+
+ static_libs: [
+ "cts-host-utils",
+ "frameworks-base-hostutils",
+ ],
+
+ test_suites: [
+ "general-tests",
+ ],
+
+ data_device_bins_64: [
+ "memtag_test",
+ ],
+}
diff --git a/androidtest/AndroidTest.xml b/androidtest/AndroidTest.xml
new file mode 100644
index 0000000..333f1dd
--- /dev/null
+++ b/androidtest/AndroidTest.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/androidtest/memtag/Android.bp b/androidtest/memtag/Android.bp
new file mode 100644
index 0000000..14ab691
--- /dev/null
+++ b/androidtest/memtag/Android.bp
@@ -0,0 +1,16 @@
+cc_test {
+ name: "memtag_test",
+ srcs: ["memtag_test.cc"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ "-O0",
+ ],
+
+ compile_multilib: "64",
+
+ sanitize: {
+ memtag_heap: true,
+ },
+}
diff --git a/androidtest/memtag/memtag_test.cc b/androidtest/memtag/memtag_test.cc
new file mode 100644
index 0000000..16c379d
--- /dev/null
+++ b/androidtest/memtag/memtag_test.cc
@@ -0,0 +1,204 @@
+// needed to uncondionally enable assertions
+#undef NDEBUG
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include