* expr2.C: New test.
authorAlexandre Oliva <aoliva@cygnus.com>
Sun, 28 May 2000 14:20:27 +0000 (14:20 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sun, 28 May 2000 14:20:27 +0000 (14:20 +0000)
From-SVN: r34234

gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/expr2.C [new file with mode: 0644]

index b6e486f..73b0aa4 100644 (file)
@@ -1,3 +1,7 @@
+2000-05-28  Alexandre Oliva  <aoliva@cygnus.com>
+
+       * expr2.C: New test.
+
 2000-04-19  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
        * 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 (file)
index 0000000..c199434
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright (C) 2000 Free Software Foundation
+
+// by Alexandre Oliva <aoliva@cygnus.com>
+
+// 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);
+}