force-parallel-2.c 690 B

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