]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc.dg/20031012-1.c: New test.
authorSteven Bosscher <steven@gcc.gnu.org>
Sun, 12 Oct 2003 22:16:04 +0000 (22:16 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Sun, 12 Oct 2003 22:16:04 +0000 (22:16 +0000)
From-SVN: r72410

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

index 84f7c92d5d979d5552ac7df6c5ca3da7c4dbf7b3..96d41b6558d4a256b733aea127bec611f1079739 100644 (file)
@@ -1,3 +1,7 @@
+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.
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;
+}
+