llvm-project/clang/test/CodeGenCXX/virtual-function-calls.cpp
Renato Golin 41106188a4 Revert "Decorating virtual functions load with invariant.load" and fix
This reverts commit r248982 as it was breaking the ARM buildbots and the fix didn't work.
This reverts commit r248984, the fix that didn't work.

llvm-svn: 249005
2015-10-01 12:58:41 +00:00

52 lines
684 B
C++

// RUN: %clang_cc1 %s -triple %itanium_abi_triple -std=c++11 -emit-llvm -o - | FileCheck %s
// PR5021
namespace PR5021 {
struct A {
virtual void f(char);
};
void f(A *a) {
// CHECK: call {{.*}}void %
a->f('c');
}
struct B : virtual A {
virtual void f();
};
void f(B * b) {
b->f();
}
}
namespace Test1 {
struct A {
virtual ~A();
};
struct B : A {
virtual ~B();
virtual void f();
};
void f(B *b) {
b->f();
}
}
namespace VirtualNoreturn {
struct A {
[[noreturn]] virtual void f();
};
// CHECK: @_ZN15VirtualNoreturn1f
void f(A *p) {
p->f();
// CHECK: call {{.*}}void %{{[^#]*$}}
// CHECK-NOT: unreachable
}
}