1 /* PR tree-optimization/96670 - ICE on memchr with an empty initializer
3 { dg-options "-O -Wall -fdump-tree-optimized" } */
9 void memchr_success_unused (void)
11 int n
= (char *)&s
.j
- (char *)&s
;
13 __builtin_memchr (p
, '\0', n
);
16 void memchr_success_used (void)
18 int n
= (char *)&s
.j
- (char *)&s
;
20 if (&s
!= __builtin_memchr (p
, '\0', n
))
24 void memchr_fail_unused (void)
26 int n
= (char *)&s
.j
- (char *)&s
;
28 __builtin_memchr (p
, '\5', n
);
31 void memchr_fail_used (void)
33 int n
= (char *)&s
.j
- (char *)&s
;
35 if (__builtin_memchr (p
, '\5', n
))
39 /* { dg-prune-output "\\\[-Wunused-value" }
40 { dg-final { scan-tree-dump-not "abort" "optimized" } }
41 { dg-final { scan-tree-dump-not "memcmp \\(" "optimized" } } */