00001
00002
00003
00004 #include <stdlib.h>
00005
00006 int e;
00007
00008 int
00009 main ()
00010 {
00011 volatile int i, j = 10;
00012 e = 0;
00013 #pragma omp parallel for reduction(+:e)
00014 for (i = 0; i < j; i += 1)
00015 e++;
00016 if (e != 10)
00017 abort ();
00018 e = 0;
00019 #pragma omp parallel for reduction(+:e)
00020 for (i = 0; i < j; ++i)
00021 e++;
00022 if (e != 10)
00023 abort ();
00024 e = 0;
00025 #pragma omp parallel for reduction(+:e)
00026 for (i = 0; i < j; i++)
00027 e++;
00028 if (e != 10)
00029 abort ();
00030 e = 0;
00031 #pragma omp parallel for reduction(+:e)
00032 for (i = 0; i < 10; i += 1)
00033 e++;
00034 if (e != 10)
00035 abort ();
00036 e = 0;
00037 #pragma omp parallel for reduction(+:e)
00038 for (i = 0; i < 10; ++i)
00039 e++;
00040 if (e != 10)
00041 abort ();
00042 e = 0;
00043 #pragma omp parallel for reduction(+:e)
00044 for (i = 0; i < 10; i++)
00045 e++;
00046 if (e != 10)
00047 abort ();
00048 return 0;
00049 }