aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/kill-pure-call.c
blob: d3f78c026d7513e4828ec4f46660dcfa6d9a040a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int side(int a);
int pure(int a) __attribute__((pure));

int keep(int a) { return side(a) && 0; }
int kill(int a) { return pure(a) && 0; }

/*
 * check-name: kill-pure-call
 * check-command: test-linearize -Wno-decl $file
 * check-description:
 *	See that the call is optimized away but only
 *	when the function is "pure".
 *
 * check-output-ignore
 * check-output-contains: call\\..* side
 * check-output-excludes: call\\..* pure
 */