Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/validation/backend/arithmetic-ops.c
          +++ new/usr/src/tools/smatch/src/validation/backend/arithmetic-ops.c
↓ open down ↓ 80 lines elided ↑ open up ↑
  81   81  static int mod(int x, int y)
  82   82  {
  83   83          return x % y;
  84   84  }
  85   85  
  86   86  static unsigned int umod(unsigned int x, unsigned int y)
  87   87  {
  88   88          return x % y;
  89   89  }
  90   90  
       91 +static int neg(int x)
       92 +{
       93 +        return -x;
       94 +}
       95 +
       96 +static unsigned int uneg(unsigned int x)
       97 +{
       98 +        return -x;
       99 +}
      100 +
      101 +static float fneg(float x)
      102 +{
      103 +        return -x;
      104 +}
      105 +
      106 +static double dneg(double x)
      107 +{
      108 +        return -x;
      109 +}
      110 +
  91  111  /*
  92  112   * check-name: Arithmetic operator code generation
  93  113   * check-command: sparsec -c $file -o tmp.o
  94  114   */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX