aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr81741.c
blob: a162c3cf58ffb708032e7a5ed4942ebb70802960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-O2 -w -fdump-tree-dom2-details" } */

#include <string.h>

typedef struct string_s {
  unsigned long size, alloc;
  char *ptr;
} string_t[1];

# define M_ASSUME(x)                                    \
  (! __builtin_constant_p (!!(x) || !(x)) || (x) ?      \
   (void) 0 : __builtin_unreachable())

int f(string_t s)
{
  M_ASSUME(strlen(s->ptr) == s->size);
  return s->size;
}

/* { dg-final { scan-assembler-not "strlen" } } */