1 // Test that virtual functions of the derived class can be called through
2 // pointers of both base classes without CFI errors.
3 // Related to Bugzilla 43390.
5 // RUN: %clangxx_cfi -o %t1 %s
6 // RUN: %run %t1 2>&1 | FileCheck --check-prefix=CFI %s
10 // CFI-NOT: control flow integrity check
18 virtual void f1() = 0;
23 virtual void f2() = 0;
27 class B
: public A1
, public A2
{
29 void f2() final
{ fprintf(stderr
, "In f2\n"); }
30 void f1() final
{ fprintf(stderr
, "In f1\n"); }
36 static_cast<A1
*>(&b
)->f1();
37 static_cast<A2
*>(&b
)->f2();