From: Benjamin Herrenschmidt Date: Wed, 17 Jun 2020 12:06:28 +0000 (+1000) Subject: tests/xics: Ensure no compiler optimisations in delay() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b82024b011c77d3e7c2374b17855031db91d650;p=microwatt.git tests/xics: Ensure no compiler optimisations in delay() In case it would be tempted to "read ahead" the delay function Signed-off-by: Benjamin Herrenschmidt --- diff --git a/tests/xics/xics.c b/tests/xics/xics.c index 46f9a01..f41c3a4 100644 --- a/tests/xics/xics.c +++ b/tests/xics/xics.c @@ -12,8 +12,8 @@ void delay(void) { static volatile int i; - for (i = 0; i < 10; ++i) - ; + for (i = 0; i < 16; ++i) + __asm__ volatile("" : : : "memory"); } void print_number(unsigned int i) // only for i = 0-999