1 #include "check_debug.h"
   2 
   3 #define min_t(type, x, y) ({                    \
   4         type __min1 = (x);                      \
   5         type __min2 = (y);                      \
   6         __min1 < __min2 ? __min1: __min2; })
   7 
   8 int frob();
   9 
  10 static int options_write(void)
  11 {
  12         int a = frob();
  13         int b = frob();
  14         int c = frob();
  15         int d = frob();
  16 
  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);
  25 
  26 }
  27 
  28 /*
  29  * check-name: smatch compare #12
  30  * check-command: smatch -I.. sm_compare12.c
  31  *
  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
  38  */