summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx11-exception-spec.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-01-12 22:13:53 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-01-12 22:13:53 +0000
commit0d4fb985042bc00d4a9ed017a652f6840061a6db (patch)
tree25e000363b5bd894dd048f26532216200422a5d9 /clang/test/CodeGenCXX/cxx11-exception-spec.cpp
parentcedca2f0574a7e9430f69247396b1efc9607885c (diff)
downloadbcm5719-llvm-0d4fb985042bc00d4a9ed017a652f6840061a6db.tar.gz
bcm5719-llvm-0d4fb985042bc00d4a9ed017a652f6840061a6db.zip
[patch][pr19848] Produce explicit comdats in clang.
The llvm IR until recently had no support for comdats. This was a problem when targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of dead bits to remain on the executable (unless -ffunction-sections, -fdata-sections and --gc-sections were used). To fix the problem, llvm's codegen will just assume that any weak or linkonce that is not in an explicit comdat should be output in one with the same name as the global. This unfortunately breaks cases like pr19848 where a weak symbol is not xpected to be part of any comdat. Now that we have explicit comdats in the IR, we can finally get both cases right. This first patch just makes clang give explicit comdats to GlobalValues where t is allowed to. A followup patch to llvm will then stop implicitly producing comdats. llvm-svn: 225705
Diffstat (limited to 'clang/test/CodeGenCXX/cxx11-exception-spec.cpp')
-rw-r--r--clang/test/CodeGenCXX/cxx11-exception-spec.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp
index 75f939f93f0..3fb5c15c2ab 100644
--- a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp
+++ b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp
@@ -22,9 +22,9 @@ template<> void S<short>::f() { h(); }
// CHECK: define {{.*}} @_ZN1SIA2_sE1fEv() [[NUW]]
template<> void S<short[2]>::f() noexcept { h(); }
-// CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] {
+// CHECK: define {{.*}} @_Z1fIDsEvv() [[NONE]] comdat {
template void f<char16_t>();
-// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] {
+// CHECK: define {{.*}} @_Z1fIA2_DsEvv() [[NUW]] comdat {
template void f<char16_t[2]>();
// CHECK: define {{.*}} @_ZN1SIDsE1fEv()
@@ -34,9 +34,9 @@ template void S<char16_t>::f();
template void S<char16_t[2]>::f();
void h() {
- // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] {
+ // CHECK: define {{.*}} @_Z1fIiEvv() [[NUW]] comdat {
f<int>();
- // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] {
+ // CHECK: define {{.*}} @_Z1fIA2_iEvv() [[NONE]] comdat {
f<int[2]>();
// CHECK: define {{.*}} @_ZN1SIiE1fEv() [[NUW]]
@@ -45,9 +45,9 @@ void h() {
// CHECK-NOT: [[NUW]]
S<int[2]>::f();
- // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] {
+ // CHECK: define {{.*}} @_Z1fIfEvv() [[NUW]] comdat {
void (*f1)() = &f<float>;
- // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] {
+ // CHECK: define {{.*}} @_Z1fIdEvv() [[NONE]] comdat {
void (*f2)() = &f<double>;
// CHECK: define {{.*}} @_ZN1SIfE1fEv() [[NUW]]
@@ -56,9 +56,9 @@ void h() {
// CHECK-NOT: [[NUW]]
void (*f4)() = &S<double>::f;
- // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] {
+ // CHECK: define {{.*}} @_Z1fIA4_cEvv() [[NUW]] comdat {
(void)&f<char[4]>;
- // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] {
+ // CHECK: define {{.*}} @_Z1fIcEvv() [[NONE]] comdat {
(void)&f<char>;
// CHECK: define {{.*}} @_ZN1SIA4_cE1fEv() [[NUW]]
OpenPOWER on IntegriCloud