summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/varpool-1.c
blob: 48f1cd3593ce86fc06102295b2619fdb88bd2fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-not "unnecesary_static_initialized_variable" } } */

static int unnecesary_static_initialized_variable;
static int *unnecesary_static_initialized_variable2 =
  &unnecesary_static_initialized_variable;
static inline
simplify_after_inline (int param1, int *param2)
{
  if (unnecesary_static_initialized_variable != param1)
    return unnecesary_static_initialized_variable;
  if (unnecesary_static_initialized_variable2 != param2)
    return unnecesary_static_initialized_variable;
}

main ()
{
  return simplify_after_inline (unnecesary_static_initialized_variable,
				unnecesary_static_initialized_variable2) +
    simplify_after_inline (unnecesary_static_initialized_variable,
			   unnecesary_static_initialized_variable2);
}