xref: /illumos-gate/usr/src/tools/smatch/src/validation/optim/load-semi-volatile.c (revision 5801b0f01c3c34499a929ed96164a5a68b470945)
1 struct s {
2 	volatile int a;
3 };
4 
5 struct s s;
6 
7 void foo(void)
8 {
9 	s;
10 	s.a;
11 }
12 
13 /*
14  * check-name: load-semi-volatile
15  * check-command: test-linearize -Wno-decl $file
16  *
17  * check-output-ignore
18  * check-output-pattern(1): load
19  *
20  * check-description:
21  *	The load at line 9 must be removed.
22  *	The load at line 10 is volatile and thus
23  *	must not be removed.
24  */
25