From 71c5ce5ced24a5bbd87d7b5415409af340706b1f Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 20 Dec 2016 18:05:33 +0100 Subject: tests: OOT build fixes etc. tests/Makefile: fix out-of-tree build issues Also: - win64: align(16) MEM_DEBUG user memory on win64 the struct jmp_buf in the TCCState structure which we allocate by tcc_malloc needs alignment 16 because the msvcrt setjmp uses MMX instructions. - libtcc_test.c: win32/64 need __attribute__((dllimport)) for extern data objects - tcctest.c: exclude stuff that gcc does not compile except for relocation_test() the other issues are mostly ASM related. We should probably check GCC versions but I have no idea which mingw/gcc versions support what and which don't. - lib/Makefile: use tcc to compile libtcc1.a (except on arm which needs arm-asm --- tests/tcctest.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/tcctest.c') diff --git a/tests/tcctest.c b/tests/tcctest.c index 6d5c4b4..e5b6558 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -2667,6 +2667,9 @@ int reltab[3] = { 1, 2, 3 }; int *rel1 = &reltab[1]; int *rel2 = &reltab[2]; +#ifdef _WIN64 +void relocation_test(void) {} +#else void getmyaddress(void) { printf("in getmyaddress\n"); @@ -2695,6 +2698,7 @@ void relocation_test(void) printf("pa_symbol=0x%lx\n", __pa_symbol() >> 63); #endif } +#endif void old_style_f(a,b,c) int a, b; @@ -3127,8 +3131,10 @@ void other_constraints_test(void) { unsigned long ret; int var; +#ifndef _WIN64 __asm__ volatile ("mov %P1,%0" : "=r" (ret) : "p" (&var)); printf ("oc1: %d\n", ret == (unsigned long)&var); +#endif } #ifndef _WIN32 @@ -3203,9 +3209,11 @@ void test_high_clobbers(void) correctly capture the data flow, but good enough for us. */ asm volatile("mov $0x4542, %%r12" : "=r" (val):: "memory"); clobber_r12(); +#ifndef _WIN64 asm volatile("mov %%r12, %0" : "=r" (val2) : "r" (val): "memory"); printf("asmhc: 0x%x\n", val2); #endif +#endif } static long cpu_number; -- cgit v1.3.1