Home | History | Annotate | Download | only in patches
      1 From 0fd3eaf312c6284450f758e3a49c5cfd855e4847 Mon Sep 17 00:00:00 2001
      2 From: Tri Vo <trong (a] google.com>
      3 Date: Wed, 21 Sep 2016 15:10:38 -0700
      4 Subject: [PATCH] Compile breakpoints and x86 tests. Test: make vts
      5 
      6 Change-Id: I0c5dd63b3386adb22f3370a8b736d190c781bd4f
      7 ---
      8  android/Android.kselftest.mk              | 121 ++++++++++++++++++++++++++++++
      9  android/Android.test.mk                   |   2 +-
     10  tools/testing/selftests/x86/test_FISTTP.c |  18 +++++
     11  3 files changed, 140 insertions(+), 1 deletion(-)
     12 
     13 diff --git a/android/Android.kselftest.mk b/android/Android.kselftest.mk
     14 index 57e727d66bb6..cabc1f6a10b4 100644
     15 --- a/android/Android.kselftest.mk
     16 +++ b/android/Android.kselftest.mk
     17 @@ -14,6 +14,21 @@
     18  # limitations under the License.
     19  #
     20  
     21 +# breakpoints test
     22 +module_testname := breakpoints/breakpoint_test
     23 +module_src_files := breakpoints/breakpoint_test.c
     24 +module_cflags :=
     25 +module_c_includes :=
     26 +module_supported_arch := x86 x86_64
     27 +include $(build_kselftest_test)
     28 +
     29 +module_testname := breakpoints/step_after_suspend_test
     30 +module_src_files := breakpoints/step_after_suspend_test.c
     31 +module_cflags :=
     32 +module_c_includes :=
     33 +module_supported_arch := x86 x86_64
     34 +include $(build_kselftest_test)
     35 +
     36  # Cpu-hotplug test
     37  module_prebuilt := cpu-hotplug/cpu-on-off-test
     38  module_src_files := cpu-hotplug/cpu-on-off-test.sh
     39 @@ -477,6 +492,112 @@ module_c_includes :=
     40  module_supported_arch := arm arm64 x86 x86_64
     41  include $(build_kselftest_test)
     42  
     43 +# x86 test
     44 +module_testname := x86/single_step_syscall
     45 +module_src_files := x86/single_step_syscall.c
     46 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     47 +module_c_includes :=
     48 +module_supported_arch := x86 x86_64
     49 +include $(build_kselftest_test)
     50 +
     51 +module_testname := x86/sysret_ss_attrs
     52 +module_src_files := x86/sysret_ss_attrs.c
     53 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     54 +module_c_includes :=
     55 +module_supported_arch := x86
     56 +include $(build_kselftest_test)
     57 +
     58 +module_testname := x86/syscall_nt
     59 +module_src_files := x86/syscall_nt.c
     60 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     61 +module_c_includes :=
     62 +module_supported_arch := x86 x86_64
     63 +include $(build_kselftest_test)
     64 +
     65 +module_testname := x86/ptrace_syscall
     66 +module_src_files := x86/ptrace_syscall.c x86/raw_syscall_helper_32.S
     67 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     68 +module_c_includes :=
     69 +module_supported_arch := x86 x86_64
     70 +include $(build_kselftest_test)
     71 +
     72 +module_testname := x86/test_mremap_vdso
     73 +module_src_files := x86/test_mremap_vdso.c
     74 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     75 +module_c_includes :=
     76 +module_supported_arch := x86 x86_64
     77 +include $(build_kselftest_test)
     78 +
     79 +module_testname := x86/check_initial_reg_state
     80 +module_src_files := x86/check_initial_reg_state.c
     81 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -Wl,-ereal_start -static -lrt -ldl -lm
     82 +module_c_includes :=
     83 +module_supported_arch := x86 x86_64
     84 +include $(build_kselftest_test)
     85 +
     86 +module_testname := x86/ldt_gdt
     87 +module_src_files := x86/ldt_gdt.c
     88 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     89 +module_c_includes :=
     90 +module_supported_arch := x86 x86_64
     91 +include $(build_kselftest_test)
     92 +
     93 +module_testname := x86/entry_from_vm86
     94 +module_src_files := x86/entry_from_vm86.c
     95 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
     96 +module_c_includes :=
     97 +module_supported_arch := x86
     98 +#include $(build_kselftest_test)
     99 +
    100 +module_testname := x86/syscall_arg_fault
    101 +module_src_files := x86/syscall_arg_fault.c
    102 +module_cflags := -O2 -g -std=gnu99 -pthread -lrt -ldl -lm
    103 +module_c_includes :=
    104 +module_supported_arch := x86
    105 +include $(build_kselftest_test)
    106 +
    107 +module_testname := x86/test_syscall_vdso
    108 +module_src_files := x86/test_syscall_vdso.c x86/thunks_32.S
    109 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
    110 +module_c_includes :=
    111 +module_supported_arch := x86
    112 +include $(build_kselftest_test)
    113 +
    114 +module_testname := x86/unwind_vdso
    115 +module_src_files := x86/unwind_vdso.c
    116 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
    117 +module_c_includes :=
    118 +module_supported_arch := x86
    119 +include $(build_kselftest_test)
    120 +
    121 +module_testname := x86/test_FCMOV
    122 +module_src_files := x86/test_FCMOV.c
    123 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
    124 +module_c_includes :=
    125 +module_supported_arch := x86
    126 +include $(build_kselftest_test)
    127 +
    128 +module_testname := x86/test_FCOMI
    129 +module_src_files := x86/test_FCOMI.c
    130 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
    131 +module_c_includes :=
    132 +module_supported_arch := x86
    133 +include $(build_kselftest_test)
    134 +
    135 +module_testname := x86/test_FISTTP
    136 +module_src_files := x86/test_FISTTP.c
    137 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
    138 +module_c_includes :=
    139 +module_supported_arch := x86
    140 +include $(build_kselftest_test)
    141 +
    142 +module_testname := x86/vdso_restorer
    143 +module_src_files := x86/vdso_restorer.c
    144 +module_cflags := -O2 -g -std=gnu99 -pthread -Wall -lrt -ldl -lm
    145 +module_c_includes :=
    146 +module_supported_arch := x86
    147 +include $(build_kselftest_test)
    148 +
    149  # zram tests
    150  module_prebuilt := zram/zram.sh
    151  module_src_files := zram/zram.sh
    152 diff --git a/android/Android.test.mk b/android/Android.test.mk
    153 index efafc2708bc9..d72775118063 100644
    154 --- a/android/Android.test.mk
    155 +++ b/android/Android.test.mk
    156 @@ -21,7 +21,7 @@ ifneq (,$(findstring $(kselftest_target_arch), $(module_supported_arch)))
    157  
    158  module_name := kselftest_$(subst /,_,$(module_testname))
    159  module_stem := $(notdir $(module_testname))
    160 -module_path := $(dir $(module_src_files))
    161 +module_path := $(dir $(module_testname))
    162  
    163  LOCAL_MODULE := $(module_name)
    164  LOCAL_MODULE_STEM_32 := $(module_stem)
    165 diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c
    166 index b8e61a047f6b..6cae2d45b246 100644
    167 --- a/tools/testing/selftests/x86/test_FISTTP.c
    168 +++ b/tools/testing/selftests/x86/test_FISTTP.c
    169 @@ -24,7 +24,11 @@ int test(void)
    170  	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
    171  	asm volatile ("\n"
    172  	"	fld1""\n"
    173 +#ifdef __clang__
    174 +	"	fisttps	res16""\n"
    175 +#else
    176  	"	fisttp	res16""\n"
    177 +#endif
    178  	"	fld1""\n"
    179  	"	fisttpl	res32""\n"
    180  	"	fld1""\n"
    181 @@ -44,7 +48,11 @@ int test(void)
    182  	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
    183  	asm volatile ("\n"
    184  	"	fldpi""\n"
    185 +#ifdef __clang__
    186 +	"	fisttps	res16""\n"
    187 +#else
    188  	"	fisttp	res16""\n"
    189 +#endif
    190  	"	fldpi""\n"
    191  	"	fisttpl	res32""\n"
    192  	"	fldpi""\n"
    193 @@ -65,7 +73,13 @@ int test(void)
    194  	asm volatile ("\n"
    195  	"	fldpi""\n"
    196  	"	fchs""\n"
    197 +#ifdef __clang__
    198 +	"	fisttps	res16""\n"
    199 +#else
    200 +    // clang will complain: ambiguous instructions require an explicit suffix
    201 +    // (could be 'fisttps', or 'fisttpl')
    202  	"	fisttp	res16""\n"
    203 +#endif
    204  	"	fldpi""\n"
    205  	"	fchs""\n"
    206  	"	fisttpl	res32""\n"
    207 @@ -87,7 +101,11 @@ int test(void)
    208  	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
    209  	asm volatile ("\n"
    210  	"	fldln2""\n"
    211 +#ifdef __clang__
    212 +	"	fisttps	res16""\n"
    213 +#else
    214  	"	fisttp	res16""\n"
    215 +#endif
    216  	"	fldln2""\n"
    217  	"	fisttpl	res32""\n"
    218  	"	fldln2""\n"
    219 -- 
    220 2.13.1.518.g3df882009-goog
    221 
    222