diff options
author | Tim Murray <timmurray@google.com> | 2013-05-23 13:24:14 -0700 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2013-05-23 13:24:27 -0700 |
commit | 224acfd22e2e110bafb75afb732d900c7c110416 (patch) | |
tree | dd017d28c83255192efdb80c968b0449c20e8112 | |
parent | 7e85ca20affa9655d9033ec2b0fdff034f19a9bf (diff) | |
download | rs-224acfd22e2e110bafb75afb732d900c7c110416.tar.gz |
Remove unnecessary tests from RS build.
Change-Id: I99d6f96f7895c876a243106738773303a92cb6a9
-rw-r--r-- | Android.mk | 139 | ||||
-rwxr-xr-x | driver/linkloader/tests/images/clean-testcases.sh | 18 | ||||
-rwxr-xr-x | driver/linkloader/tests/images/gen-testcases.sh | 41 | ||||
-rw-r--r-- | driver/linkloader/tests/images/rodata-test.c | 37 | ||||
-rw-r--r-- | driver/linkloader/tests/images/simple-test.c | 52 | ||||
-rw-r--r-- | driver/linkloader/tests/images/test.c | 68 | ||||
-rw-r--r-- | driver/linkloader/tests/stubs/arm-stub.c | 27 | ||||
-rw-r--r-- | driver/linkloader/tests/stubs/mips-stub.c | 48 | ||||
-rw-r--r-- | driver/linkloader/tests/stubs/stub-layout-test.cpp | 53 |
9 files changed, 0 insertions, 483 deletions
@@ -311,142 +311,3 @@ LOCAL_C_INCLUDES := \ include $(LLVM_ROOT_PATH)/llvm-host-build.mk include $(BUILD_HOST_STATIC_LIBRARY) - -#============================================================================= -# librsloader-test (Device) -#----------------------------------------------------------------------------- - -include $(CLEAR_VARS) - -LOCAL_MODULE := test-librsloader - -LOCAL_MODULE_TAGS := tests - -LOCAL_SHARED_LIBRARIES := \ - libstlport - -LOCAL_STATIC_LIBRARIES := \ - librsloader \ - libcutils \ - liblog \ - libLLVMSupport - -LOCAL_SRC_FILES := \ - driver/linkloader/android/test-librsloader.c - -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk - -LOCAL_CFLAGS += $(rs_base_CFLAGS) - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/driver/linkloader \ - $(LOCAL_PATH)/driver/linkloader/include - -include $(LLVM_ROOT_PATH)/llvm-device-build.mk -include $(BUILD_EXECUTABLE) - - -#============================================================================= -# librsloader-test (Host) -#----------------------------------------------------------------------------- - -include $(CLEAR_VARS) - -LOCAL_MODULE := test-librsloader - -LOCAL_MODULE_TAGS := tests - -LOCAL_LDLIBS := \ - -lpthread \ - -ldl - -LOCAL_STATIC_LIBRARIES := \ - librsloader \ - libcutils \ - liblog \ - libLLVMSupport - -LOCAL_SRC_FILES := \ - driver/linkloader/android/test-librsloader.c - -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk - -LOCAL_CFLAGS += $(rs_base_CFLAGS) - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/driver/linkloader \ - $(LOCAL_PATH)/driver/linkloader/include - -include $(LLVM_ROOT_PATH)/llvm-host-build.mk -include $(BUILD_HOST_EXECUTABLE) - - -#============================================================================= -# rsloader -#----------------------------------------------------------------------------- - -ifdef BUILD_RSLOADER_TOOL -include $(CLEAR_VARS) - -LOCAL_MODULE := rsloader - -LOCAL_MODULE_TAGS := tests - -LOCAL_SHARED_LIBRARIES := \ - libstlport - -LOCAL_STATIC_LIBRARIES := \ - libLLVMSupport - -LOCAL_SRC_FILES := \ - driver/linkloader/lib/ELFHeader.cpp \ - driver/linkloader/lib/ELFSymbol.cpp \ - driver/linkloader/lib/ELFSectionHeader.cpp \ - driver/linkloader/lib/ELFTypes.cpp \ - driver/linkloader/lib/StubLayout.cpp \ - driver/linkloader/utils/raw_ostream.cpp \ - driver/linkloader/utils/rsl_assert.cpp \ - driver/linkloader/utils/helper.cpp \ - driver/linkloader/main.cpp - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/driver/linkloader \ - $(LOCAL_PATH)/driver/linkloader/include \ - $(LOCAL_C_INCLUDES) - -include $(LLVM_ROOT_PATH)/llvm-device-build.mk -include $(BUILD_EXECUTABLE) -endif - - -#============================================================================= -# stub-layout-unit-test -#----------------------------------------------------------------------------- - -ifdef BUILD_STUB_LAYOUT_TEST -include $(CLEAR_VARS) - -LOCAL_MODULE := stub-layout-unit-test - -LOCAL_MODULE_TAGS := tests - -LOCAL_SHARED_LIBRARIES := \ - libstlport - -LOCAL_SRC_FILES := \ - driver/linkloader/lib/StubLayout.cpp \ - driver/linkloader/utils/raw_ostream.cpp \ - driver/linkloader/utils/helper.cpp \ - driver/linkloader/tests/stub-test.cpp - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/driver/linkloader \ - $(LOCAL_PATH)/driver/linkloader/include \ - $(LOCAL_C_INCLUDES) - -include $(LLVM_ROOT_PATH)/llvm-device-build.mk -include $(BUILD_EXECUTABLE) -endif - - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/driver/linkloader/tests/images/clean-testcases.sh b/driver/linkloader/tests/images/clean-testcases.sh deleted file mode 100755 index 1c2d0be8..00000000 --- a/driver/linkloader/tests/images/clean-testcases.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -e - - -# Copyright (C) 2011 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. - -rm -rf *.o *.bc diff --git a/driver/linkloader/tests/images/gen-testcases.sh b/driver/linkloader/tests/images/gen-testcases.sh deleted file mode 100755 index 26c7cdf9..00000000 --- a/driver/linkloader/tests/images/gen-testcases.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -e - - -# Copyright (C) 2011-2012 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. - - -CYAN='\033[1;36m' -RESET='\033[m' - -echo -e "${CYAN}Generating bitcode ...${RESET}" -clang -emit-llvm -std=c89 -Wall -c test.c -o test.bc -clang -emit-llvm -std=c89 -Wall -c simple-test.c -o simple-test.bc -clang -emit-llvm -std=c89 -Wall -c rodata-test.c -o rodata-test.bc - -function gen_test_cases { - echo -e "${CYAN}Generating for $1 ...${RESET}" - llc -filetype=obj -relocation-model=static -mtriple $2 $3 test.bc -o test-$1.o - llc -filetype=obj -relocation-model=static -mtriple $2 $3 simple-test.bc -o simple-test-$1.o - llc -filetype=obj -relocation-model=static -mtriple $2 $3 rodata-test.bc -o rodata-test-$1.o -} - -gen_test_cases arm armv7-none-linux-gnueabi -gen_test_cases tegra2 armv7-none-linux-gnueabi '-mcpu=cortex-a9 -mattr=+vfp3' -gen_test_cases thumb2 thumb-none-linux-gnueabi '-march=thumb -mattr=+thumb2' -gen_test_cases thumb2lc thumb-none-linux-gnueabi '-mattr=+thumb2,+neonfp,+vfp3 -arm-long-calls' -gen_test_cases thumb2lc-xoom thumb-none-linux-gnueabi '-mattr=+thumb2 -arm-long-calls' -gen_test_cases x86_32 i686-none-linux -gen_test_cases x86_64 x86_64-none-linux -gen_test_cases mipsel mipsel-none-linux-gnueabi diff --git a/driver/linkloader/tests/images/rodata-test.c b/driver/linkloader/tests/images/rodata-test.c deleted file mode 100644 index d695d013..00000000 --- a/driver/linkloader/tests/images/rodata-test.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2011, 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. - */ - -#include<stdio.h> - -static char const *const test_str[] = { - "string 1", - "string 2", - "string 3", - "long long long long long long string" -}; - -static size_t test_str_count = sizeof(test_str) / sizeof(char const *const); - -int main(){ - int i; - printf("test_str: %p\n", &test_str); - for (i = 0; i < test_str_count; ++i) { - printf("%p\n", test_str[i]); - printf("%s\n", test_str[i]); - } - - return 0; -} diff --git a/driver/linkloader/tests/images/simple-test.c b/driver/linkloader/tests/images/simple-test.c deleted file mode 100644 index c59201df..00000000 --- a/driver/linkloader/tests/images/simple-test.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011, 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. - */ - -#include <stdlib.h> -#include <stdio.h> -#include <time.h> - -int main() { - srand(time(NULL)); - - unsigned int ans = rand() % 100; - unsigned int user = 100; - unsigned int left = 0; - unsigned int right = 99; - - printf("Hello, droid! Let's play a number guessing game!\n"); - - while (user != ans) { - printf("Please input a number [%d-%d]:\n", left, right); - - if (scanf("%u", &user) != 1) { - break; - } - - if (user < left || user > right) { - /* Out of range, ignore this answer. */ - continue; - } else if (user == ans) { - printf("You got it!\n"); - break; - } else if (user < ans) { - left = user; - } else { - right = user; - } - } - - return 0; -} diff --git a/driver/linkloader/tests/images/test.c b/driver/linkloader/tests/images/test.c deleted file mode 100644 index 01b69a11..00000000 --- a/driver/linkloader/tests/images/test.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2011, 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. - */ - -#include<stdio.h> -static void hello_function(const char *ptr){ - printf("%s", ptr); -} -int my_add(int para_x, int para_y){ - return para_x + para_y; -} -int global_z_i; -double global_z_d; -int global_big_z_i[1000]; -double global_big_z_d[1000]; -static int global_static_z_i; -static double global_static_z_d; -static int global_static_big_z_i[1000]; -static double global_static_big_z_d[1000]; -int global_z_i_init = 1; -double global_z_d_init = 1.1; -/*extern int extern_z_i; */ -/*extern double extern_z_d;*/ -int main(){ - static int local_static_z_i; - static double local_static_z_d; - static int local_static_z_i_init = 2; - static double local_static_z_d_init = 2.2; - local_static_z_i = local_static_z_i_init; - local_static_z_d = local_static_z_d_init; - printf("%d %f\n", local_static_z_i, local_static_z_d); - printf("%d %f\n", local_static_z_i_init, local_static_z_d_init); - hello_function("Hello world!1\n"); - hello_function("Hello world!2\n"); - hello_function("Hello world!3\n"); - global_z_i = my_add(1,2); - global_z_d = 3.3; - printf("%d %f\n", global_z_i, global_z_d); - global_big_z_i[100] = 4; - global_big_z_d[100] = 4.4; - printf("%d %f\n", global_big_z_i[100], global_big_z_d[100]); - global_static_z_i = my_add(2,1); - global_static_z_d = 3.3; - printf("%d %f\n", global_static_z_i, global_static_z_d); - int local_z_i = global_static_z_i = global_z_i; - double local_z_d = global_static_z_d = global_z_d; - printf("%d %f\n", local_z_i, local_z_d); - global_static_big_z_i[500] = 5; - global_static_big_z_d[500] = 5.5; - printf("%d %f\n", global_static_big_z_i[500], global_static_big_z_d[500]); - global_z_i_init = 6; - global_z_d_init = 6.6; - printf("%d %f\n", global_z_i_init, global_z_d_init); - /*printf("%d %f\n", extern_z_i, extern_z_d);*/ - return 0; -} diff --git a/driver/linkloader/tests/stubs/arm-stub.c b/driver/linkloader/tests/stubs/arm-stub.c deleted file mode 100644 index 2138f9a2..00000000 --- a/driver/linkloader/tests/stubs/arm-stub.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <stdint.h> - - -// Note: The first instruction stands for ldr, which loads the data from -// memory to the specified register. Notice that due to the pipeline design, -// when ldr is executed, the program will be advanced by 8. So, to get our -// address we should substract it by 4. - -uint32_t stub[] = { - 0xe51ff004ul, // ldr pc, [pc, #-4] - 0x00000000ul // address -}; - -int test() { - printf("hello world!\n"); - return 5; -} - -int main() { - int (*f)() = (int (*)())stub; - stub[1] = (uint32_t)(uintptr_t)test; - - printf("return = %d\n", f()); - return EXIT_SUCCESS; -} diff --git a/driver/linkloader/tests/stubs/mips-stub.c b/driver/linkloader/tests/stubs/mips-stub.c deleted file mode 100644 index ff34d03b..00000000 --- a/driver/linkloader/tests/stubs/mips-stub.c +++ /dev/null @@ -1,48 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <stdint.h> - -// -------------- -// Register Usage -// -------------- -// $0 zero -// $1 at -// $2-$3 function return value registers -// $4-$7 function argument registers -// $8-$15 temporary -// $16-$23 saved register -// $24-$25 temporary -// $26-$27 os kernel -// $28 global pointer -// $29 stack pointer -// $30 saved register -// $31 return addres reigster - -// -------------------- -// Instruction Encoding -// -------------------- -// lui: 0011 1100 000t tttt iiii iiii iiii iiii -// ori: 0011 01ss ssst tttt iiii iiii iiii iiii -// jr: 0000 00ss sss0 0000 0000 0000 0000 1000 -// nop: 0000 0000 0000 0000 0000 0000 0000 0000 - -uint32_t stub[] = { - 0x3c190000ul, - 0x37390000ul, - 0x03200008ul, - 0x00000000ul -}; - -int test() { - printf("hello world!\n"); - return 5; -} - -int main() { - int (*f)() = (int (*)())stub; - stub[0] |= (((uint32_t)(uintptr_t)test) >> 16) & 0xffff; - stub[1] |= (((uint32_t)(uintptr_t)test)) & 0xffff; - - printf("return = %d\n", f()); - return EXIT_SUCCESS; -} diff --git a/driver/linkloader/tests/stubs/stub-layout-test.cpp b/driver/linkloader/tests/stubs/stub-layout-test.cpp deleted file mode 100644 index ba07cd27..00000000 --- a/driver/linkloader/tests/stubs/stub-layout-test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011, 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. - */ - -#include <stdio.h> -#include <stdlib.h> - -#include "StubLayout.h" - -void function1() { - printf("hello "); -} - -void function2() { - printf("world!\n"); -} - -int main() { - StubLayout stubs; - - void (*func1)() = (void (*)())stubs.allocateStub((void *)&function1); - void (*func2)() = (void (*)())stubs.allocateStub((void *)&function2); - - if (!func1) { - fprintf(stderr, "ERROR: Unable to allocate stub for function1\n"); - exit(EXIT_FAILURE); - } - - if (!func2) { - fprintf(stderr, "ERROR: Unable to allocate stub for function2\n"); - exit(EXIT_FAILURE); - } - - function1(); - function2(); - - func1(); - func2(); - - return EXIT_SUCCESS; -} |