force-parallel-8.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #define N 1500
  2. int x[N][N], y[N];
  3. void abort (void);
  4. int foo(void)
  5. {
  6. int i, j;
  7. for (i = 0; i < N; i++)
  8. y[i] = i;
  9. for (i = 0; i < N; i++)
  10. for (j = 0; j < N; j++)
  11. x[i][j] = i + j;
  12. for (i = 0; i < N; i++)
  13. {
  14. y[i] = i;
  15. for (j = 0; j < N; j++)
  16. {
  17. if (j > 500)
  18. {
  19. x[i][j] = i + j + 3;
  20. y[j] = i*j + 10;
  21. }
  22. else
  23. x[i][j] = x[i][j]*3;
  24. }
  25. }
  26. return x[2][5]*y[8];
  27. }
  28. int main(void)
  29. {
  30. if (168 != foo())
  31. abort ();
  32. return 0;
  33. }
  34. /* Check that parallel code generation part make the right answer. */
  35. /* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
  36. /* { dg-final { scan-tree-dump-times "3 loops carried no dependency" 1 "graphite" } } */
  37. /* { dg-final { scan-tree-dump-times "5 loops carried no dependency" 1 "graphite" } } */
  38. /* { dg-final { cleanup-tree-dump "graphite" } } */
  39. /* { dg-final { scan-tree-dump-times "loopfn.0" 4 "optimized" } } */
  40. /* { dg-final { scan-tree-dump-times "loopfn.1" 4 "optimized" } } */
  41. /* { dg-final { cleanup-tree-dump "parloops" } } */
  42. /* { dg-final { cleanup-tree-dump "optimized" } } */