From 0b82024b011c77d3e7c2374b17855031db91d650 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 17 Jun 2020 22:06:28 +1000 Subject: [PATCH] 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 --- tests/xics/xics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.30.2