summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/inline_4.c
blob: 1feefa1016882f848e632709029a59fc51d64e32 (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  { target i?86-*-linux* x86_64-*-linux* } } */
/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo2 -fdisable-ipa-inline -Wno-attributes" } */
int g;
__attribute__((always_inline)) void bar (void)
{
  g++;
}

int foo (void)
{
  bar ();
  return g;
}

int foo2 (void)
{
  bar();
  return g + 1;
}

/* { dg-final { scan-tree-dump-times "bar" 4 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-excess-errors "extra notes" } */