Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / warn / Wstring-literal-comparison-1.C
blobc5dea463b51d05ad60f0b79dec8eaf6f525c7a18
1 /* PR c/7776 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wstring-literal-comparison" } */
5 int test1(char *ptr)
7   return ptr == "foo";  /* { dg-warning "comparison with string" } */
10 int test2()
12   return "foo" != (const char*)0;
15 int test3()
17   return "foo" == (const char*)0;
20 int test4()
22   return (const char*)0 != "foo";
25 int test5()
27   return (const char*)0 == "foo";