summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr39041.c
blob: cc58a8a37e05863ecaced1072cfec067a638455b (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
int test_bit(int nr, void *addr)
{
  int *a = (int *)addr;
  int mask;
  a += nr;
  mask = 1 << nr;
  return mask & *a;
}
struct {
    struct {
	int disabled;
    } *data[1];
} trace;
struct {
    unsigned bits[1];
} cpumask;
void inc(int *);
void dec(int *);
int foo(void)
{
  int cpu;
  for (cpu = 0; cpu < 1; cpu++) {
      if (test_bit(cpu, cpumask.bits))
	inc(&trace.data[cpu]->disabled);
      if (!test_bit(cpu, cpumask.bits))
	dec(&trace.data[cpu]->disabled);
  }
}