From 6af7ed0853685786992383cdaf9c864c7739a0ff Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Mon, 18 Sep 2006 22:24:13 +0000 Subject: [PATCH] const2.C (main): Examine p to prevent an optimising linker from discarding it. * g++.old-deja/g++.pt/const2.C (main): Examine p to prevent an optimising linker from discarding it. From-SVN: r117039 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.old-deja/g++.pt/const2.C | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 + + * g++.old-deja/g++.pt/const2.C (main): Examine p to prevent an + optimising linker from discarding it. + 2006-09-18 Paul Thomas 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 struct B { static const int i = 3; }; template struct A { static const int i = B::i; }; const int *p = &A::i; -int main(){} +int main () +{ + // Examine p to prevent optimising linkers from discarding it. + return (p != 0); +} -- 2.30.2