Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/strcmpopt_1.c @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | 84e7813d76e9 |
children | 1830386684a0 |
rev | line source |
---|---|
131 | 1 /* { dg-do run } */ |
2 /* { dg-options "-fdump-tree-gimple" } */ | |
3 | |
4 #include <string.h> | |
5 #include <stdlib.h> | |
6 | |
7 int cmp1 (char *p) | |
8 { | |
9 return strncmp (p, "fis", 4); | |
10 } | |
11 int cmp2 (char *q) | |
12 { | |
13 return strncmp ("fis", q, 4); | |
14 } | |
15 | |
16 int main () | |
17 { | |
18 | |
19 char *p = "fish"; | |
20 char *q = "fis\0"; | |
21 | |
22 if (cmp1 (p) == 0 || cmp2 (q) != 0) | |
23 abort (); | |
24 | |
25 return 0; | |
26 } | |
27 | |
28 /* { dg-final { scan-tree-dump-times "strcmp \\(" 2 "gimple" } } */ |