summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtin-object-size-11.c
blob: a98bc356c47e465feb99fdbca19be91be720d87c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR48985 */
/* { dg-do run } */
/* { dg-options "-std=gnu89" } */

extern void abort (void);

struct s {
    int i;
    char c[];
} s = { 1, "01234" };

__SIZE_TYPE__ f (void) { return __builtin_object_size (&s.c, 0); }

int
main()
{
  if (f() != sizeof ("01234"))
    abort ();

  return 0;
}