Enable arm64 bit tests

 * fix compilation errors for integer.c
 * add scripts to run arm/arm64 test variants

Change-Id: Ie33fc50c7828d784163c11cc671af3dcfa0c54da
diff --git a/main/Android.mk b/main/Android.mk
index 7cc8ceb..11abb96 100644
--- a/main/Android.mk
+++ b/main/Android.mk
@@ -583,6 +583,13 @@
 include $(LOCAL_PATH)/Android.test.mk
 endif
 
+ifeq ($(TARGET_ARCH),arm64)
+test := integer
+include $(LOCAL_PATH)/Android.test.mk
+test := fp_and_simd
+include $(LOCAL_PATH)/Android.test.mk
+endif
+
 # Copy prebuilt suppressions
 include $(CLEAR_VARS)
 LOCAL_MODULE := default.supp
diff --git a/main/Android.test.mk b/main/Android.test.mk
index 0197b3c..a775309 100644
--- a/main/Android.test.mk
+++ b/main/Android.test.mk
@@ -1,6 +1,6 @@
 include $(CLEAR_VARS)
 
-LOCAL_MODULE=$(test)
-LOCAL_SRC_FILES=none/tests/arm/$(test).c
+LOCAL_MODULE=vg-$(test)
+LOCAL_SRC_FILES=none/tests/$(TARGET_ARCH)/$(test).c
 
 include $(BUILD_NATIVE_TEST)
diff --git a/main/none/tests/arm64/integer.c b/main/none/tests/arm64/integer.c
index 7addada..f1252f3 100644
--- a/main/none/tests/arm64/integer.c
+++ b/main/none/tests/arm64/integer.c
@@ -419,8 +419,8 @@
 TESTINST2("ands x3,x4, #0x8080808080808080", 0xF070707070707070, x3, x4, 0);
 
 TESTINST2("and  w3,w4, #0xF", ALL5s, x3, x4, 0);
-TESTINST2("and  w3,w4, #0x8080808080808080", 0x843fdf810277796e, x3, x4, 0);
-TESTINST2("and  w3,w4, #0xC0C0C0C0C0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
+TESTINST2("and  w3,w4, #0x80808080", 0x843fdf810277796e, x3, x4, 0);
+TESTINST2("and  w3,w4, #0xC0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
 TESTINST2("ands w3,w4, #0x80808080", 0x843fdf810277796e, x3, x4, 0);
 TESTINST2("ands w3,w4, #0xC0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
 TESTINST2("ands w3,w4, #0x80808080", 0x143fdf810277796e, x3, x4, 0);
@@ -435,8 +435,8 @@
 TESTINST2("orr  x3,x4, #0xC0C0C0C0C0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
 
 TESTINST2("orr  w3,w4, #0xF", ALL5s, x3, x4, 0);
-TESTINST2("orr  w3,w4, #0x8080808080808080", 0x843fdf810277796e, x3, x4, 0);
-TESTINST2("orr  w3,w4, #0xC0C0C0C0C0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
+TESTINST2("orr  w3,w4, #0x80808080", 0x843fdf810277796e, x3, x4, 0);
+TESTINST2("orr  w3,w4, #0xC0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
 
 ////////////////////////////////////////////////////////////////
 printf("EOR(imm)\n");
@@ -445,8 +445,8 @@
 TESTINST2("eor  x3,x4, #0xC0C0C0C0C0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
 
 TESTINST2("eor  w3,w4, #0xF", ALL5s, x3, x4, 0);
-TESTINST2("eor  w3,w4, #0x8080808080808080", 0x843fdf810277796e, x3, x4, 0);
-TESTINST2("eor  w3,w4, #0xC0C0C0C0C0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
+TESTINST2("eor  w3,w4, #0x80808080", 0x843fdf810277796e, x3, x4, 0);
+TESTINST2("eor  w3,w4, #0xC0C0C0C0", 0xc5446fe48c610b28, x3, x4, 0);
 
 ////////////////////////////////////////////////////////////////
 printf("MOVZ\n");
diff --git a/main/none/tests/arm64/test_arm64_fp_and_simd.c b/main/none/tests/arm64/test_arm64_fp_and_simd.c
deleted file mode 100644
index e69de29..0000000
--- a/main/none/tests/arm64/test_arm64_fp_and_simd.c
+++ /dev/null
diff --git a/main/none/tests/arm64/test_arm64_int.c b/main/none/tests/arm64/test_arm64_int.c
deleted file mode 100644
index e69de29..0000000
--- a/main/none/tests/arm64/test_arm64_int.c
+++ /dev/null
diff --git a/runtests.sh b/runtest.sh
similarity index 94%
rename from runtests.sh
rename to runtest.sh
index 7234daa..a917864 100755
--- a/runtests.sh
+++ b/runtest.sh
@@ -19,7 +19,12 @@
   exit -1
 fi
 
-test_name=v6intThumb
+if [ -z "$1" ]; then
+  echo "Usage runtest.sh test-name"
+  exit -1;
+fi
+
+test_name=$1
 test_local=out/target/product/hammerhead/data/nativetest/$test_name/$test_name
 test_target=/data/nativetest/$test_name/$test_name
 
diff --git a/runtests-arm.sh b/runtests-arm.sh
new file mode 100755
index 0000000..846063c
--- /dev/null
+++ b/runtests-arm.sh
@@ -0,0 +1,16 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the 'License');
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an 'AS IS' BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+dir=`dirname $0`
+$dir/runtest.sh vg-v6intThumb
diff --git a/runtests-arm64.sh b/runtests-arm64.sh
new file mode 100755
index 0000000..56ea830
--- /dev/null
+++ b/runtests-arm64.sh
@@ -0,0 +1,17 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the 'License');
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an 'AS IS' BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+dir=`dirname $0`
+$dir/runtest.sh vg-integer
+$dir/runtest.sh vg-fp_and_simd