(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tree-prof/
val-prof-3.c
       1  /* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized" } */
       2  unsigned int a[1000];
       3  unsigned int b = 257;
       4  unsigned int c = 1023;
       5  unsigned int d = 19;
       6  int
       7  main ()
       8  {
       9    int i;
      10    unsigned int n;
      11    for (i = 0; i < 1000; i++)
      12      {
      13  	    a[i]=18;
      14      }
      15    for (i = 0; i < 1000; i++)
      16      {
      17        if (i % 2)
      18  	n = b;
      19        else if (i % 3)
      20  	n = c;
      21        else
      22  	n = d;
      23        a[i] %= n;
      24      }
      25    return 0;
      26  }
      27  /* autofdo does not do value profiling so far */
      28  /* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: mod subtract" "profile" } } */
      29  /* This is part of code checking that n is greater than the divisor so we are sure that it
      30     didn't get optimized out.  */
      31  /* { dg-final-use-not-autofdo { scan-tree-dump "if \\(_\[0-9\]* \\< n_\[0-9\]*" "optimized"} } */
      32  /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */