aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20031214-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20031214-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20031214-1.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20031214-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20031214-1.c
new file mode 100644
index 000000000..e52200c01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20031214-1.c
@@ -0,0 +1,32 @@
+/* PR optimization/10312 */
+/* Originator: Peter van Hoof <p dot van-hoof at qub dot ac dot uk> */
+
+/* Verify that the strength reduction pass doesn't find
+ illegitimate givs. */
+
+struct
+{
+ double a;
+ int n[2];
+} g = { 0., { 1, 2}};
+
+int k = 0;
+
+void
+b (int *j)
+{
+}
+
+int
+main ()
+{
+ int j;
+
+ for (j = 0; j < 2; j++)
+ k = (k > g.n[j]) ? k : g.n[j];
+
+ k++;
+ b (&j);
+
+ return 0;
+}