summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr46183.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr46183.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr46183.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr46183.c b/gcc/testsuite/gcc.dg/torture/pr46183.c
new file mode 100644
index 000000000..9582c34e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr46183.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-dse" } */
+
+void bar(void);
+
+void foo (int i, ...)
+{
+ __builtin_va_list ap;
+ __builtin_va_start (ap, i);
+ __builtin_va_arg (ap, int);
+ while (i) i++;
+ __builtin_va_arg (ap, int);
+ while (i) i++;
+ __builtin_va_arg (ap, int);
+ while (i) i++;
+ __builtin_va_arg (ap, int);
+ if (i)
+ bar ();
+}
+