(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
ngc.c
       1  /* { dg-do run } */
       2  /* { dg-options "-O2 --save-temps -fno-inline" } */
       3  
       4  extern void abort (void);
       5  typedef unsigned int u32;
       6  
       7  u32
       8  ngc_si (u32 a, u32 b, u32 c, u32 d)
       9  {
      10    a = -b - (c < d);
      11    return a;
      12  }
      13  
      14  typedef unsigned long long u64;
      15  
      16  u64
      17  ngc_si_tst (u64 a, u32 b, u32 c, u32 d)
      18  {
      19    a = -b - (c < d);
      20    return a;
      21  }
      22  
      23  u64
      24  ngc_di (u64 a, u64 b, u64 c, u64 d)
      25  {
      26    a = -b - (c < d);
      27    return a;
      28  }
      29  
      30  int
      31  main ()
      32  {
      33    int x;
      34    u64 y;
      35  
      36    x = ngc_si (29, 4, 5, 4);
      37    if (x != -4)
      38      abort ();
      39  
      40    x = ngc_si (1024, 2, 20, 13);
      41    if (x != -2)
      42      abort ();
      43  
      44    y = ngc_si_tst (0x130000029ll, 32, 50, 12);
      45    if (y != 0xffffffe0)
      46      abort ();
      47  
      48    y = ngc_si_tst (0x5000500050005ll, 21, 2, 14);
      49    if (y != 0xffffffea)
      50      abort ();
      51  
      52    y = ngc_di (0x130000029ll, 0x320000004ll, 0x505050505ll, 0x123123123ll);
      53    if (y != 0xfffffffcdffffffc)
      54      abort ();
      55  
      56    y = ngc_di (0x5000500050005ll,
      57  	      0x2111211121112ll, 0x0000000002020ll, 0x1414575046477ll);
      58    if (y != 0xfffdeeedeeedeeed)
      59      abort ();
      60  
      61    return 0;
      62  }
      63  
      64  /* { dg-final { scan-assembler-times "ngc\tw\[0-9\]+, w\[0-9\]+" 2 } } */
      65  /* { dg-final { scan-assembler-times "ngc\tx\[0-9\]+, x\[0-9\]+" 1 } } */