Add test for _mm_malloc which uses memalign instead of posix_memalign
Change-Id: Ifb85bff640e247a66fae42eb202d11ef4e197914
diff --git a/tests/device/emm/jni/Android.mk b/tests/device/emm/jni/Android.mk
new file mode 100644
index 0000000..aa7b0b6
--- /dev/null
+++ b/tests/device/emm/jni/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := emm
+LOCAL_SRC_FILES := emm.c
+include $(BUILD_EXECUTABLE)
+
diff --git a/tests/device/emm/jni/Application.mk b/tests/device/emm/jni/Application.mk
new file mode 100644
index 0000000..5eaff6d
--- /dev/null
+++ b/tests/device/emm/jni/Application.mk
@@ -0,0 +1 @@
+APP_ABI := x86
diff --git a/tests/device/emm/jni/emm.c b/tests/device/emm/jni/emm.c
new file mode 100644
index 0000000..5cf1e3b
--- /dev/null
+++ b/tests/device/emm/jni/emm.c
@@ -0,0 +1,15 @@
+#include <emmintrin.h>
+
+int main()
+{
+ __m64 *p;
+ __m128 *q;
+ int p_isaligned, q_isaligned;
+ p = _mm_malloc(7*sizeof(*p),sizeof(*p));
+ q = _mm_malloc(5*sizeof(*q),sizeof(*q));
+ p_isaligned = ((int)p % sizeof(*p)) == 0;
+ q_isaligned = ((int)q % sizeof(*q)) == 0;
+ free(p);
+ free(q);
+ return (p_isaligned && q_isaligned)? 0 : 1;
+}