summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr22098-3.c
blob: 4c8a1c62ce05240dc089469bed23ecee905b2a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern void abort (void);
extern void exit (int);
typedef __SIZE_TYPE__ size_t;
int n = 0;
int f (void) { return ++n; }
int
main (void)
{
  int a = 0;
  int *p;
  size_t b;
  b = (size_t)(p = &(int []){0, f(), 2}[1]);
  if (*p != 1 || *(int *)b != 1 || n != 1)
    abort ();
  exit (0);
}