diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-12-14 02:15:55 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-12-14 02:15:55 +0000 |
commit | 532b37d9b8042da2c173b24403412e355e05b5a8 (patch) | |
tree | a576a3c948c951c87c3cfaad1438a0c51beda0d1 /gcc/testsuite/g++.dg | |
parent | fd2ad93d8f325612254ac9c4e434e442bc6aba4a (diff) | |
download | gcc-532b37d9b8042da2c173b24403412e355e05b5a8.zip gcc-532b37d9b8042da2c173b24403412e355e05b5a8.tar.gz gcc-532b37d9b8042da2c173b24403412e355e05b5a8.tar.bz2 |
re PR target/18925 (Invalid gprel relocation in PIC)
PR c++/18925
* class.c (layout_class_type): Determine the visibility of static
data members.
PR c++/18925
* g++.dg/ext/visibility/staticdatamem.C: New test.
From-SVN: r92120
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/visibility/staticdatamem.C | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/visibility/staticdatamem.C b/gcc/testsuite/g++.dg/ext/visibility/staticdatamem.C new file mode 100644 index 0000000..4ec9479 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/staticdatamem.C @@ -0,0 +1,20 @@ +// PR c++/18925 +// { dg-do compile { target ia64-*-linux* } } +// { dg-options "-fPIC -fvisibility=hidden" } +// { dg-final { scan-assembler-not "gprel" } } + +class __attribute__ ((visibility("default"))) Type +{ + private: + static long _staticTypeCount; + public: + Type() { _staticTypeCount++; } + ~Type(); +}; + +long Type::_staticTypeCount = 0; + +Type::~Type() +{ + _staticTypeCount--; +} |