[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / windows-itanium-type-info.cpp
blob20bd78df5098372ba44814387f183e5ea97dbdaa
1 // RUN: %clang_cc1 -triple i686-windows-itanium -fdeclspec -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple i686-windows-itanium -fdeclspec -fcxx-exceptions -fno-rtti -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-EH-IMPORT
4 namespace __cxxabiv1 {
5 class __declspec(dllexport) __fundamental_type_info {
6 public:
7 virtual ~__fundamental_type_info();
8 };
10 __fundamental_type_info::~__fundamental_type_info() {}
13 struct __declspec(dllimport) base {
14 virtual void method();
16 struct __declspec(dllexport) derived : base {
17 virtual ~derived();
19 derived::~derived() {
20 method();
23 void f() {
24 throw base();
27 // CHECK-DAG: @_ZTIi = dso_local dllexport constant
28 // CHECK-DAG: @_ZTSi = dso_local dllexport constant
30 // CHECK-DAG: @_ZTI7derived = dso_local dllexport constant
31 // CHECK-DAG: @_ZTS7derived = dso_local dllexport constant
32 // CHECK-DAG: @_ZTV7derived = dso_local dllexport unnamed_addr constant
34 // CHECK-DAG: @_ZTI4base = external dllimport constant
36 // CHECK-EH-IMPORT: @_ZTS4base = linkonce_odr dso_local constant
37 // CHECK-EH-IMPORT: @_ZTI4base = linkonce_odr dso_local constant
39 struct __declspec(dllimport) gatekeeper {};
40 struct zuul : gatekeeper {
41 virtual ~zuul();
43 zuul::~zuul() {}
45 // CHECK-DAG: @_ZTI10gatekeeper = linkonce_odr dso_local constant
46 // CHECK-DAG: @_ZTS10gatekeeper = linkonce_odr dso_local constant