[clang] abeffc9 - [test] Test #pragma GCC visibility interaction with explicit instantiations
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 12 21:29:08 PST 2023
Author: Fangrui Song
Date: 2023-11-12T21:29:03-08:00
New Revision: abeffc9fd6b0cd8f6f25f854e97cd73310c8a7e5
URL: https://github.com/llvm/llvm-project/commit/abeffc9fd6b0cd8f6f25f854e97cd73310c8a7e5
DIFF: https://github.com/llvm/llvm-project/commit/abeffc9fd6b0cd8f6f25f854e97cd73310c8a7e5.diff
LOG: [test] Test #pragma GCC visibility interaction with explicit instantiations
Added:
Modified:
clang/test/CodeGenCXX/visibility.cpp
Removed:
################################################################################
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp
index 903db66a137afb9..b017bc8b52d5a5d 100644
--- a/clang/test/CodeGenCXX/visibility.cpp
+++ b/clang/test/CodeGenCXX/visibility.cpp
@@ -1007,8 +1007,8 @@ namespace test51 {
// a default symbol.
struct HIDDEN foo {};
- DEFAULT foo da, db, dc, dd;
- HIDDEN foo ha, hb, hc, hd;
+ DEFAULT foo da, db, dc, dd, de, df;
+ HIDDEN foo ha, hb, hc, hd, he, hf;
template<foo *z>
void DEFAULT zed() {
}
@@ -1036,14 +1036,26 @@ namespace test51 {
// CHECK-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_2hcEEEEEvv(
// CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_2hcEEEEEvv(
+#pragma GCC visibility push(hidden)
+ template void zed<&dd>();
+ template void zed<&hd>();
+ template void DEFAULT zed<&he>();
+#pragma GCC visibility pop
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_2ddEEEEEvv(
+ // CHECK-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_2hdEEEEEvv(
+ // CHECK-LABEL: define weak_odr void @_ZN6test513zedIXadL_ZNS_2heEEEEEvv(
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_2ddEEEEEvv(
+ // CHECK-HIDDEN-LABEL: define weak_odr hidden void @_ZN6test513zedIXadL_ZNS_2hdEEEEEvv(
+ // CHECK-HIDDEN-LABEL: define weak_odr void @_ZN6test513zedIXadL_ZNS_2heEEEEEvv(
+
void use() {
- zed<&dd>();
- zed<&hd>();
+ zed<&df>();
+ zed<&hf>();
}
- // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2ddEEEEEvv(
- // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2hdEEEEEvv(
- // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2ddEEEEEvv(
- // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2hdEEEEEvv(
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2dfEEEEEvv(
+ // CHECK-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2hfEEEEEvv(
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2dfEEEEEvv(
+ // CHECK-HIDDEN-LABEL: define linkonce_odr hidden void @_ZN6test513zedIXadL_ZNS_2hfEEEEEvv(
}
namespace test52 {
More information about the cfe-commits
mailing list