OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [vect/] [pr33834_1.cc] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
 
3
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
4
 
5
extern double cos (double x);
6
extern double sin (double x);
7
 
8
class bend_class
9
{
10
  double *s_A;
11
public:
12
  void set_s_A (double s_A0)
13
  {
14
    s_A[0] = s_A0;
15
  }
16
};
17
class bend_set
18
{
19
  bend_class *bend_array;
20
public:
21
  void set_s_A (int index, double s_A0)
22
  {
23
    bend_array[index].set_s_A (s_A0);
24
  }
25
  void compute_s (void)
26
  {
27
    int i, j;
28
    double val;
29
    double tmp[3];
30
    for (i = 0; i < 5; ++i)
31
    {
32
      val = i;
33
      for (j = 0; j < 2; ++j)
34
        tmp[j] = cos (val);
35
      set_s_A (i, tmp[0]);
36
      tmp[j] = cos (val) / sin (val);
37
    }
38
  }
39
};
40
class internals
41
{
42
  bend_set bend;
43
  void compute_s (void);
44
};
45
void
46
internals::compute_s (void)
47
{
48
  bend.compute_s ();
49
}
50
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.