aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format/ext-3.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2001-01-07 10:44:59 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2001-01-07 10:44:59 +0000
commit42110e7b0f32c645e044e814e6d8f44823c7c53d (patch)
tree09e466d179dd9978c2d5c6df6799a5862c668fec /gcc/testsuite/gcc.dg/format/ext-3.c
parent96a45535c32b2f22650347c5152dd0e791e8582d (diff)
downloadgcc-42110e7b0f32c645e044e814e6d8f44823c7c53d.zip
gcc-42110e7b0f32c645e044e814e6d8f44823c7c53d.tar.gz
gcc-42110e7b0f32c645e044e814e6d8f44823c7c53d.tar.bz2
format.h: New file.
* gcc.dg/format/format.h: New file. * gcc.dg/format/array-1.c, gcc.dg/format/attr-1.c, gcc.dg/format/branch-1.c, gcc.dg/format/c90-printf-1.c, gcc.dg/format/c90-printf-2.c, gcc.dg/format/c90-printf-3.c, gcc.dg/format/c90-scanf-1.c, gcc.dg/format/c90-scanf-2.c, gcc.dg/format/c90-scanf-3.c, gcc.dg/format/c90-scanf-4.c, gcc.dg/format/c90-strftime-1.c, gcc.dg/format/c90-strftime-2.c, gcc.dg/format/c94-printf-1.c, gcc.dg/format/c94-scanf-1.c, gcc.dg/format/c99-printf-1.c, gcc.dg/format/c99-printf-2.c, gcc.dg/format/c99-printf-3.c, gcc.dg/format/c99-scanf-1.c, gcc.dg/format/c99-scanf-2.c, gcc.dg/format/c99-scanf-3.c, gcc.dg/format/c99-strftime-1.c, gcc.dg/format/c99-strftime-2.c, gcc.dg/format/diag-1.c, gcc.dg/format/errmk-1.c, gcc.dg/format/ext-1.c, gcc.dg/format/ext-2.c, gcc.dg/format/ext-3.c, gcc.dg/format/ext-4.c, gcc.dg/format/ext-5.c, gcc.dg/format/miss-1.c, gcc.dg/format/miss-2.c, gcc.dg/format/no-exargs-1.c, gcc.dg/format/no-y2k-1.c, gcc.dg/format/nonlit-1.c, gcc.dg/format/nonlit-2.c, gcc.dg/format/nonlit-3.c, gcc.dg/format/sec-1.c, gcc.dg/format/strfmon-1.c, gcc.dg/format/va-1.c, gcc.dg/format/warnll-1.c, gcc.dg/format/xopen-1.c, gcc.dg/format/z-1.c: Include "format.h" instead of declaring standard types, macros and functions in each test. From-SVN: r38767
Diffstat (limited to 'gcc/testsuite/gcc.dg/format/ext-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/format/ext-3.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/testsuite/gcc.dg/format/ext-3.c b/gcc/testsuite/gcc.dg/format/ext-3.c
index ea9f2e0..e71731e 100644
--- a/gcc/testsuite/gcc.dg/format/ext-3.c
+++ b/gcc/testsuite/gcc.dg/format/ext-3.c
@@ -5,11 +5,7 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -Wformat" } */
-typedef __SIZE_TYPE__ size_t;
-
-struct tm;
-
-extern size_t strftime (char *, size_t, const char *, const struct tm *);
+#include "format.h"
void
foo (char *s, size_t m, const struct tm *tp)
@@ -102,6 +98,10 @@ foo (char *s, size_t m, const struct tm *tp)
strftime (s, m, "%-x", tp); /* { dg-warning "flag" "bad %x" } */
strftime (s, m, "%_x", tp); /* { dg-warning "flag" "bad %x" } */
strftime (s, m, "%0x", tp); /* { dg-warning "flag" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 89 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 90 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 91 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 92 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 93 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 94 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 95 } */
@@ -110,10 +110,6 @@ foo (char *s, size_t m, const struct tm *tp)
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 98 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 99 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 100 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 101 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 102 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 103 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 104 } */
/* Incorrect usages with GNU extension conversion characters. */
strftime (s, m, "%5P", tp); /* { dg-warning "width" "bad %P" } */
strftime (s, m, "%-P", tp); /* { dg-warning "flag" "bad %P" } */
@@ -193,16 +189,16 @@ foo (char *s, size_t m, const struct tm *tp)
strftime (s, m, "%#x", tp); /* { dg-warning "flag" "bad %x" } */
strftime (s, m, "%^y", tp); /* { dg-warning "flag" "bad %y" } */
strftime (s, m, "%#y", tp); /* { dg-warning "flag" "bad %y" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 182 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 183 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 184 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 185 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 186 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 187 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 188 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 189 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 190 } */
/* { dg-warning "only last 2" "2-digit year" { target *-*-* } 191 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 192 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 193 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 194 } */
- /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 195 } */
/* GCC also accepts the glibc format extensions %P, %k, %l, %s. */
strftime (s, m, "%P%k%l%s", tp);
/* GCC also accepts the glibc extension of the "O" modifier on some