summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-26 23:58:04 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-26 23:58:04 +0000
commit58db2592787518a0c3d3ac400ca4af602e7a03ca (patch)
treeb6cc6b305db8b4514a4e4e05aef654458f32633d /gcc/testsuite
parent882e3bab8d13c1432a57c0955261606af76e8ede (diff)
downloadgcc-58db2592787518a0c3d3ac400ca4af602e7a03ca.tar.gz
PR c/20740
* c-format.c (init_dynamic_asm_fprintf_info): Give errors, not assertion failures, if __gcc_host_wide_int__ is not properly defined. (init_dynamic_diag_info): Give errors, not assertion failures, if location_t, tree or __gcc_host_wide_int__ are not properly defined. testsuite: * gcc.dg/format/asm_fprintf-2.c, gcc.dg/format/asm_fprintf-3.c, gcc.dg/format/asm_fprintf-4.c, gcc.dg/format/asm_fprintf-5.c, gcc.dg/format/gcc_diag-2.c, gcc.dg/format/gcc_diag-3.c, gcc.dg/format/gcc_diag-4.c, gcc.dg/format/gcc_diag-5.c, gcc.dg/format/gcc_diag-6.c, gcc.dg/format/gcc_diag-7.c , gcc.dg/format/gcc_diag-8.c, gcc.dg/format/gcc_diag-9.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98800 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/gcc.dg/format/asm_fprintf-2.c9
-rw-r--r--gcc/testsuite/gcc.dg/format/asm_fprintf-3.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/asm_fprintf-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/asm_fprintf-5.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-3.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-5.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-6.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-7.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-8.c10
-rw-r--r--gcc/testsuite/gcc.dg/format/gcc_diag-9.c10
13 files changed, 129 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1c08f013b8a..0f6ab3d57ce 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2005-04-27 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/20740
+ * gcc.dg/format/asm_fprintf-2.c, gcc.dg/format/asm_fprintf-3.c,
+ gcc.dg/format/asm_fprintf-4.c, gcc.dg/format/asm_fprintf-5.c,
+ gcc.dg/format/gcc_diag-2.c, gcc.dg/format/gcc_diag-3.c,
+ gcc.dg/format/gcc_diag-4.c, gcc.dg/format/gcc_diag-5.c,
+ gcc.dg/format/gcc_diag-6.c, gcc.dg/format/gcc_diag-7.c ,
+ gcc.dg/format/gcc_diag-8.c, gcc.dg/format/gcc_diag-9.c: New tests.
+
2005-04-26 Jeff Law <law@redhat.com>
* gcc.gc/tree-ssa/ssa-dce-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c
new file mode 100644
index 00000000000..847eeee282f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c
@@ -0,0 +1,9 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not used at all, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c
new file mode 100644
index 00000000000..f5fd5c022fc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not defined, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int __gcc_host_wide_int__);
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c
new file mode 100644
index 00000000000..9de05134af3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not a type, asm_fprintf. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c b/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c
new file mode 100644
index 00000000000..14ffb60d32e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", bad type, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as 'long' or 'long long'" } */
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-2.c b/gcc/testsuite/gcc.dg/format/gcc_diag-2.c
new file mode 100644
index 00000000000..60c6835da9e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-2.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int tree);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-3.c b/gcc/testsuite/gcc.dg/format/gcc_diag-3.c
new file mode 100644
index 00000000000..1a7848ed9f2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-3.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int tree;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: 'tree' is not defined as a type" } */
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-4.c b/gcc/testsuite/gcc.dg/format/gcc_diag-4.c
new file mode 100644
index 00000000000..20661c41f71
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-4.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ a pointer type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int tree;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: 'tree' is not defined as a pointer type" } */
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-5.c b/gcc/testsuite/gcc.dg/format/gcc_diag-5.c
new file mode 100644
index 00000000000..f8f12d68cdd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-5.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "location_t", not defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int location_t);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-6.c b/gcc/testsuite/gcc.dg/format/gcc_diag-6.c
new file mode 100644
index 00000000000..fdb493d4973
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-6.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "location_t", not a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int location_t;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: 'location_t' is not defined as a type" } */
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-7.c b/gcc/testsuite/gcc.dg/format/gcc_diag-7.c
new file mode 100644
index 00000000000..fccf5d24041
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-7.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int __gcc_host_wide_int__);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-8.c b/gcc/testsuite/gcc.dg/format/gcc_diag-8.c
new file mode 100644
index 00000000000..835ec3f98d3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-8.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc/testsuite/gcc.dg/format/gcc_diag-9.c b/gcc/testsuite/gcc.dg/format/gcc_diag-9.c
new file mode 100644
index 00000000000..6481c26caf7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/gcc_diag-9.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", bad type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "error: '__gcc_host_wide_int__' is not defined as 'long' or 'long long'" } */