summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/921109-3.c
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-01-06 01:47:28 -0800
committerYamaArashi <shadow962@live.com>2016-01-06 01:47:28 -0800
commitbe8b04496302184c6e8f04d6179f9c3afc50aeb6 (patch)
tree726e2468c0c07add773c0dbd86ab6386844259ae /gcc/testsuite/gcc.c-torture/compile/921109-3.c
initial commit
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/921109-3.c')
-rwxr-xr-xgcc/testsuite/gcc.c-torture/compile/921109-3.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/921109-3.c b/gcc/testsuite/gcc.c-torture/compile/921109-3.c
new file mode 100755
index 0000000..40e63f2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/921109-3.c
@@ -0,0 +1,46 @@
+/* EXTRA_OPTIONS: -fcaller-saves */
+
+extern char *malloc();
+
+main()
+{
+ char w[1000];
+ int i, j, nres, t[1000];
+ float dv, (**dmat)[4][4];
+ short at1, at2;
+
+ nres = 200;
+
+ for (i = 0; i < nres; i++)
+ {
+ w[i] = rand() & 15;
+ t[i] = 0;
+ }
+
+ dmat = (float (**)[4][4]) malloc(nres * sizeof(*dmat));
+ if (!dmat)
+ return 1;
+ for (i = 0; i < nres; i++)
+ {
+ dmat[i] = (float (*)[4][4]) malloc(nres * sizeof(**dmat));
+ if (!dmat[i])
+ return 1;
+ }
+
+ for (i = 0; i < nres; i++)
+ for (j = i; j < nres; j++)
+ for (at1 = 0; at1 <= 3; at1++)
+ for (at2 = 0; at2 <= 3; at2++)
+ if (i != j || at1 != at2)
+ if ((w[i] & (1 << at1)) && (w[j] & (1 << at2)))
+ {
+ dv = 20.0 * (rand() & 32767) / 32768.0;
+ dmat[i][j][at1][at2] = dmat[j][i][at2][at1] = dv;
+ }
+ else
+ dmat[i][j][at1][at2] = dmat[j][i][at2][at1] = 999.0;
+ else
+ dmat[i][j][at1][at2] = 0.0;
+
+ return 0;
+}