summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-icf-29.c
blob: 758399535345d75a3c6e327a10a69f9f6111c056 (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-icf -fno-inline"  } */

struct str
{
  unsigned a:1, b:1;
};

static struct str test;

unsigned foo(struct str *s)
{
  return s->a;
}

unsigned bar(struct str *s)
{
  return s->b;
}

int main()
{
  test.a = 0;
  test.b = 1;

  return foo (&test) != bar (&test);
}

/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf"  } } */
/* { dg-final { cleanup-ipa-dump "icf" } } */