mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 08:46:08 +00:00

Conversion done using the script at https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34. These are tests where the conversion worked out of the box and no manual fixup was performed.
27 lines
475 B
C++
27 lines
475 B
C++
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
|
|
|
|
class A {
|
|
int a;
|
|
};
|
|
|
|
class B {
|
|
int b;
|
|
public:
|
|
A *getAsA();
|
|
};
|
|
|
|
class X : public A, public B {
|
|
int x;
|
|
};
|
|
|
|
// PR35909 - https://bugs.llvm.org/show_bug.cgi?id=35909
|
|
|
|
A *B::getAsA() {
|
|
return static_cast<X*>(this);
|
|
|
|
// CHECK-LABEL: define{{.*}} ptr @_ZN1B6getAsAEv
|
|
// CHECK: %[[THIS:.*]] = load ptr, ptr
|
|
// CHECK-NEXT: getelementptr inbounds i8, ptr %[[THIS]], i64 -4
|
|
}
|
|
|