summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/assign-3.c
blob: e5426d781e593f31e98b9b14741b66566bad7a60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do run } */
/* { dg-options "-O2 -fdump-tree-gimple" } */

extern void abort (void);
struct S { int i; };
struct S arr[32];
volatile int count = 0;

struct S __attribute__((noinline))
incr ()
{
  ++count;
}

int main()
{
  arr[count++] = incr ();
  if (count != 2)
    abort ();
  return 0;
}

/* { dg-final { scan-tree-dump-times " = count;" 3 "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */