brintos

brintos / llvm-project-archived public Read only

0
0
Text · 968 B · 923ae38 Raw
43 lines · cpp
1// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fno-rtti -mconstructor-aliases -O1 -disable-llvm-passes | FileCheck %s2 3namespace test1 {4template <typename T> class A {5  ~A() {}6};7template class A<char>;8// CHECK-DAG: define weak_odr dso_local x86_thiscallcc void @"??1?$A@D@test1@@AAE@XZ"9}10 11namespace test2 {12struct A {13  virtual ~A();14};15struct B : A {16  B();17  virtual ~B();18};19 20A::~A() {}21B::~B() {}22void foo() {23  B b;24}25// CHECK-DAG: @"??1B@test2@@UAE@XZ" = dso_local unnamed_addr alias void (ptr), ptr @"??1A@test2@@UAE@XZ"26}27 28namespace test3 {29struct A { virtual ~A(); };30A::~A() {}31}32// CHECK-DAG: define dso_local x86_thiscallcc void @"??1A@test3@@UAE@XZ"(33namespace test3 {34template <typename T>35struct B : A {36  virtual ~B() { }37};38template struct B<int>;39}40// This has to be weak, and emitting weak aliases is fragile, so we don't do the41// aliasing.42// CHECK-DAG: define weak_odr dso_local x86_thiscallcc void @"??1?$B@H@test3@@UAE@XZ"(43