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.
7
8 // RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm -fexperimental-relative-c++-abi-vtables | FileCheck %s
9
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
13
14 class Base {
15 public:
16 virtual int f(int x);
17
18 private:
19 long x;
20 };
21
22 class Derived : public virtual Base {
23 public:
24 virtual int f(int x);
25
26 private:
27 long y;
28 };
29
f(int x)30 int Base::f(int x) { return x + 1; }
f(int x)31 int Derived::f(int x) { return x + 2; }
32