gcc/testsuite/g++.old-deja/g++.oliva/expr2.C
raw| 1 | // { dg-do run } |
| 2 | |
| 3 | // Copyright (C) 2000 Free Software Foundation |
| 4 | |
| 5 | // by Alexandre Oliva <[email protected]> |
| 6 | |
| 7 | int i, j; |
| 8 | |
| 9 | const int &f(const int& I, const int& J) { |
| 10 | // this must not be optimized to I because it's an lvalue |
| 11 | return (I != J) ? I : J; |
| 12 | } |
| 13 | |
| 14 | int main () { |
| 15 | return (&f(i, j) != &j); |
| 16 | } |