aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr38048-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr38048-2.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr38048-2.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr38048-2.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr38048-2.c
new file mode 100644
index 00000000..bd0462d7
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr38048-2.c
@@ -0,0 +1,27 @@
+extern void abort (void);
+
+static int inv_J(int a[][2])
+{
+ int i, j;
+ int det = 0.0;
+ for (j=0; j<2; ++j)
+ det += a[j][0] + a[j][1];
+ return det;
+}
+
+int foo()
+{
+ int mat[2][2];
+ mat[0][0] = 1;
+ mat[0][1] = 2;
+ mat[1][0] = 4;
+ mat[1][1] = 8;
+ return inv_J(mat);
+}
+
+int main()
+{
+ if (foo () != 15)
+ abort ();
+ return 0;
+}