171568a9eSLeonard Chan // Check that virtual thunks are unaffected by the relative ABI. 271568a9eSLeonard Chan // The offset of thunks is mangled into the symbol name, which could result in 371568a9eSLeonard Chan // linking errors for binaries that want to look for symbols in SOs made with 471568a9eSLeonard Chan // this ABI. 571568a9eSLeonard Chan // Running that linked binary still won't work since we're using conflicting 671568a9eSLeonard Chan // ABIs, but we should still be able to link. 771568a9eSLeonard Chan 8*e6f88dc0SLeonard Chan // RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -S -o - -emit-llvm | FileCheck %s 971568a9eSLeonard Chan 1071568a9eSLeonard Chan // This would be normally n24 (3 ptr widths) but is 12 since the vtable is 1171568a9eSLeonard Chan // entierely made of i32s now. 1271568a9eSLeonard Chan // CHECK: _ZTv0_n12_N7Derived1fEi 1371568a9eSLeonard Chan 1471568a9eSLeonard Chan class Base { 1571568a9eSLeonard Chan public: 1671568a9eSLeonard Chan virtual int f(int x); 1771568a9eSLeonard Chan 1871568a9eSLeonard Chan private: 1971568a9eSLeonard Chan long x; 2071568a9eSLeonard Chan }; 2171568a9eSLeonard Chan 2271568a9eSLeonard Chan class Derived : public virtual Base { 2371568a9eSLeonard Chan public: 2471568a9eSLeonard Chan virtual int f(int x); 2571568a9eSLeonard Chan 2671568a9eSLeonard Chan private: 2771568a9eSLeonard Chan long y; 2871568a9eSLeonard Chan }; 2971568a9eSLeonard Chan f(int x)3071568a9eSLeonard Chanint Base::f(int x) { return x + 1; } f(int x)3171568a9eSLeonard Chanint Derived::f(int x) { return x + 2; } 32