Corrected date in changelog
[official-gcc.git] / gcc / testsuite / gcc.dg / strcmpopt_1.c
blob40596a20b40088d643ccc0a4f60e5cf5005a8a2b
1 /* { dg-do run } */
2 /* { dg-options "-fdump-tree-gimple" } */
4 #include <string.h>
5 #include <stdlib.h>
7 int cmp1 (char *p)
9 return strncmp (p, "fis", 4);
11 int cmp2 (char *q)
13 return strncmp ("fis", q, 4);
16 int main ()
19 char *p = "fish";
20 char *q = "fis\0";
22 if (cmp1 (p) == 0 || cmp2 (q) != 0)
23 abort ();
25 return 0;
28 /* { dg-final { scan-tree-dump-times "strcmp \\(" 2 "gimple" } } */