diff options
author | David Malcolm <dmalcolm@redhat.com> | 2017-01-16 18:08:45 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2017-01-16 18:08:45 +0000 |
commit | 0ef1f9cd8c7a799a91b7d9ac776a4a8d3adaefa5 (patch) | |
tree | 69fe741f3d37e866225d72a8186ced2465b1a3cd /gcc | |
parent | 76689ffc1ef69892e36b9ca7d1efb9438d51d0b2 (diff) | |
download | gcc-0ef1f9cd8c7a799a91b7d9ac776a4a8d3adaefa5.zip gcc-0ef1f9cd8c7a799a91b7d9ac776a4a8d3adaefa5.tar.gz gcc-0ef1f9cd8c7a799a91b7d9ac776a4a8d3adaefa5.tar.bz2 |
Fix testcases for PR c/78304
The testcases as written made assumptions about size_t and long
being invalid for use with "%u".
We only need some invalid type, so this patch converts them to
attempt a "const char *" with "%u", which should be invalid for
every target.
gcc/testsuite/ChangeLog:
PR c/78304
* gcc.dg/format/pr78304.c: Convert argument from integral type
to a pointer.
* gcc.dg/format/pr78304-2.c: Likewise.
From-SVN: r244502
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/format/pr78304-2.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/format/pr78304.c | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 547272c..e8f00c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-01-16 David Malcolm <dmalcolm@redhat.com> + + PR c/78304 + * gcc.dg/format/pr78304.c: Convert argument from integral type + to a pointer. + * gcc.dg/format/pr78304-2.c: Likewise. + 2017-01-16 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/builtins-3.c: New vec_nabs testcase. diff --git a/gcc/testsuite/gcc.dg/format/pr78304-2.c b/gcc/testsuite/gcc.dg/format/pr78304-2.c index 5ee6d65..83648c4 100644 --- a/gcc/testsuite/gcc.dg/format/pr78304-2.c +++ b/gcc/testsuite/gcc.dg/format/pr78304-2.c @@ -5,7 +5,7 @@ extern int printf (const char *, ...); # define PRIu32 "u" -void test (long size) +void test (const char *msg) { - printf ("size: %" PRIu32 "\n", size); /* { dg-warning "expects argument of type" } */ + printf ("size: %" PRIu32 "\n", msg); /* { dg-warning "expects argument of type" } */ } diff --git a/gcc/testsuite/gcc.dg/format/pr78304.c b/gcc/testsuite/gcc.dg/format/pr78304.c index d0a96f6..f6ad807 100644 --- a/gcc/testsuite/gcc.dg/format/pr78304.c +++ b/gcc/testsuite/gcc.dg/format/pr78304.c @@ -4,7 +4,7 @@ #include <inttypes.h> #include <stdio.h> -void test (size_t size) +void test (const char *msg) { - printf ("size: %" PRIu32 "\n", size); /* { dg-warning "expects argument of type" } */ + printf ("size: %" PRIu32 "\n", msg); /* { dg-warning "expects argument of type" } */ } |