(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
riscv/
branch-1.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-march=rv64gc -mabi=lp64" } */
       3  /* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-O1" } } */
       4  
       5  void g();
       6  
       7  void f(long long a) 
       8  {
       9    if (a & 0xff00)
      10      g();
      11  }
      12  
      13  void f2(long long a) 
      14  {
      15    if (a & (-4ull << 3))
      16      g();
      17  }
      18  
      19  void f3(long long a) 
      20  {
      21    if (a & 0xffff00)
      22      g();
      23  }
      24  
      25  void f4(long long a)
      26  {
      27    if (a & 0x7ff800)
      28      g();
      29  }
      30  
      31  /* { dg-final { scan-assembler-times "slli\t" 2 } } */
      32  /* { dg-final { scan-assembler-times "srli\t" 3 } } */
      33  /* { dg-final { scan-assembler-times "andi\t" 1 } } */
      34  /* { dg-final { scan-assembler-times "\tli\t" 1 } } */
      35  /* { dg-final { scan-assembler-not "addi\t" } } */
      36  /* { dg-final { scan-assembler-not "and\t" } } */
      37