Revert r135493 & r135463
[official-gcc.git] / libmudflap / testsuite / libmudflap.c / fail33-frag.c
blobac7c617a4ebb72bf828da10ecb4d291e76a43594
1 #include <stdlib.h>
3 #define SIZE 16
5 char b[SIZE];
6 char a[SIZE];
8 int main ()
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++)
17 k = rand() % (SIZE*2);
18 j += (a_before_b ? a[k] : b[k]);
20 return j;
22 /* { dg-output "mudflap violation 1.*" } */
23 /* { dg-output "Nearby object.*" } */
24 /* { dg-output "mudflap object.*\[ab\]" } */
25 /* { dg-do run { xfail *-*-* } } */