diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CodeGenCXX/microsoft-no-rtti-data.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/microsoft-no-rtti-data.cpp')
| -rw-r--r-- | test/CodeGenCXX/microsoft-no-rtti-data.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGenCXX/microsoft-no-rtti-data.cpp b/test/CodeGenCXX/microsoft-no-rtti-data.cpp new file mode 100644 index 000000000000..d4002c28b1a2 --- /dev/null +++ b/test/CodeGenCXX/microsoft-no-rtti-data.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 %s -fno-rtti-data -triple=i386-pc-win32 -o - -emit-llvm | FileCheck %s + +// vftable shouldn't have RTTI data in it. +// CHECK: @"\01??_7S@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast ({{.*}} @"\01??_GS@@UAEPAXI@Z" to i8*)] + +struct type_info; +namespace std { using ::type_info; } + +struct S { + virtual ~S(); +} s; + +struct U : S { + virtual ~U(); +}; + +extern S *getS(); + +const std::type_info &ti = typeid(*getS()); +const U &u = dynamic_cast<U &>(*getS()); +// CHECK: call i8* @__RTDynamicCast(i8* %{{.+}}, i32 0, i8* bitcast ({{.*}} @"\01??_R0?AUS@@@8" to i8*), i8* bitcast ({{.*}} @"\01??_R0?AUU@@@8" to i8*), i32 1) |
