aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-11-03 03:30:36 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2005-11-03 03:30:36 +0000
commita92c58c27304547c9c75e4cbb0a2ad92f55c17e0 (patch)
tree0bb7ecb15bb976867a17f2fbee102eb3956a45b4 /gcc/testsuite/gcc.dg
parent150cdc9e16e86173fe7116e12dbcc4cc8fb6b789 (diff)
downloadgcc-a92c58c27304547c9c75e4cbb0a2ad92f55c17e0.zip
gcc-a92c58c27304547c9c75e4cbb0a2ad92f55c17e0.tar.gz
gcc-a92c58c27304547c9c75e4cbb0a2ad92f55c17e0.tar.bz2
re PR c/24329 (segfault with -Wall and long integer literal)
PR c/24329 * c-pretty-print.c (pp_c_type_specifier): Do not recurse if c_common_type_for_mode returns an unnamed type. testsuite: * gcc.dg/format/unnamed-1.c: New test. From-SVN: r106421
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/format/unnamed-1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/format/unnamed-1.c b/gcc/testsuite/gcc.dg/format/unnamed-1.c
new file mode 100644
index 0000000..5fc11a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/unnamed-1.c
@@ -0,0 +1,22 @@
+/* Test for warnings with possibly unnamed integer types. Bug 24329. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+/* Definition of TItype follows same logic as in gcc.dg/titype-1.c,
+ but must be a #define to avoid giving the type a name. */
+#if defined(__LP64__) && !defined(__hppa__)
+#define TItype int __attribute__ ((mode (TI)))
+#else
+#define TItype long
+#endif
+
+void
+f (TItype x)
+{
+ printf("%d", x); /* { dg-warning "expects type" } */
+ printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects type" } */
+ /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 20 } */
+}