aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
blob: 72b61c369527dc91216076dc2d334d1d1629d51f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do link } */
/* { dg-options "-O" } */

/* When optimized we expect the call to foo () in bar to be inlined
   and the call to link_error optimized away.  */

extern void link_error (void);
inline int __attribute__((always_inline)) foo(void) { return 0; }

int main()
{
  int (*fn)(void) = foo;
  if (fn())
    link_error ();
  return 0;
}