brintos

brintos / llvm-project-archived public Read only

0
0
Text · 884 B · 8d1a15e Raw
29 lines · cpp
1// Assert that the ABI switch uses the proper codegen. Fuchsia uses the2// "return this" ABI on constructors and destructors by default, but if we3// explicitly choose the generic itanium C++ ABI, we should not return "this" on4// ctors/dtors.5//6// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-unknown-fuchsia -fc++-abi=itanium | FileCheck %s7// RUN: %clang_cc1 %s -emit-llvm -o - -triple=aarch64-unknown-fuchsia -fc++-abi=itanium | FileCheck %s8 9class A {10public:11  virtual ~A();12  int x_;13};14 15class B : public A {16public:17  B(int *i);18  virtual ~B();19  int *i_;20};21 22B::B(int *i) : i_(i) {}23B::~B() {}24 25// CHECK: define{{.*}} void @_ZN1BC2EPi(ptr {{[^,]*}} %this, ptr noundef %i)26// CHECK: define{{.*}} void @_ZN1BC1EPi(ptr {{[^,]*}} %this, ptr noundef %i)27// CHECK: define{{.*}} void @_ZN1BD2Ev(ptr {{[^,]*}} %this)28// CHECK: define{{.*}} void @_ZN1BD1Ev(ptr {{[^,]*}} %this)29