2 /* { dg-options "-O2 -fdump-tree-strlen" } */
4 char s
[100] = {'a','b','c','d'};
5 typedef struct { char s
[8]; int x
; } S
;
7 __attribute__ ((noinline
)) int
10 /* Member arrays not handled due to the fix for PR 92765. */
11 return 0; // __builtin_strcmp (s->s, "abc") != 0;
14 __attribute__ ((noinline
)) int
17 return __builtin_strcmp (s
, "abc") != 0;
20 __attribute__ ((noinline
)) int
23 return 0; // __builtin_strcmp ("abc", s->s) != 0;
26 __attribute__ ((noinline
)) int
29 return __builtin_strcmp ("abc", s
) != 0;
32 __attribute__ ((noinline
)) int
35 return 0; // __builtin_strncmp (s->s, "abc", 3) != 0;
38 __attribute__ ((noinline
)) int
41 return __builtin_strncmp (s
, "abc", 2) != 0;
44 __attribute__ ((noinline
)) int
47 return 0; // __builtin_strncmp ("abc", s->s, 3) != 0;
50 __attribute__ ((noinline
)) int
53 return __builtin_strncmp ("abc", s
, 2) != 0;
58 S ss
= {{'a','b','c'}, 2};
60 if (f1 (&ss
) != 0 || f2 () != 1 || f3 (&ss
) != 0 ||
61 f4 () != 1 || f5 (&ss
) != 0 || f6 () != 0 ||
62 f7 (&ss
) != 0 || f8 () != 0)
68 /* { dg-final { scan-tree-dump-times "cmp_eq \\(" 4 "strlen1" } } */