gwatch/test_access.c

21 lines
372 B
C

#include <stdio.h>
volatile int global_counter = 0;
int main() {
int temp;
temp = global_counter;
printf("Initial value: %d\n", temp);
global_counter = 42;
temp = global_counter;
printf("After write: %d\n", temp);
global_counter = global_counter + 10;
temp = global_counter;
printf("After increment: %d\n", temp);
return 0;
}