summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr18241-3.c
blob: 869b1e914122361537dec55f855acf40f7fd474f (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
25
26
27
28
29
30
31
/* { dg-do run } */
/* { dg-options "-O1" } */ 

void abort (void);

void radix_tree_tag_clear (int *node)
{
	int *path[2], **pathp = path, height;
	volatile int *addr;
	
	height = 1;
	pathp[0] = node;
	
	while (height > 0) {
		pathp[1] = pathp[0];
		pathp++;
		height--;
	}
	
	addr = pathp[0];
	*addr = 1;
}

int main ()
{
	int n;
	radix_tree_tag_clear (&n);
	if (n != 1)
		abort ();
	return 0;
}