brintos

brintos / llvm-project-archived public Read only

0
0
Text · 830 B · f8ff818 Raw
32 lines · cpp
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 in3// linking errors for binaries that want to look for symbols in SOs made with4// this ABI.5// Running that linked binary still won't work since we're using conflicting6// ABIs, but we should still be able to link.7 8// RUN: %clang_cc1 %s -triple=aarch64-unknown-fuchsia -O1 -o - -emit-llvm | FileCheck %s9 10// This would be normally n24 (3 ptr widths) but is 12 since the vtable is11// entierely made of i32s now.12// CHECK: _ZTv0_n12_N7Derived1fEi13 14class Base {15public:16  virtual int f(int x);17 18private:19  long x;20};21 22class Derived : public virtual Base {23public:24  virtual int f(int x);25 26private:27  long y;28};29 30int Base::f(int x) { return x + 1; }31int Derived::f(int x) { return x + 2; }32