* gcc.dg/20031012-1.c: New test.
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 12 Oct 2003 22:16:04 +0000 (22:16 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 12 Oct 2003 22:16:04 +0000 (22:16 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72410 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20031012-1.c [new file with mode: 0644]

index 84f7c92..96d41b6 100644 (file)
@@ -1,5 +1,9 @@
 2003-10-12  Steven Bosscher  <steven@gcc.gnu.org>
 
+       * gcc.dg/20031012-1.c: New test.
+
+2003-10-12  Steven Bosscher  <steven@gcc.gnu.org>
+
        * gcc.dg/weak/weak-3.c: Fix for new warning.
 
 2003-10-12  Kelley Cook  <kcook@gcc.gnu.org>
diff --git a/gcc/testsuite/gcc.dg/20031012-1.c b/gcc/testsuite/gcc.dg/20031012-1.c
new file mode 100644 (file)
index 0000000..215c2b9
--- /dev/null
@@ -0,0 +1,17 @@
+/* Origin: Andrew Morton <akpm@osdl.org> */
+/* Warn if a function addres of a non-weak function is used
+   as a truth value.  */
+/* See thread starting at http://gcc.gnu.org/ml/gcc/2003-10/msg00414.html  */
+
+void foo(void)
+{}
+
+void bar(void)
+{}
+
+int main() {
+       if (foo) /* { dg-warning "" } */
+               bar();
+       return 0;
+}
+