]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Tue, 23 Dec 2003 06:23:37 +0000 (06:23 +0000)
committerNo Author <no-author@gcc.gnu.org>
Tue, 23 Dec 2003 06:23:37 +0000 (06:23 +0000)
'gcc-3_3-branch'.

From-SVN: r74962

gcc/testsuite/g++.dg/lookup/ns1.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/noreturn-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/null-pointer-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/lookup/ns1.C b/gcc/testsuite/g++.dg/lookup/ns1.C
new file mode 100644 (file)
index 0000000..feeaf75
--- /dev/null
@@ -0,0 +1,22 @@
+// PR c++/12862
+
+typedef int Thingo;
+  
+namespace A
+{
+    void
+    Thingo();
+}
+  
+void
+A::Thingo()
+{
+  ;
+}
+  
+int
+main()
+{
+  A::Thingo();
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc/testsuite/gcc.dg/noreturn-7.c
new file mode 100644 (file)
index 0000000..1d94a7c
--- /dev/null
@@ -0,0 +1,42 @@
+/* PR optimization/13394 */
+/* Origin: Carlo Wood <carlo@gcc.gnu.org> */
+
+/* Verify that a bogus "function does return" warning is not issued
+   in presence of tail recursion within a noreturn function.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wreturn-type -Wmissing-noreturn" } */
+
+
+void f(void) __attribute__ ((__noreturn__));
+void _exit(int status) __attribute__ ((__noreturn__));
+
+int z = 0;
+
+void g()
+{
+  if (++z > 10)
+    _exit(0);
+  g();
+}             /* { dg-warning "possible candidate" } */
+
+void f()
+{
+  if (++z > 10)
+    _exit(0);
+  f();
+}             /* { dg-bogus "does return" } */
+
+int h()
+{
+  if (++z > 10)
+    _exit(0);
+  return h();
+}             /* { dg-bogus "end of non-void function" } */
+
+int k()
+{
+  if (++z > 10)
+    _exit(0);
+  k();
+}             /* { dg-warning "end of non-void function" } */
diff --git a/gcc/testsuite/gcc.dg/null-pointer-1.c b/gcc/testsuite/gcc.dg/null-pointer-1.c
new file mode 100644 (file)
index 0000000..8cc15c6
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR c/13382 */
+/* Origin: Richard Hutchinson <richard.hutchinson@asa.co.uk> */
+
+/* Verify that the null initializer is converted to the right
+   pointer type.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct t
+{
+  int aMember;
+};
+
+struct t *const aPointer = 0;
+
+void foo()
+{
+  int anInt = (aPointer == 0) ? 0 : aPointer->aMember;
+}