Add volatile to avoid clang optimization.

BUG: 18108178
Change-Id: Ie5b8b1808fcf6d1eacc14a7c6ac0c8d49641fec2
This commit is contained in:
Chih-Hung Hsieh 2014-10-23 16:50:51 -07:00
parent 5bea7edddd
commit a1ff475b07

View file

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