Merge "Add volatile to avoid clang optimization."

This commit is contained in:
Chih-Hung Hsieh 2014-10-24 03:03:20 +00:00 committed by Gerrit Code Review
commit d88323b266

View file

@ -59,7 +59,7 @@ static void *noisy(void *x)
for(;;) { for(;;) {
usleep(250*1000); usleep(250*1000);
write(2, &c, 1); write(2, &c, 1);
if(c == 'C') *((unsigned*) 0) = 42; if(c == 'C') *((volatile unsigned*) 0) = 42;
} }
return NULL; return NULL;
} }