aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr32721.c
blob: 392937ebbf6ed688dcbfd5365e64a877c8ba68ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

int spinlock[2];
int main ()
{
volatile int * spinlock0;
volatile int * spinlock1;
spinlock0 = &spinlock[0];
spinlock1 = &spinlock[1];

*spinlock0 = 0;
*spinlock1 = 0;
 while (*spinlock0);
}

/* { dg-final { scan-tree-dump "= spinlock.0." "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */