(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
tst-1.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2" } */
       3  
       4  volatile unsigned int w0, w1;
       5  volatile int result;
       6  
       7  void test_si() {
       8    /* { dg-final { scan-assembler "tst\tw\[0-9\]*, w\[0-9\]*\n" } } */
       9    result = !(w0 & w1);
      10    /* { dg-final { scan-assembler "tst\tw\[0-9\]*, \(0x\[0-9a-fA-F\]+\)|\(\[0-9\]+\)" } } */
      11    result = !(w0 & 0x00f0);
      12    /* { dg-final { scan-assembler "tst\tw\[0-9\]*.*lsl 4" } } */
      13    result = !(w0 & (w1 << 4));
      14  }
      15  
      16  void test_si_tbnz() {
      17    /* { dg-final { scan-assembler "tbnz\t\[wx\]\[0-9\]*" } } */
      18  jumpto:
      19    if (w0 & 0x08) goto jumpto;
      20  }
      21  
      22  void test_si_tbz() {
      23    /* { dg-final { scan-assembler "tbz\t\[wx\]\[0-9\]*" } } */
      24  jumpto:
      25    if (!(w1 & 0x08)) goto jumpto;
      26  }
      27  
      28  volatile unsigned long long x0, x1;
      29  
      30  void test_di() {
      31    /* { dg-final { scan-assembler "tst\tx\[0-9\]*, x\[0-9\]*\n" } } */
      32    result = !(x0 & x1);
      33    /* { dg-final { scan-assembler "tst\tx\[0-9\]*, \(0x\[0-9a-fA-F\]+\)|\(\[0-9\]+\)" } } */
      34    result = !(x0 & 0x00f0);
      35    /* { dg-final { scan-assembler "tst\tx\[0-9\]*.*lsl 4" } } */
      36    result = !(x0 & (x1 << 4));
      37  }
      38  
      39  void test_di_tbnz() {
      40    /* { dg-final { scan-assembler "tbnz\tx\[0-9\]*" } } */
      41  jumpto:
      42    if (x0 & 0x08) goto jumpto;
      43  }
      44  
      45  void test_di_tbz() {
      46    /* { dg-final { scan-assembler "tbz\tx\[0-9\]*" } } */
      47  jumpto:
      48    if (!(x1 & 0x08)) goto jumpto;
      49  }