* g++.dg/opt/cond1.C: New test.

From-SVN: r72022
This commit is contained in:
Jakub Jelinek 2003-10-02 14:11:45 +02:00 committed by Jakub Jelinek
parent 08903e087e
commit 7485f79f14
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-10-02 Jakub Jelinek <jakub@redhat.com>
* g++.dg/opt/cond1.C: New test.
2003-10-01 Kelley Cook <kelleycook@wideopenwest.com>
* gcc.dg/Wold-style-definition-2.c: New testcase.

View File

@ -0,0 +1,24 @@
// { dg-do run }
// { dg-options "-O2" }
struct D { int x; };
struct W
{
W () {}
D & operator * () { return d; }
D d;
};
int
foo (int y)
{
W m;
(*m).x = (y > 1 ? y : 0);
return (*m).x;
}
int
main ()
{
return (foo (6) != 6);
}