xref: /illumos-gate/usr/src/tools/smatch/src/validation/backend/load-global.c (revision da9bf00574dd2845efcb9b791f4b44ecf1d1548c)
1 const char *s = "abc";
2 int x = 4;
3 int y;
4 
5 int *p = &x;
6 int *q;
7 
8 int loadn(void) { return y; }
9 int loadi(void) { return x; }
10 
11 const char *loads(void) { return s; }
12 
13 int *retpn(void) { return  q; }
14 int loadpn(void) { return *q; }
15 int *retpi(void) { return  p; }
16 int loadpi(void) { return *p; }
17 
18 /*
19  * check-name: use simple value from global vars
20  * check-command: sparsec -Wno-decl -c $file -o tmp.o
21  */
22