(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr66299-2.c
       1  /* PR tree-optimization/66299 */
       2  /* { dg-do run } */
       3  /* { dg-options "-fdump-tree-optimized -O" } */
       4  /* { dg-require-effective-target int32plus } */
       5  
       6  void
       7  test1 (int x, unsigned u)
       8  {
       9    if ((1U << x) != 64
      10        || (2 << x) != u
      11        || (x << x) != 384
      12        || (3 << x) == 9
      13        || (x << 14) != 98304U
      14        || (1 << x) == 14
      15        || (3 << 2) != 12)
      16      __builtin_abort ();
      17  }
      18  
      19  void
      20  test2 (int x)
      21  {
      22    unsigned int t = ((unsigned int) 1U << x);
      23    if (t != 2U)
      24      __builtin_abort ();
      25  }
      26  
      27  int
      28  main (void)
      29  {
      30    test1 (6, 128U);
      31    test2 (1);
      32  }
      33  
      34  /* { dg-final { scan-tree-dump-not "<<" "optimized" } } */