expressions: make assign_expression() take an op argument
[smatch.git] / validation / sm_compare12.c
blob39723dacdcd3c8271d81f5bd1a3f4278761faa2d
1 #include "check_debug.h"
3 #define min_t(type, x, y) ({ \
4 type __min1 = (x); \
5 type __min2 = (y); \
6 __min1 < __min2 ? __min1: __min2; })
8 int frob();
10 static int options_write(void)
12 int a = frob();
13 int b = frob();
14 int c = frob();
15 int d = frob();
17 a = min_t(int, b + c, d);
18 __smatch_compare(a, d);
19 __smatch_compare(a, b + c);
20 b++;
21 __smatch_compare(a, b + c);
22 a++; /* argh... really one increment should mean a <= b + c */
23 a++;
24 __smatch_compare(a, b + c);
29 * check-name: smatch compare #12
30 * check-command: smatch -I.. sm_compare12.c
32 * check-output-start
33 sm_compare12.c:18 options_write() a <= d
34 sm_compare12.c:19 options_write() a <= b + c
35 sm_compare12.c:21 options_write() a < b + c
36 sm_compare12.c:24 options_write() a <none> b + c
37 * check-output-end