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