xref: /illumos-gate/usr/src/tools/smatch/src/validation/kill-pure-call.c (revision 1b58875ad7966cf2c85ee8e92f3da04f0a3b2f7a)
1 int side(int a);
2 int pure(int a) __attribute__((pure));
3 
4 int keep(int a) { return side(a) && 0; }
5 int kill(int a) { return pure(a) && 0; }
6 
7 /*
8  * check-name: kill-pure-call
9  * check-command: test-linearize -Wno-decl $file
10  * check-description:
11  *	See that the call is optimized away but only
12  *	when the function is "pure".
13  *
14  * check-output-ignore
15  * check-output-contains: call\\..* side
16  * check-output-excludes: call\\..* pure
17  */
18