ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] syscalls/signal06: add volatile to loop variable
@ 2022-07-12 17:39 Edward Liaw via ltp
  2022-07-13 12:48 ` Petr Vorel
  2022-07-19 10:20 ` Cyril Hrubis
  0 siblings, 2 replies; 18+ messages in thread
From: Edward Liaw via ltp @ 2022-07-12 17:39 UTC (permalink / raw)
  To: ltp; +Cc: kernel-team

On Android compiled with clang, the loop variable will be optimized out
unless it is tagged with volatile.

Signed-off-by: Edward Liaw <edliaw@google.com>
---
 testcases/kernel/syscalls/signal/signal06.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/signal/signal06.c b/testcases/kernel/syscalls/signal/signal06.c
index 64f886ee3..b40ff3e40 100644
--- a/testcases/kernel/syscalls/signal/signal06.c
+++ b/testcases/kernel/syscalls/signal/signal06.c
@@ -65,7 +65,7 @@ char altstack[4096 * 10] __attribute__((aligned(4096)));
 
 void test(void)
 {
-	int loop = 0;
+	volatile int loop = 0;
 	int pid = getpid();
 
 	D = VALUE;
-- 
2.37.0.144.g8ac04bfd2-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-08-19 18:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 17:39 [LTP] [PATCH v1] syscalls/signal06: add volatile to loop variable Edward Liaw via ltp
2022-07-13 12:48 ` Petr Vorel
2022-07-19 10:20 ` Cyril Hrubis
2022-07-27 21:37   ` Edward Liaw via ltp
2022-08-11 15:24     ` Edward Liaw via ltp
2022-08-11 15:33       ` Cyril Hrubis
2022-08-16 12:43         ` Petr Vorel
2022-08-16 23:00           ` Edward Liaw via ltp
2022-08-17  9:12             ` Petr Vorel
2022-08-17 15:04               ` Edward Liaw via ltp
2022-08-18 21:18                 ` Edward Liaw via ltp
2022-08-19  8:12                   ` Petr Vorel
2022-08-19  8:41                     ` Cyril Hrubis
2022-08-19  9:02                       ` Cyril Hrubis
2022-08-19  9:14                       ` Joerg Vehlow
2022-08-19  9:21                         ` Cyril Hrubis
2022-08-19 10:40                       ` Petr Vorel
2022-08-19 18:13                         ` Edward Liaw via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).