summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2014-05-16 18:33:19 +0800
committerAmit Pundir <amit.pundir@linaro.org>2014-06-01 16:06:56 +0530
commit64c7763df5937197cebeaaa7f1aa5ae6a1200d29 (patch)
treecd445f3b5c3deb0d06e4eb7122ae4c6b735d0dfd
parentb733b3c7b0601326801d43f548aa139ca0be721e (diff)
downloadextras-linaro-armv8-20140531.tar.gz
bionic libc test: make it can be compiled for 64 bitlinaro-armv8-20140531
some changes here: 1. add Android.mk under test/bionic, so that tests under libc can be compiled 2. delete the -static ld flag for test_static_executable_destructor of host side, otherwise we will get the "-pie and -static are incompatible" error 3. changes in c files for 64 bit compatibility Change-Id: Ic6d3f55d7c82a639a0bbc9d8a5f713d6cf079117 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--tests/bionic/Android.mk8
-rw-r--r--tests/bionic/libc/Android.mk1
-rw-r--r--tests/bionic/libc/bionic/test_pthread_cond.c8
-rw-r--r--tests/bionic/libc/bionic/test_pthread_create.c4
-rw-r--r--tests/bionic/libc/common/test_pthread_cleanup_push.c12
-rw-r--r--tests/bionic/libc/common/test_pthread_join.c4
6 files changed, 22 insertions, 15 deletions
diff --git a/tests/bionic/Android.mk b/tests/bionic/Android.mk
new file mode 100644
index 00000000..b72df254
--- /dev/null
+++ b/tests/bionic/Android.mk
@@ -0,0 +1,8 @@
+ifdef BIONIC_TESTS
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,libc))
+
+include $(subdirs)
+endif
diff --git a/tests/bionic/libc/Android.mk b/tests/bionic/libc/Android.mk
index a29b7925..79207e79 100644
--- a/tests/bionic/libc/Android.mk
+++ b/tests/bionic/libc/Android.mk
@@ -100,7 +100,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := test_static_executable_destructor
LOCAL_SRC_FILES := common/test_executable_destructor.c
LOCAL_MODULE_TAGS := tests
-LOCAL_LDFLAGS := -static
include $(BUILD_HOST_EXECUTABLE)
# The 'test_dlopen_null' tests requires specific linker flags
diff --git a/tests/bionic/libc/bionic/test_pthread_cond.c b/tests/bionic/libc/bionic/test_pthread_cond.c
index 26746fa7..a29111e7 100644
--- a/tests/bionic/libc/bionic/test_pthread_cond.c
+++ b/tests/bionic/libc/bionic/test_pthread_cond.c
@@ -12,7 +12,7 @@ static pthread_mutex_t test_lock = PTHREAD_MUTEX_INITIALIZER;
static void *
thread1_func(void* arg)
{
- printf("Thread 1 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
+ printf("Thread 1 (arg=%p tid=%d) entered.\n", arg, gettid());
printf("1 waiting for cond1\n");
pthread_mutex_lock(&test_lock);
pthread_cond_wait(&cond1, &test_lock );
@@ -24,7 +24,7 @@ thread1_func(void* arg)
static void *
thread2_func(void* arg)
{
- printf("Thread 2 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
+ printf("Thread 2 (arg=%p tid=%d) entered.\n", arg, gettid());
printf("2 waiting for cond2\n");
pthread_mutex_lock(&test_lock);
pthread_cond_wait(&cond2, &test_lock );
@@ -37,7 +37,7 @@ thread2_func(void* arg)
static void *
thread3_func(void* arg)
{
- printf("Thread 3 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
+ printf("Thread 3 (arg=%p tid=%d) entered.\n", arg, gettid());
printf("3 waiting for cond1\n");
pthread_mutex_lock(&test_lock);
pthread_cond_wait(&cond1, &test_lock );
@@ -54,7 +54,7 @@ thread3_func(void* arg)
static void *
thread4_func(void* arg)
{
- printf("Thread 4 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
+ printf("Thread 4 (arg=%p tid=%d) entered.\n", arg, gettid());
printf("4 Sleeping\n");
sleep(5);
diff --git a/tests/bionic/libc/bionic/test_pthread_create.c b/tests/bionic/libc/bionic/test_pthread_create.c
index edac0ff1..66139c9f 100644
--- a/tests/bionic/libc/bionic/test_pthread_create.c
+++ b/tests/bionic/libc/bionic/test_pthread_create.c
@@ -5,14 +5,14 @@
static void *
thread1_func(void* arg)
{
- printf("Thread 1 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
+ printf("Thread 1 (arg=%p tid=%d) entered.\n", arg, gettid());
return 0;
}
static void *
thread2_func(void* arg)
{
- printf("thread 2 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
+ printf("thread 2 (arg=%p tid=%d) entered.\n", arg, gettid());
return 1;
}
diff --git a/tests/bionic/libc/common/test_pthread_cleanup_push.c b/tests/bionic/libc/common/test_pthread_cleanup_push.c
index 87634adf..b94ecf06 100644
--- a/tests/bionic/libc/common/test_pthread_cleanup_push.c
+++ b/tests/bionic/libc/common/test_pthread_cleanup_push.c
@@ -41,7 +41,7 @@ static int g_ok3 = 0;
static void
cleanup1( void* arg )
{
- if ((unsigned)arg != MAGIC1)
+ if ((unsigned long)arg != MAGIC1)
g_ok1 = -1;
else
g_ok1 = +1;
@@ -50,7 +50,7 @@ cleanup1( void* arg )
static void
cleanup2( void* arg )
{
- if ((unsigned)arg != MAGIC2) {
+ if ((unsigned long)arg != MAGIC2) {
g_ok2 = -1;
} else
g_ok2 = +1;
@@ -59,7 +59,7 @@ cleanup2( void* arg )
static void
cleanup3( void* arg )
{
- if ((unsigned)arg != MAGIC3)
+ if ((unsigned long)arg != MAGIC3)
g_ok3 = -1;
else
g_ok3 = +1;
@@ -83,7 +83,7 @@ thread1_func( void* arg )
return NULL;
}
-static int test( int do_exit )
+static int test( long do_exit )
{
pthread_t t;
@@ -127,8 +127,8 @@ static int test( int do_exit )
int main( void )
{
- test(0);
- test(1);
+ test(0l);
+ test(1l);
printf("OK\n");
return 0;
}
diff --git a/tests/bionic/libc/common/test_pthread_join.c b/tests/bionic/libc/common/test_pthread_join.c
index 4fe2561a..13bab68f 100644
--- a/tests/bionic/libc/common/test_pthread_join.c
+++ b/tests/bionic/libc/common/test_pthread_join.c
@@ -44,7 +44,7 @@ thread2_func(void* arg)
void* result;
pthread_join(t1, &result);
- printf("thread2 received code %08x from thread1\n", (int)result);
+ printf("thread2 received code %p from thread1\n", result);
return NULL;
}
@@ -56,7 +56,7 @@ thread3_func(void* arg)
void* result;
pthread_join(t1, &result);
- printf("thread3 received code %08x from thread1\n", (int)result);
+ printf("thread3 received code %p from thread1\n", result);
return NULL;
}