summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
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);
+}