From: Ben Elliston Date: Mon, 18 Sep 2006 22:24:13 +0000 (+0000) Subject: const2.C (main): Examine p to prevent an optimising linker from discarding it. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6af7ed0853685786992383cdaf9c864c7739a0ff;p=gcc.git 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 --- 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); +}