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
This commit is contained in:
Ben Elliston 2006-09-18 22:24:13 +00:00 committed by Ben Elliston
parent 838d497079
commit 6af7ed0853
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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);
}