diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog index b6e486f5a17..73b0aa47c44 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog +++ b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog @@ -1,3 +1,7 @@ +2000-05-28 Alexandre Oliva + + * expr2.C: New test. + 2000-04-19 Alexandre Oliva * stkalign.C: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/expr2.C b/gcc/testsuite/g++.old-deja/g++.oliva/expr2.C new file mode 100644 index 00000000000..c1994349acd --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.oliva/expr2.C @@ -0,0 +1,18 @@ +// Copyright (C) 2000 Free Software Foundation + +// by Alexandre Oliva + +// execution test - XFAIL *-*-* + +int i, j; + +const int &f(const int& I, const int& J) { + // this must not be optimized to I because it's an lvalue + return (I != J) ? I : J; +} + +int main () { + if (&f(i, j) != &j) + abort (); + exit (0); +}