OSDN Git Service

Add more testcases.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Feb 2010 17:41:15 +0000 (17:41 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Feb 2010 17:41:15 +0000 (17:41 +0000)
2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>

* testsuite/gcc.dg/graphite/id-17.c: New.
* testsuite/gcc.dg/graphite/pr41888.c: New.
* testsuite/gcc.dg/graphite/scop-22.c: New.
* testsuite/gfortran.dg/graphite/pr40982.f90: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156546 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog.graphite
gcc/testsuite/gcc.dg/graphite/id-17.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/graphite/pr41888.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/graphite/scop-22.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/graphite/pr40982.f90 [new file with mode: 0644]

index 03009a9..b398dd5 100644 (file)
@@ -1,5 +1,12 @@
 2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
 
+       * testsuite/gcc.dg/graphite/id-17.c: New.
+       * testsuite/gcc.dg/graphite/pr41888.c: New.
+       * testsuite/gcc.dg/graphite/scop-22.c: New.
+       * testsuite/gfortran.dg/graphite/pr40982.f90: New.
+
+2010-01-20  Sebastian Pop  <sebastian.pop@amd.com>
+
        * graphite-dependences.c: Clarify comments.
        (build_pddr): Add an extra parameter direction.
        (graphite_legal_transform_dr): Use build_pddr.
diff --git a/gcc/testsuite/gcc.dg/graphite/id-17.c b/gcc/testsuite/gcc.dg/graphite/id-17.c
new file mode 100644 (file)
index 0000000..c93c211
--- /dev/null
@@ -0,0 +1,21 @@
+typedef struct
+{
+  int offset_for_ref_frame[256];
+} seq_parameter_set_rbsp_t;
+
+typedef struct
+{
+  unsigned int num_ref_frames_in_pic_order_cnt_cycle;
+  int offset_for_ref_frame[1];
+  int auto_crop_right;
+} ImageParameters;
+
+ImageParameters *img;
+
+void GenerateSequenceParameterSet(seq_parameter_set_rbsp_t *sps)
+{
+  unsigned i;
+  for (i=0; i<img->num_ref_frames_in_pic_order_cnt_cycle; i++)
+    sps->offset_for_ref_frame[i] = img->offset_for_ref_frame[i];
+ error("foo");
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr41888.c b/gcc/testsuite/gcc.dg/graphite/pr41888.c
new file mode 100644 (file)
index 0000000..b262af6
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -ftree-loop-distribution -fgraphite-identity" } */
+
+int
+foo (int *x)
+{
+  int a[10], b[10];
+  int i;
+  a[9] = 8;
+  b[9] = 8;
+  for (i = 0; i < 9; i++)
+    {
+      a[i] = *x++;
+      b[i] = 1;
+    }
+  b[i] = b[i] & !(a[i] ^ *x++);
+  return b[i] ? i + 1 : 0;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/scop-22.c b/gcc/testsuite/gcc.dg/graphite/scop-22.c
new file mode 100644 (file)
index 0000000..b77be22
--- /dev/null
@@ -0,0 +1,21 @@
+double u[1782225];
+
+void foo(int N, int *res)
+{
+  int i;
+  double a, b;
+  double sum = 0.0;
+
+  for (i = 0; i < N; i++)
+    {
+      a = u[i];
+      u[i] = i * i;
+      b = u[i];
+      sum += a + b;
+    }
+
+  *res = sum + N;
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr40982.f90 b/gcc/testsuite/gfortran.dg/graphite/pr40982.f90
new file mode 100644 (file)
index 0000000..b9641ae
--- /dev/null
@@ -0,0 +1,69 @@
+! { dg-options "-O3 -fgraphite-identity -floop-interchange " }
+
+module mqc_m
+
+
+implicit none
+
+private
+public :: mutual_ind_quad_cir_coil
+
+integer, parameter, private :: longreal = selected_real_kind(15,90)
+real (kind = longreal), parameter, private :: pi = 3.141592653589793_longreal
+real (kind = longreal), parameter, private :: small = 1.0e-10_longreal
+
+contains
+
+      subroutine mutual_ind_quad_cir_coil (r_coil, x_coil, y_coil, z_coil, h_coil, n_coil,  &
+                                                      rotate_coil, m, mu, l12)
+      real (kind = longreal), intent(in) :: r_coil, x_coil, y_coil, z_coil, h_coil, n_coil, &
+                                            mu
+      real (kind = longreal), dimension(:,:), intent(in) :: rotate_coil
+      integer, intent(in) :: m
+      real (kind = longreal), intent(out) :: l12
+      real (kind = longreal), dimension(3,3) :: rotate_quad
+      real (kind = longreal), dimension(9), save :: x2gauss, y2gauss, w2gauss, z1gauss,     &
+                                                    w1gauss
+      real (kind = longreal) :: xxvec, xyvec, xzvec, yxvec, yyvec, yzvec, zxvec, zyvec,     &
+                                zzvec, magnitude, l12_lower, l12_upper, dx, dy, dz, theta,  &
+                                a, b1, b2, numerator, denominator, coefficient, angle
+      real (kind = longreal), dimension(3) :: c_vector, q_vector, rot_c_vector,             &
+                                              rot_q_vector, current_vector,                 &
+                                              coil_current_vec, coil_tmp_vector
+      integer :: i, j, k
+      logical, save :: first = .true.
+
+      do i = 1, 2*m
+          theta = pi*real(i,longreal)/real(m,longreal)
+          c_vector(1) = r_coil * cos(theta)
+          c_vector(2) = r_coil * sin(theta)
+          coil_tmp_vector(1) = -sin(theta)
+          coil_tmp_vector(2) = cos(theta)
+          coil_tmp_vector(3) = 0.0_longreal
+          coil_current_vec(1) = dot_product(rotate_coil(1,:),coil_tmp_vector(:))
+          coil_current_vec(2) = dot_product(rotate_coil(2,:),coil_tmp_vector(:))
+          coil_current_vec(3) = dot_product(rotate_coil(3,:),coil_tmp_vector(:))
+          do j = 1, 9
+              c_vector(3) = 0.5 * h_coil * z1gauss(j)
+              rot_c_vector(1) = dot_product(rotate_coil(1,:),c_vector(:)) + dx
+              rot_c_vector(2) = dot_product(rotate_coil(2,:),c_vector(:)) + dy
+              rot_c_vector(3) = dot_product(rotate_coil(3,:),c_vector(:)) + dz
+              do k = 1, 9
+                  q_vector(1) = 0.5_longreal * a * (x2gauss(k) + 1.0_longreal)
+                  q_vector(2) = 0.5_longreal * b1 * (y2gauss(k) - 1.0_longreal)
+                  q_vector(3) = 0.0_longreal
+                  rot_q_vector(1) = dot_product(rotate_quad(1,:),q_vector(:))
+                  rot_q_vector(2) = dot_product(rotate_quad(2,:),q_vector(:))
+                  rot_q_vector(3) = dot_product(rotate_quad(3,:),q_vector(:))
+                  numerator = w1gauss(j) * w2gauss(k) *                                     &
+                                                 dot_product(coil_current_vec,current_vector)
+                  denominator = sqrt(dot_product(rot_c_vector-rot_q_vector,                 &
+                                                                  rot_c_vector-rot_q_vector))
+                  l12_lower = l12_lower + numerator/denominator
+              end do
+          end do
+      end do
+      l12 = coefficient * (b1 * l12_lower + b2 * l12_upper)
+      end subroutine mutual_ind_quad_cir_coil
+
+end module mqc_m