aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/backend/load-global.c
blob: 16ad03bdb3d33721a2f7692c38c67b53d963b9e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const char *s = "abc";
int x = 4;
int y;

int *p = &x;
int *q;

int loadn(void) { return y; }
int loadi(void) { return x; }

const char *loads(void) { return s; }

int *retpn(void) { return  q; }
int loadpn(void) { return *q; }
int *retpi(void) { return  p; }
int loadpi(void) { return *p; }

/*
 * check-name: use simple value from global vars
 * check-command: sparsec -Wno-decl -c $file -o tmp.o
 */