summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-18 22:24:13 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-18 22:24:13 +0000
commit64d9b7d3c5ccbfc2bef95539d5734a602e8428c5 (patch)
treed7267be9aceb5077a6d3e83cb0084585402903ed /gcc
parent1739aad5578efd03cb389f731190aeb234c269ea (diff)
downloadgcc-64d9b7d3c5ccbfc2bef95539d5734a602e8428c5.tar.gz
* g++.old-deja/g++.pt/const2.C (main): Examine p to prevent an
optimising linker from discarding it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117039 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/const2.C6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 73889e02932..9f266257fbc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-19 Ben Elliston <bje@au.ibm.com>
+
+ * g++.old-deja/g++.pt/const2.C (main): Examine p to prevent an
+ optimising linker from discarding it.
+
2006-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28526
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/const2.C b/gcc/testsuite/g++.old-deja/g++.pt/const2.C
index 1e63ca57822..cb0e2c7a38d 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/const2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/const2.C
@@ -6,4 +6,8 @@ template <class T> struct B { static const int i = 3; };
template <class T> struct A { static const int i = B<T>::i; };
const int *p = &A<int>::i;
-int main(){}
+int main ()
+{
+ // Examine p to prevent optimising linkers from discarding it.
+ return (p != 0);
+}