(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
cris/
pr93372-36.c
       1  /* Check that we produce sign- and zero-extended additions and
       2     subtractions, and that no (eliminable) test- or compare-instructions
       3     are used. */
       4  /* { dg-do compile } */
       5  /* { dg-options "-O2" } */
       6  /* { dg-final { scan-assembler-not {\tcmp|\ttest|\tsub\.|\tadd\.|\tmovs} } } */
       7  /* { dg-final { scan-assembler "\tadds" } } */
       8  /* { dg-final { scan-assembler "\tsubs" } } */
       9  
      10  #ifndef t
      11  #define t signed char
      12  #define s _sc
      13  #endif
      14  
      15  #ifndef t2
      16  #define t2 int
      17  #endif
      18  
      19  #ifndef f
      20  #define f0(a, s) a ## s
      21  #define f(a, s) f0(a, s)
      22  #endif
      23  
      24  extern void g(int);
      25  
      26  t2 f(a, s) (t2 a, t *b, int *c)
      27  {
      28    t2 d = a + *b;
      29    *c = d == 0;
      30    return d;
      31  }
      32  t2 f(b, s) (t2 a, t *b, int *c)
      33  {
      34    t2 d = a - *b;
      35    *c = d == 0;
      36    return d;
      37  }