diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-04-12 06:33:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-04-12 06:33:48 +0000 |
commit | 1e731102619f21fe93135546801e0333752baf15 (patch) | |
tree | 094ff9b55bb63ac087619633c1c3d109473587ff /gcc | |
parent | fc7c5aed6197e36ff67791b09b26993140a296b7 (diff) | |
download | gcc-1e731102619f21fe93135546801e0333752baf15.zip gcc-1e731102619f21fe93135546801e0333752baf15.tar.gz gcc-1e731102619f21fe93135546801e0333752baf15.tar.bz2 |
target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove.
* target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove.
(TARGET_CXX_DETERMINE_CLASS_VISIBILITY): New macro.
(TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise.
(TARGET_CXX): Adjust accordingly.
* target.h (struct gcc_target): Remove epxort_class_data. Add
determine_class_data_visibility and class_data_always_comdat.
* doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Remove.
(TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Document.
(TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise.
* config/arm/arm.c (arm_cxx_export_class_data): Remove.
(arm_cxx_determine_class_data_visibility): New.
(arm_cxx_class_data_always_comdat): Likewise.
(TARGET_CXX_EXPORT_CLASS_DATA): Remove.
(TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define.
(TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise.
* config/arm/arm.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): Define.
* config/arm/symbian.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P):
Define.
* decl2.c (determine_visibility): Don't use export_class_data.
(import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY.
* testsuite/g++.dg/ext/visibility/arm2.C: New test.
* testsuite/g++.dg/ext/visibility/arm3.C: Likewise.
* testsuite/g++.dg/ext/visibility/symbian2.C: Likewise.
From-SVN: r98010
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 36 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 6 | ||||
-rw-r--r-- | gcc/config/arm/symbian.h | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 83 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 21 | ||||
-rw-r--r-- | gcc/target-def.h | 11 | ||||
-rw-r--r-- | gcc/target.h | 18 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 21 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/visibility/arm2.C | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/visibility/arm3.C | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/visibility/symbian2.C | 11 |
13 files changed, 205 insertions, 56 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80308c8..38b643c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2005-04-11 Mark Mitchell <mark@codesourcery.com> + + * target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_VISIBILITY): New macro. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + (TARGET_CXX): Adjust accordingly. + * target.h (struct gcc_target): Remove epxort_class_data. Add + determine_class_data_visibility and class_data_always_comdat. + * doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Document. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.c (arm_cxx_export_class_data): Remove. + (arm_cxx_determine_class_data_visibility): New. + (arm_cxx_class_data_always_comdat): Likewise. + (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): Define. + * config/arm/symbian.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): + Define. + 2005-04-11 Devang Patel <dpatel@apple.com> * tree-data-ref.c (build_classic_dist_vector, diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5091f8e..b713bff 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -172,7 +172,8 @@ static tree arm_get_cookie_size (tree); static bool arm_cookie_has_size (void); static bool arm_cxx_cdtor_returns_this (void); static bool arm_cxx_key_method_may_be_inline (void); -static bool arm_cxx_export_class_data (void); +static void arm_cxx_determine_class_data_visibility (tree); +static bool arm_cxx_class_data_always_comdat (void); static void arm_init_libfuncs (void); static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); @@ -307,8 +308,12 @@ static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); #undef TARGET_CXX_KEY_METHOD_MAY_BE_INLINE #define TARGET_CXX_KEY_METHOD_MAY_BE_INLINE arm_cxx_key_method_may_be_inline -#undef TARGET_CXX_EXPORT_CLASS_DATA -#define TARGET_CXX_EXPORT_CLASS_DATA arm_cxx_export_class_data +#undef TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY +#define TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY \ + arm_cxx_determine_class_data_visibility + +#undef TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT +#define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT arm_cxx_class_data_always_comdat struct gcc_target targetm = TARGET_INITIALIZER; @@ -14318,15 +14323,28 @@ arm_cxx_key_method_may_be_inline (void) return !TARGET_AAPCS_BASED; } -/* The EABI says that the virtual table, etc., for a class must be - exported if it has a key method. The EABI does not specific the - behavior if there is no key method, but there is no harm in - exporting the class data in that case too. */ +static void +arm_cxx_determine_class_data_visibility (tree decl) +{ + if (!TARGET_AAPCS_BASED) + return; + /* In general, \S 3.2.5.5 of the ARM EABI requires that class data + is exported. However, on systems without dynamic vague linkage, + \S 3.2.5.6 says that COMDAT class data has hidden linkage. */ + if (!TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P && DECL_COMDAT (decl)) + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + else + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 1; +} + static bool -arm_cxx_export_class_data (void) +arm_cxx_class_data_always_comdat (void) { - return TARGET_AAPCS_BASED; + /* \S 3.2.5.4 of the ARM C++ ABI says that class data only have + vague linkage if the class has no key function. */ + return !TARGET_AAPCS_BASED; } void diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 59ad92a..5955a52 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2108,6 +2108,12 @@ typedef struct #define ASM_OUTPUT_LABELREF(FILE, NAME) \ arm_asm_output_labelref (FILE, NAME) +/* True if the operating system can merge entities with vague linkage + (e.g., symbols in COMDAT group) during dynamic linking. */ +#ifndef TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P +#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P true +#endif + /* Set the short-call flag for any function compiled in the current compilation unit. We skip this for functions with the section attribute when long-calls are in effect as this tells the compiler diff --git a/gcc/config/arm/symbian.h b/gcc/config/arm/symbian.h index 2a588ed..5ea3fa7 100644 --- a/gcc/config/arm/symbian.h +++ b/gcc/config/arm/symbian.h @@ -87,3 +87,7 @@ builtin_define ("__symbian__"); \ } \ while (false) + + +/* SymbianOS cannot merge entities with vague linkage at runtime. */ +#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 55d6e3e..3019b86 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-04-11 Mark Mitchell <mark@codesourcery.com> + + * decl2.c (determine_visibility): Don't use export_class_data. + (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and + TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. + 2005-04-09 Kazu Hirata <kazu@cs.umass.edu> * cp-tree.h (cxx_alignof): Remove. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 4a2659b..0aa8111 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1644,20 +1644,7 @@ determine_visibility (tree decl) DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type); DECL_VISIBILITY_SPECIFIED (decl) = 1; } - /* If no explicit visibility information has been provided for - this class, some targets require that class data be - exported. */ - else if (TREE_CODE (decl) == VAR_DECL - && targetm.cxx.export_class_data () - && (DECL_TINFO_P (decl) - || (DECL_VTABLE_OR_VTT_P (decl) - /* Construction virtual tables are not emitted - because they cannot be referred to from other - object files; their name is not standardized by - the ABI. */ - && !DECL_CONSTRUCTION_VTABLE_P (decl)))) - DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; - else + else if (!DECL_VISIBILITY_SPECIFIED (decl)) { DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type); DECL_VISIBILITY_SPECIFIED (decl) = 0; @@ -1683,6 +1670,7 @@ import_export_decl (tree decl) int emit_p; bool comdat_p; bool import_p; + tree class_type = NULL_TREE; if (DECL_INTERFACE_KNOWN (decl)) return; @@ -1773,17 +1761,17 @@ import_export_decl (tree decl) ; else if (TREE_CODE (decl) == VAR_DECL && DECL_VTABLE_OR_VTT_P (decl)) { - tree type = DECL_CONTEXT (decl); - import_export_class (type); - if (TYPE_FOR_JAVA (type)) + class_type = DECL_CONTEXT (decl); + import_export_class (class_type); + if (TYPE_FOR_JAVA (class_type)) import_p = true; - else if (CLASSTYPE_INTERFACE_KNOWN (type) - && CLASSTYPE_INTERFACE_ONLY (type)) + else if (CLASSTYPE_INTERFACE_KNOWN (class_type) + && CLASSTYPE_INTERFACE_ONLY (class_type)) import_p = true; else if ((!flag_weak || TARGET_WEAK_NOT_IN_ARCHIVE_TOC) - && !CLASSTYPE_USE_TEMPLATE (type) - && CLASSTYPE_KEY_METHOD (type) - && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type))) + && !CLASSTYPE_USE_TEMPLATE (class_type) + && CLASSTYPE_KEY_METHOD (class_type) + && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))) /* The ABI requires that all virtual tables be emitted with COMDAT linkage. However, on systems where COMDAT symbols don't show up in the table of contents for a static @@ -1795,11 +1783,11 @@ import_export_decl (tree decl) emitted in only one translation unit, we make the virtual table an ordinary definition with external linkage. */ DECL_EXTERNAL (decl) = 0; - else if (CLASSTYPE_INTERFACE_KNOWN (type)) + else if (CLASSTYPE_INTERFACE_KNOWN (class_type)) { - /* TYPE is being exported from this translation unit, so DECL - should be defined here. */ - if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (type)) + /* CLASS_TYPE is being exported from this translation unit, + so DECL should be defined here. */ + if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type)) /* If a class is declared in a header with the "extern template" extension, then it will not be instantiated, even in translation units that would normally require @@ -1810,16 +1798,25 @@ import_export_decl (tree decl) DECL_EXTERNAL (decl) = 0; else { - /* The ABI requires COMDAT linkage. Normally, we only - emit COMDAT things when they are needed; make sure - that we realize that this entity is indeed - needed. */ - comdat_p = true; - mark_needed (decl); + /* The generic C++ ABI says that class data is always + COMDAT, even if there is a key function. Some + variants (e.g., the ARM EABI) says that class data + only has COMDAT linkage if the the class data might + be emitted in more than one translation unit. */ + if (!CLASSTYPE_KEY_METHOD (class_type) + || targetm.cxx.class_data_always_comdat ()) + { + /* The ABI requires COMDAT linkage. Normally, we + only emit COMDAT things when they are needed; + make sure that we realize that this entity is + indeed needed. */ + comdat_p = true; + mark_needed (decl); + } } } else if (!flag_implicit_templates - && CLASSTYPE_IMPLICIT_INSTANTIATION (type)) + && CLASSTYPE_IMPLICIT_INSTANTIATION (class_type)) import_p = true; else comdat_p = true; @@ -1829,6 +1826,7 @@ import_export_decl (tree decl) tree type = TREE_TYPE (DECL_NAME (decl)); if (CLASS_TYPE_P (type)) { + class_type = type; import_export_class (type); if (CLASSTYPE_INTERFACE_KNOWN (type) && TYPE_POLYMORPHIC_P (type) @@ -1841,10 +1839,10 @@ import_export_decl (tree decl) import_p = true; else { - comdat_p = true; if (CLASSTYPE_INTERFACE_KNOWN (type) && !CLASSTYPE_INTERFACE_ONLY (type)) { + comdat_p = targetm.cxx.class_data_always_comdat (); mark_needed (decl); if (!flag_weak) { @@ -1852,6 +1850,8 @@ import_export_decl (tree decl) DECL_EXTERNAL (decl) = 0; } } + else + comdat_p = true; } } else @@ -1916,6 +1916,21 @@ import_export_decl (tree decl) comdat_linkage (decl); } + /* Give the target a chance to override the visibility associated + with DECL. */ + if (TREE_CODE (decl) == VAR_DECL + && (DECL_TINFO_P (decl) + || (DECL_VTABLE_OR_VTT_P (decl) + /* Construction virtual tables are not exported because + they cannot be referred to from other object files; + their name is not standardized by the ABI. */ + && !DECL_CONSTRUCTION_VTABLE_P (decl))) + && TREE_PUBLIC (decl) + && !DECL_REALLY_EXTERN (decl) + && DECL_VISIBILITY_SPECIFIED (decl) + && (!class_type || !CLASSTYPE_VISIBILITY_SPECIFIED (class_type))) + targetm.cxx.determine_class_data_visibility (decl); + DECL_INTERFACE_KNOWN (decl) = 1; } diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 8d57501..9b78560 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -8718,12 +8718,21 @@ some variants of the ABI, an inline function can never be the key method. The default is to return @code{true}. @end deftypefn -@deftypefn {Target Hook} bool TARGET_CXX_EXPORT_CLASS_DATA (void) -If this hook returns false (the default), then virtual tables and RTTI -data structures will have the ELF visibility of their containing -class. If this hook returns true, then these data structures will -have ELF ``default'' visibility, independently of the visibility of -the containing class. +@deftypefn {Target Hook} void TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY (tree @var{decl}) +@var{decl} is a virtual table, virtual table table, typeinfo object, +or other similar implicit class data object that will be emitted with +external linkage in this translation unit. No ELF visibility has been +explicitly specified. If the target needs to specify a visibility +other than that of the containing class, use this hook to set +@code{DECL_VISIBILITY} and @code{DECL_VISIBILITY_SPECIFIED}. +@end deftypefn + +@deftypefn {Target Hook} bool TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT (void) +This hook returns true (the default) if virtual tables and other +similar implicit class data objects are always COMDAT if they have +external linkage. If this hook returns false, then class data for +classes whose virtual table will be emitted in only one translation +unit will not be COMDAT. @end deftypefn @node Misc diff --git a/gcc/target-def.h b/gcc/target-def.h index aa65e37..44e3791 100644 --- a/gcc/target-def.h +++ b/gcc/target-def.h @@ -469,8 +469,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TARGET_CXX_KEY_METHOD_MAY_BE_INLINE hook_bool_void_true #endif -#ifndef TARGET_CXX_EXPORT_CLASS_DATA -#define TARGET_CXX_EXPORT_CLASS_DATA hook_bool_void_false +#ifndef TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY +#define TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY hook_void_tree +#endif + +#ifndef TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT +#define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_true #endif #define TARGET_CXX \ @@ -482,7 +486,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. TARGET_CXX_IMPORT_EXPORT_CLASS, \ TARGET_CXX_CDTOR_RETURNS_THIS, \ TARGET_CXX_KEY_METHOD_MAY_BE_INLINE, \ - TARGET_CXX_EXPORT_CLASS_DATA \ + TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY, \ + TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT, \ } /* The whole shebang. */ diff --git a/gcc/target.h b/gcc/target.h index 42a721c..2cb4db2 100644 --- a/gcc/target.h +++ b/gcc/target.h @@ -589,10 +589,20 @@ struct gcc_target itself. Returning true is the behavior required by the Itanium C++ ABI. */ bool (*key_method_may_be_inline) (void); - /* Returns true if all class data (virtual tables, type info, - etc.) should be exported from the current DLL, even when the - associated class is not exported. */ - bool (*export_class_data) (void); + /* DECL is a virtual table, virtual table table, typeinfo object, + or other similar implicit class data object that will be + emitted with external linkage in this translation unit. No ELF + visibility has been explicitly specified. If the target needs + to specify a visibility other than that of the containing class, + use this hook to set DECL_VISIBILITY and + DECL_VISIBILITY_SPECIFIED. */ + void (*determine_class_data_visibility) (tree decl); + /* Returns true (the default) if virtual tables and other + similar implicit class data objects are always COMDAT if they + have external linkage. If this hook returns false, then + class data for classes whose virtual table will be emitted in + only one translation unit will not be COMDAT. */ + bool (*class_data_always_comdat) (void); } cxx; /* Leave the boolean fields at the end. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1786a40..3e7c29d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,26 @@ 2005-04-11 Mark Mitchell <mark@codesourcery.com> + * target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_VISIBILITY): New macro. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + (TARGET_CXX): Adjust accordingly. + * target.h (struct gcc_target): Remove epxort_class_data. Add + determine_class_data_visibility and class_data_always_comdat. + * doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Document. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.c (arm_cxx_export_class_data): Remove. + (arm_cxx_determine_class_data_visibility): New. + (arm_cxx_class_data_always_comdat): Likewise. + (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): Define. + * config/arm/symbian.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): + Define. + +2005-04-11 Mark Mitchell <mark@codesourcery.com> + * lib/wrapper.exp (${tool}_maybe_build_wrapper): Don't unset gluefile. 2005-04-11 Geoffrey Keating <geoffk@apple.com> diff --git a/gcc/testsuite/g++.dg/ext/visibility/arm2.C b/gcc/testsuite/g++.dg/ext/visibility/arm2.C new file mode 100644 index 0000000..7eed18d --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/arm2.C @@ -0,0 +1,11 @@ +// { dg-do compile { target arm*-*-*eabi* arm*-*-symbianelf* } } +// Class data should be exported. +// { dg-final { scan-not-hidden "_ZTV1S" } } +// { dg-final { scan-not-hidden "_ZTI1S" } } +// { dg-final { scan-not-hidden "_ZTS1S" } } + +struct S { + virtual void f(); +}; + +void S::f() {} diff --git a/gcc/testsuite/g++.dg/ext/visibility/arm3.C b/gcc/testsuite/g++.dg/ext/visibility/arm3.C new file mode 100644 index 0000000..f97813d --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/arm3.C @@ -0,0 +1,12 @@ +// { dg-do compile { target arm*-*-*eabi* } } +// { dg-options "-fvisibility=hidden" } +// Class data should be exported. +// { dg-final { scan-not-hidden "_ZTI1A" } } +// { dg-final { scan-not-hidden "_ZTS1A" } } +// { dg-final { scan-not-hidden "_ZTV1B" } } +// { dg-final { scan-not-hidden "_ZTI1B" } } +// { dg-final { scan-not-hidden "_ZTS1B" } } + +struct A {}; +struct B : virtual public A {}; +B b; diff --git a/gcc/testsuite/g++.dg/ext/visibility/symbian2.C b/gcc/testsuite/g++.dg/ext/visibility/symbian2.C new file mode 100644 index 0000000..767f0b5 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/symbian2.C @@ -0,0 +1,11 @@ +// { dg-do compile { target arm*-*-symbianelf* } } +// Class data should not be exported. +// { dg-final { scan-hidden "_ZTI1A" } } +// { dg-final { scan-hidden "_ZTS1A" } } +// { dg-final { scan-hidden "_ZTV1B" } } +// { dg-final { scan-hidden "_ZTI1B" } } +// { dg-final { scan-hidden "_ZTS1B" } } + +struct A {}; +struct B : virtual public A {}; +B b; |