summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr40792.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr40792.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr40792.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr40792.c b/gcc/testsuite/gcc.dg/pr40792.c
new file mode 100644
index 000000000..41f080e54
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr40792.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/40792 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void foo (int, char *, int *);
+
+void
+bar (int *a, int *b, ...)
+{
+ int c;
+ char d[256];
+ foo (*b, d, &c);
+}
+
+static int a, b;
+
+void
+baz (int c)
+{
+ bar (&a, &b);
+}