view gcc/testsuite/g++.dg/ipa/type-inheritance-1.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Verify that callgraph construction keeps FOO for possible devirtualization
   and removes BAR.  */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-visibility"  } */

extern "C" void abort (void);

class A
{
public:
  virtual int foo (void)
     {
	return 4;
     }
  virtual int bar (void)
     {
	return 5;
     }
};


int t(class A *a)
{
  return a->foo();
}
/* { dg-final { scan-ipa-dump "A::foo"  "visibility"  } } */
/* { dg-final { scan-ipa-dump-not "A::bar"  "visibility"  } } */