force-parallel-9.c 887 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. void abort (void);
  2. #define N 500
  3. int Z[2*N+2][2*N+2], B[2*N+2][2*N+2];
  4. void foo(void)
  5. {
  6. int i,j;
  7. for (i = 0; i < 2*N+2; i++)
  8. for (j = 0; j < 2*N+2; j++)
  9. B[i][j] = Z[i][j] = i + j;
  10. for (i = 0; i <= N; i++)
  11. for (j = 0; j <= N; j++)
  12. Z[i][j] = Z[j+N][i+N+1];
  13. for (i = 0; i <= N; i++)
  14. for (j = 0; j <=N; j++)
  15. if (Z[i][j] != B[j+N][i+N+1])
  16. abort();
  17. }
  18. int main(void)
  19. {
  20. foo();
  21. return 0;
  22. }
  23. /* Check that parallel code generation part make the right answer. */
  24. /* { dg-final { scan-tree-dump-times "4 loops carried no dependency" 1 "graphite" } } */
  25. /* { dg-final { cleanup-tree-dump "graphite" } } */
  26. /* { dg-final { scan-tree-dump-times "loopfn.0" 4 "optimized" } } */
  27. /* { dg-final { scan-tree-dump-times "loopfn.1" 4 "optimized" } } */
  28. /* { dg-final { cleanup-tree-dump "parloops" } } */
  29. /* { dg-final { cleanup-tree-dump "optimized" } } */