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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libmudflap/] [testsuite/] [libmudflap.c/] [fail33-frag.c] - Blame information for rev 275

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

Line No. Rev Author Line
1 275 jeremybenn
#include <stdlib.h>
2
 
3
#define SIZE 16
4
 
5
char b[SIZE];
6
char a[SIZE];
7
 
8
int main ()
9
{
10
  int i, j=0, k;
11
  int a_before_b = (& a[0] < & b[0]);
12
  /* Rather than iterating linearly, which would allow loop unrolling
13
     and mapping to pointer manipulation, we traverse the "joined"
14
     arrays in some random order.  */
15
  for (i=0; i<SIZE*2; i++)
16
    {
17
      k = rand() % (SIZE*2);
18
      j += (a_before_b ? a[k] : b[k]);
19
    }
20
  return j;
21
}
22
/* { dg-output "mudflap violation 1.*" } */
23
/* { dg-output "Nearby object.*" } */
24
/* { dg-output "mudflap object.*\[ab\]" } */
25
/* { dg-do run { xfail *-*-* } } */

powered by: WebSVN 2.1.0

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