Revert r135493 & r135463
[official-gcc.git] / libmudflap / testsuite / libmudflap.c / pass26-frag.c
blob5a72f5b790c5464371c4e4a191592961120e76c6
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 int main ()
6 volatile int *p;
8 __mf_set_options ("-wipe-stack -no-check-initialization");
11 volatile int array [10];
12 p = & array[0];
14 array[0] = 2;
15 array[9] = 5;
17 /* Array[] should be wiped clean at this point. */
20 __mf_set_options ("-no-wipe-stack");
23 volatile int array2[10];
25 /* hope that this is allocated on top of old array[] */
26 if (p != & array2[0])
27 exit (0); /* Test is not applicable. */
29 array2[5] = 6;
31 /* Old values shouldn't still be around; the new one should. */
32 if (p[0] == 2 || p[9] == 5 || p[5] != 6)
33 abort() ;
35 /* array2[] should not be wiped at this point! */
39 volatile int array3[10];
41 /* hope that this is allocated on top of old array[] and array2[]*/
42 if (p != & array3[0])
43 exit (0); /* Test is not applicable. */
45 array3[1] = 2;
47 /* Check that old assignment is still around. */
48 if (p[5] != 6 || p[1] != 2)
49 abort() ;
51 return 0;