view gcc/testsuite/g++.dg/ext/always_inline-5.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile }
struct f
{
  inline f(void);
  inline void f1(void);
  int a;
};

inline __attribute__((always_inline))  f::f(void)
{
  a++;
}

inline __attribute__((always_inline)) void  f::f1(void)
{
  a++;
}

void g(void)
{
  f a, b, c, d;
  a.f1();
}

// f::f() should be inlined even at -O0
// { dg-final { scan-assembler-not "_ZN1fC1Ev" } }
// Likewise for f::f1()
// { dg-final { scan-assembler-not "_ZN1f2f1Ev" } }