mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 05:10:25 +08:00
* g++.dg/opt/cond1.C: New test.
From-SVN: r72022
This commit is contained in:
parent
08903e087e
commit
7485f79f14
@ -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.
|
||||
|
24
gcc/testsuite/g++.dg/opt/cond1.C
Normal file
24
gcc/testsuite/g++.dg/opt/cond1.C
Normal 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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user