qa: simplify test that crash with -O2

This commit is contained in:
Giacomo Tesio 2017-05-22 23:18:47 +02:00
parent 1eb450510a
commit f9c63742bb
1 changed files with 5 additions and 13 deletions

View File

@ -20,7 +20,7 @@
#define Mb (1024*1024) #define Mb (1024*1024)
/* /* This program cause an exception if libc is compiled with -O2
*/ */
void void
main(int argc, char**argv) main(int argc, char**argv)
@ -29,18 +29,10 @@ main(int argc, char**argv)
int i, j; int i, j;
j = 5; j = 5;
/* v = malloc(j*Mb);
for(j = 5; i > 0; j--){ for(i = 0; i < j*Mb; i += 512)
v = malloc(j*Mb); v[i] = 'a';
for(i = 0; i < j*Mb; i += 512) free(v);
v[i] = 'a';
free(v);
}
*/
v = malloc(j*Mb);
for(i = 0; i < j*Mb; i += 512)
v[i] = 'a';
free(v);
print("PASS\n"); print("PASS\n");
exits("PASS"); exits("PASS");