diff --git a/tests/Gtest-dyn1.c b/tests/Gtest-dyn1.c index b530dd76..df2ab4a0 100644 --- a/tests/Gtest-dyn1.c +++ b/tests/Gtest-dyn1.c @@ -86,7 +86,9 @@ struct fdesc # define get_gp(fdesc) (0) #endif +#ifndef __GNUC__ extern void flush_cache (void *addr, size_t len); +#endif void template (int i, template_t self, @@ -186,7 +188,7 @@ main (int argc, char *argv[] __attribute__((unused))) 2*getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC); #ifdef __GNUC__ - __clear_cache(mem, mem + MAX_FUNC_SIZE); + __builtin___clear_cache(mem, mem + MAX_FUNC_SIZE); #else flush_cache (mem, MAX_FUNC_SIZE); #endif diff --git a/tests/flush-cache.S b/tests/flush-cache.S index 2a17165e..f441a74c 100644 --- a/tests/flush-cache.S +++ b/tests/flush-cache.S @@ -1,3 +1,5 @@ +#ifndef __GNUC__ + #if defined(__ia64__) .global flush_cache @@ -80,3 +82,5 @@ flush_cache: /* We do not need executable stack. */ .section .note.GNU-stack,"",@progbits #endif + +#endif diff --git a/tests/ia64-test-dyn1.c b/tests/ia64-test-dyn1.c index c47097cc..83319130 100644 --- a/tests/ia64-test-dyn1.c +++ b/tests/ia64-test-dyn1.c @@ -20,7 +20,9 @@ int verbose; # define EXTRA 0 #endif +#ifndef __GNUC__ extern void flush_cache (void *addr, size_t len); +#endif int make_executable (void *addr, size_t len) @@ -31,7 +33,11 @@ make_executable (void *addr, size_t len) perror ("mprotect"); return -1; } +#ifdef __GNUC__ + __builtin___clear_cache(addr, addr + len); +#else flush_cache (addr, len); +#endif return 0; }