[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / RelativeVTablesABI / thunk-mangling.cpp
blob33f3b98faa92232f818b255b6c63884dad9feeb7
1 // Check that virtual thunks are unaffected by the relative ABI.
2 // The offset of thunks is mangled into the symbol name, which could result in
3 // linking errors for binaries that want to look for symbols in SOs made with
4 // this ABI.
5 // Running that linked binary still won't work since we're using conflicting
6 // ABIs, but we should still be able to link.
8 // RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm | FileCheck %s
10 // This would be normally n24 (3 ptr widths) but is 12 since the vtable is
11 // entierely made of i32s now.
12 // CHECK: _ZTv0_n12_N7Derived1fEi
14 class Base {
15 public:
16 virtual int f(int x);
18 private:
19 long x;
22 class Derived : public virtual Base {
23 public:
24 virtual int f(int x);
26 private:
27 long y;
30 int Base::f(int x) { return x + 1; }
31 int Derived::f(int x) { return x + 2; }