summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr45461.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr45461.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr45461.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr45461.c b/gcc/testsuite/gcc.dg/pr45461.c
new file mode 100644
index 000000000..7968f7335
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr45461.c
@@ -0,0 +1,18 @@
+/* PR middle-end/45461 */
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+int
+foo (int i, ...)
+{
+ short e;
+ va_list ap;
+ va_start (ap, i);
+ e = va_arg (ap, short); /* { dg-warning "is promoted" } */
+ va_end (ap);
+ return e;
+}
+
+/* { dg-message "note: \\(so you should pass" "" {target *-*-* } 12 } */
+/* { dg-message "note: if this code" "" {target *-*-* } 12 } */