aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/c90-auto-1.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c90-auto-1.c b/gcc/testsuite/gcc.dg/c90-auto-1.c
new file mode 100644
index 0000000..f00f767
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c90-auto-1.c
@@ -0,0 +1,12 @@
+/* Test auto with implicit int for C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=c90 -pedantic-errors" } */
+
+void
+f (void)
+{
+ /* This should have type int following C90 rules, whereas in C2x it
+ would have type double. */
+ auto x = 1.5;
+ int *p = &x;
+}