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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [vla9.C] - Blame information for rev 821

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/43555
2
// { dg-options "" }
3
// { dg-do run }
4
 
5
extern "C" void * malloc (__SIZE_TYPE__);
6
extern "C" int printf (const char *, ...);
7
extern "C" void abort(void);
8
 
9
int nx,ny;
10
 
11
void f(double *x1d,int choice)
12
{
13
  double (*x2d)[nx][ny]=(double(*)[nx][ny])x1d;
14
  unsigned long delta;
15
//  (*x2d)[0][0]=123; // <- this line affects the result
16
  if (choice!=0)
17
  {
18
    delta=&(*x2d)[1][0]-x1d;
19
  }
20
  else
21
  {
22
    delta=&(*x2d)[1][0]-x1d;
23
  }
24
  printf("Choice: %d, Delta: %ld\n",choice,delta);
25
  if (delta != ny)
26
    abort ();
27
}
28
 
29
int main()
30
{
31
  double *data;
32
  nx=100;
33
  ny=100;
34
  data=(double*)malloc(nx*ny*sizeof(double));
35
  f(data,0);
36
  f(data,1);
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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