commit 98914990eab010c977c21958e317de76e11b9c7a
Author: Maxim Blumenthal <maxim.blumenthal@intel.com>
Date:   Tue Jul 21 10:16:25 2015 +0300

    Reduced computation complexity in tests
    for simd pragma to make the execution
    time reasonable.

diff --git a/libgomp/testsuite/libgomp.c/examples-4/simd-7.c b/libgomp/testsuite/libgomp.c/examples-4/simd-7.c
index 4aab962..732cd91 100644
--- a/libgomp/testsuite/libgomp.c/examples-4/simd-7.c
+++ b/libgomp/testsuite/libgomp.c/examples-4/simd-7.c
@@ -5,17 +5,27 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#define N 45
+#define N 30
 int a[N], a_ref[N], b[N];
 
 #pragma omp declare simd inbranch
 int fib( int n )
 {
-   if (n <= 2)
-      return n;
-   else {
-      return fib(n-1) + fib(n-2);
-   }
+  if (n <= 1)
+    return n;
+  else
+    return fib(n-1) + fib(n-2);
+}
+
+void fib_ref()
+{
+  int i;
+
+  a_ref[0] = 0;
+  a_ref[1] = 1;
+
+  for (i=2; i < N; i++)
+    a_ref[i] = a_ref[i-2] + a_ref[i-1];
 }
 
 int main(void)
@@ -30,8 +40,7 @@ int main(void)
   for (i=0; i < N; i++)
     a[i] = fib(b[i]);
 
-  for (i=0; i < N; i++)
-    a_ref[i] = fib(b[i]);
+  fib_ref ();
 
   for (i=0; i < N; i++)
     if (a[i] != a_ref[i])
diff --git a/libgomp/testsuite/libgomp.fortran/examples-4/simd-7.f90 b/libgomp/testsuite/libgomp.fortran/examples-4/simd-7.f90
index a61bb03..7560657 100644
--- a/libgomp/testsuite/libgomp.fortran/examples-4/simd-7.f90
+++ b/libgomp/testsuite/libgomp.fortran/examples-4/simd-7.f90
@@ -4,9 +4,9 @@
 
 program fibonacci
    implicit none
-   integer,parameter :: N=45
+   integer,parameter :: N=30
    integer           :: a(0:N-1), b(0:N-1)
-   integer           :: a_ref(0:N-1), b_ref(0:N-1)
+   integer           :: a_ref(0:N-1)
    integer           :: i
    integer, external :: fib
 
@@ -15,35 +15,39 @@ program fibonacci
       b(i) = i
    end do
 
-   do i = 0,N-1
-      b_ref(i) = i
-   end do
-
    !$omp simd
    do i=0,N-1
       a(i) = fib(b(i))
    end do
 
-   do i=0,N-1
-      a_ref(i) = fib(b_ref(i))
-   end do
+   call fib_ref (a_ref, N)
 
    do i = 0, N-1
      if (a(i) .ne. a_ref(i)) call abort ()
    end do
 
-   if (a(44) .ne. 1134903170) call abort()
-
 end program
 
 recursive function fib(n) result(r)
 !$omp declare simd(fib) inbranch
    integer  :: n, r
 
-   if (n <= 2) then
-      r = n
+   if (n <= 1) then
+       r = n
    else
       r = fib(n-1) + fib(n-2)
    endif
 
 end function fib
+
+subroutine fib_ref(a_ref, n)
+   integer  :: n, a_ref(0:n-1)
+
+   a_ref(0) = 0
+   a_ref(1) = 1
+
+   do i = 2, n-1
+     a_ref(i) = a_ref(i-1) + a_ref(i-2)
+   end do
+
+end subroutine fib_ref
